:root {
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-soft: 0 12px 40px rgba(11, 18, 32, 0.12);
  --shadow-card: 0 16px 44px rgba(15, 23, 42, 0.10);
  --shadow-focus: 0 0 0 4px rgba(59, 130, 246, 0.16);

  --bg: #f4f7fb;
  --bg-soft: #eef3fa;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-muted: rgba(245, 248, 252, 0.92);
  --text: #10213a;
  --text-soft: #5e718e;
  --text-faint: #8492aa;
  --border: rgba(103, 128, 170, 0.18);
  --border-strong: rgba(103, 128, 170, 0.28);
  --primary: #3b82f6;
  --primary-strong: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.12);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.16);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.16);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.16);
  --danger-surface: #fff5f5;
  --info: #0f766e;
  --info-soft: rgba(15, 118, 110, 0.15);
  --muted: #94a3b8;
  --paused: rgba(100, 116, 139, 0.18);
  --gradient-1: radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 42%);
  --gradient-2: radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 36%);
  --gradient-3: linear-gradient(135deg, rgba(255,255,255,0.84), rgba(255,255,255,0.68));
}

html[data-theme="dark"] {
  --bg: #0a1020;
  --bg-soft: #0f1730;
  --surface: rgba(13, 20, 39, 0.84);
  --surface-strong: rgba(15, 23, 42, 0.96);
  --surface-muted: rgba(17, 26, 48, 0.92);
  --text: #edf4ff;
  --text-soft: #9aa8c1;
  --text-faint: #73839f;
  --border: rgba(151, 170, 215, 0.14);
  --border-strong: rgba(151, 170, 215, 0.24);
  --primary: #7cb8ff;
  --primary-strong: #4f9bff;
  --primary-soft: rgba(124, 184, 255, 0.15);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.18);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.18);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.18);
  --danger-surface: rgba(100, 30, 36, 0.30);
  --info: #22d3ee;
  --info-soft: rgba(34, 211, 238, 0.14);
  --paused: rgba(148, 163, 184, 0.18);
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.34);
  --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.28);
  --gradient-1: radial-gradient(circle at top left, rgba(76, 156, 255, 0.18), transparent 42%);
  --gradient-2: radial-gradient(circle at top right, rgba(17, 184, 150, 0.12), transparent 36%);
  --gradient-3: linear-gradient(135deg, rgba(18, 27, 50, 0.85), rgba(15, 21, 38, 0.72));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

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

a:hover { text-decoration: underline; }

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: .9em;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: .6;
}

input, textarea {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 180px;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

textarea:focus,
.field-input:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

textarea:focus { outline: none; }

.app-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    var(--gradient-1),
    var(--gradient-2),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1600px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.auth-topbar,
.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dashboard-topbar {
  flex-wrap: wrap;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: 1 1 720px;
  flex-wrap: wrap;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-soft), transparent), var(--surface-muted);
  border: 1px solid var(--border);
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.brand-icon {
  font-variation-settings: "FILL" 1;
}

.brand-note,
.topbar-copy p,
.card-header p,
.panel-note,
.snapshot-meta,
.field-help,
.small-meta,
.code-block strong,
.toggle-copy small,
.subtle-tag {
  color: var(--text-soft);
}

.topbar-copy h1,
.hero-card h1,
.card-header h2,
.detail-header h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.1vw, 2rem);
  line-height: 1.12;
}

.topbar-copy p,
.detail-header p,
.hero-copy {
  margin: 6px 0 0;
  max-width: 70ch;
}

.topbar-pills,
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-weight: 600;
}

.pill-success { color: var(--success); }
.pill-warning { color: var(--warning); }
.pill-danger { color: var(--danger); }
.pill-info { color: var(--primary-strong); }

.theme-toggle,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.theme-toggle:hover,
.btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: white;
  border-color: transparent;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--surface-muted), rgba(255,255,255,0.04));
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-soft), transparent), var(--danger-surface);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.18);
}

.btn-small {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: .92rem;
}

.btn-block {
  width: 100%;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.alert strong { display: inline-block; margin-bottom: 4px; }

.alert-success {
  border-color: rgba(22, 163, 74, 0.22);
  background: linear-gradient(135deg, var(--success-soft), transparent), var(--surface);
}

.alert-danger {
  border-color: rgba(220, 38, 38, 0.22);
  background: linear-gradient(135deg, var(--danger-soft), transparent), var(--surface);
}

.alert-warning {
  border-color: rgba(217, 119, 6, 0.22);
  background: linear-gradient(135deg, var(--warning-soft), transparent), var(--surface);
}

.stats-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat-card,
.panel,
.auth-card,
.hero-card,
.mini-card,
.snapshot-card,
.code-block {
  background: var(--gradient-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
}

.stat-card span,
.mini-card span {
  display: block;
  color: var(--text-soft);
  font-size: .92rem;
}

.stat-card strong,
.mini-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.5rem;
  line-height: 1;
}

.stat-icon,
.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  flex: 0 0 auto;
}

.stat-icon {
  width: 54px;
  height: 54px;
  font-size: 28px;
}

.section-icon {
  width: 50px;
  height: 50px;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.stat-icon-success { background: var(--success-soft); color: var(--success); }
.stat-icon-danger { background: var(--danger-soft); color: var(--danger); }
.stat-icon-warning { background: var(--warning-soft); color: var(--warning); }
.stat-icon-info { background: var(--info-soft); color: var(--info); }
.stat-icon-muted { background: var(--paused); color: var(--text-soft); }
.stat-icon-neutral { background: var(--primary-soft); color: var(--primary-strong); }

.auth-layout {
  display: grid;
  gap: 22px;
  margin-top: 22px;
  grid-template-columns: 1.15fr .85fr;
  align-items: stretch;
}

.hero-card,
.auth-card,
.panel {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.hero-card {
  position: relative;
  overflow: hidden;
}

.hero-kicker,
.detail-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
  margin-bottom: 18px;
}

.feature-list {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.feature-item strong,
.toggle-copy strong,
.site-title,
.snapshot-title {
  display: block;
  margin-bottom: 4px;
}

.card-header,
.sub-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.form-stack,
.meta-stack,
.action-stack,
.code-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-weight: 700;
  color: var(--text);
}

.field-input {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.field-input-error,

.field-input-textarea {
  align-items: flex-start;
  padding-top: 12px;
}

.field-input-textarea .material-symbols-rounded {
  margin-top: 8px;
}

.field-input-textarea textarea {
  min-height: 120px;
  padding: 10px 0 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.textarea-error {
  border-color: rgba(220, 38, 38, 0.35) !important;
}

.field-error,
.small-error {
  color: var(--danger);
  font-size: .92rem;
}

.field-help {
  font-size: .9rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 56px;
  height: 32px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.switch-slider {
  width: 56px;
  height: 32px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.36);
  border: 1px solid var(--border);
  transition: background .18s ease;
}

.switch-slider::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  transition: transform .18s ease;
}

.switch input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.switch input:checked + .switch-slider::after {
  transform: translateX(24px);
}

.form-actions,
.action-stack-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-grid {
  display: grid;
  gap: 20px;
  margin-top: 20px;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
}

.sidebar-stack,
.content-stack,
.detail-columns {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.monitor-table,
.compact-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 960px;
}

.monitor-table thead th,
.compact-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-strong);
  color: var(--text-soft);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 14px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.monitor-table tbody td,
.compact-table tbody td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.monitor-table tbody tr:hover,
.compact-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

.site-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 250px;
}

.meta-stack {
  gap: 6px;
  min-width: 160px;
  color: var(--text-soft);
  font-size: .95rem;
}

.stack-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: .86rem;
  text-transform: lowercase;
}

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

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

.badge-danger-soft {
  background: rgba(255, 111, 97, 0.14);
  color: #ff6f61;
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-info {
  background: var(--info-soft);
  color: var(--info);
}

.badge-muted {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-soft);
}

.badge-paused {
  background: var(--paused);
  color: var(--text-soft);
}

.action-stack {
  gap: 10px;
  min-width: 160px;
}

.detail-panel {
  padding-top: 22px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.mini-stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.mini-card {
  padding: 18px;
  border-radius: 18px;
}

.sub-panel {
  padding: 0;
}

.snapshot-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.snapshot-card {
  padding: 18px;
  border-radius: 20px;
}

.snapshot-text {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  max-height: 250px;
  overflow: auto;
}

.snapshot-summary {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.code-block {
  padding: 16px;
  border-radius: 18px;
}

.code-block code {
  display: block;
  margin-top: 10px;
  white-space: normal;
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-muted);
}

.cron-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.mini-stat {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.mini-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.mini-stat-label {
  color: var(--text-soft);
  font-size: .9rem;
}

.cron-run-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cron-run-item {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.cron-run-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.cron-run-grid {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  color: var(--text-soft);
  margin-bottom: 8px;
}

.cron-run-grid strong {
  color: var(--text);
}

.empty-state {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-radius: 20px;
  border: 1px dashed var(--border-strong);
  background: var(--surface-muted);
  color: var(--text-soft);
}

.empty-state.compact {
  padding: 16px;
}

.material-symbols-rounded {
  font-size: 1.3rem;
  vertical-align: middle;
}

.theme-toggle .material-symbols-rounded,
.btn .material-symbols-rounded,
.pill .material-symbols-rounded,
.brand-pill .material-symbols-rounded,
.hero-kicker .material-symbols-rounded,
.detail-eyebrow .material-symbols-rounded,
.alert .material-symbols-rounded {
  font-size: 1.18rem;
}

@media (max-width: 1320px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .auth-layout,
  .snapshot-grid,
  .two-cols,
  .mini-stats,
  .cron-summary-grid,
  .cron-run-grid {
    grid-template-columns: 1fr;
  }

  .auth-topbar,
  .dashboard-topbar,
  .detail-header {
    align-items: stretch;
  }

  .topbar-main {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 100%);
    margin: 12px auto 26px;
  }

  .hero-card,
  .auth-card,
  .panel,
  .auth-topbar,
  .dashboard-topbar {
    padding: 18px;
    border-radius: 22px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-lockup,
  .toolbar-actions,
  .topbar-pills {
    width: 100%;
  }

  .toolbar-actions .btn,
  .toolbar-actions .theme-toggle {
    flex: 1 1 auto;
  }

  .toggle-row,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

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

  .btn,
  .theme-toggle {
    width: 100%;
  }
}

.path-strong {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.92rem;
  line-height: 1.35;
}

/* --- monitor table compact + bulk tools v6 --- */
body {
  font-size: 15px;
}

.app-shell {
  width: min(1480px, calc(100% - 24px));
  margin: 18px auto 32px;
}

select {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

.table-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(2, minmax(180px, .8fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 4px 0 18px;
}

.table-toolbar .subtle-tag-right {
  justify-self: end;
  align-self: center;
  white-space: nowrap;
}

.toolbar-inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-field {
  min-width: 0;
}

.compact-field {
  gap: 6px;
}

.compact-field .field-label {
  font-size: .82rem;
}

.compact-input {
  min-height: 46px;
  padding: 0 12px;
  border-radius: 14px;
}

.bulk-form-shell {
  display: none;
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.bulk-select-all input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-strong);
}

.bulk-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(180px, .9fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.bulk-submit-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: end;
}

.monitor-table {
  table-layout: fixed;
  min-width: 0;
  font-size: .91rem;
}

.monitor-table thead th,
.monitor-table tbody td {
  padding-left: 10px;
  padding-right: 10px;
}

.monitor-table thead th {
  font-size: .74rem;
  padding-top: 12px;
  padding-bottom: 12px;
}

.monitor-table thead th:first-child,
.monitor-table tbody td:first-child {
  width: 54px;
}

.monitor-table thead th:nth-child(2) { width: 24%; }
.monitor-table thead th:nth-child(3) { width: 12%; }
.monitor-table thead th:nth-child(4) { width: 14%; }
.monitor-table thead th:nth-child(5) { width: 15%; }
.monitor-table thead th:nth-child(7) { width: 168px; }

.table-cell-select {
  text-align: center;
}

.monitor-selector {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-strong);
}

.site-cell {
  min-width: 0;
  max-width: 100%;
  gap: 4px;
}

.site-title {
  font-size: .95rem;
  line-height: 1.26;
}

.site-link {
  display: inline-block;
  font-size: .86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.compact-meta {
  font-size: .85rem;
  line-height: 1.38;
}

.compact-meta strong {
  font-weight: 700;
}

.summary-cell,
.summary-cell .summary-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.summary-cell .summary-text {
  color: var(--text-soft);
  font-size: .84rem;
}

.compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.btn-icon {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 12px;
}

.btn-icon span {
  display: none;
}

.btn-icon .material-symbols-rounded {
  font-size: 1.06rem;
}

.path-strong {
  font-size: .88rem;
}

@media (max-width: 1440px) {
  .dashboard-grid {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  }

  .bulk-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .monitor-table {
    font-size: .88rem;
  }
}

@media (max-width: 1200px) {
  .table-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-toolbar .subtle-tag-right {
    justify-self: start;
    white-space: normal;
  }
}

@media (max-width: 980px) {
  .bulk-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .bulk-grid,
  .table-toolbar {
    grid-template-columns: 1fr;
  }

  .monitor-table,
  .monitor-table thead,
  .monitor-table tbody,
  .monitor-table tr,
  .monitor-table td {
    display: block;
    width: 100%;
  }

  .monitor-table thead {
    display: none;
  }

  .monitor-table tbody {
    display: grid;
    gap: 12px;
  }

  .monitor-table tbody tr {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-muted);
  }

  .monitor-table tbody td {
    padding: 0;
    border-bottom: 0;
    margin-bottom: 10px;
  }

  .monitor-table tbody td:last-child {
    margin-bottom: 0;
  }

  .monitor-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--text-faint);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
  }

  .table-cell-select {
    text-align: left;
  }

  .action-stack-row {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .app-shell {
    width: min(100% - 16px, 100%);
    margin: 10px auto 24px;
  }

  .brand-pill {
    padding: 10px 14px;
  }

  .site-title {
    font-size: .92rem;
  }
}


/* --- tighter desktop table fit v7 --- */
.app-shell {
  width: min(1720px, calc(100% - 20px));
}

.dashboard-grid {
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
}

.monitor-table {
  font-size: .85rem;
}

.monitor-table thead th,
.monitor-table tbody td {
  padding-left: 8px;
  padding-right: 8px;
}

.monitor-table thead th {
  font-size: .7rem;
}

.monitor-table thead th:nth-child(2) { width: 23%; }
.monitor-table thead th:nth-child(3) { width: 11%; }
.monitor-table thead th:nth-child(4) { width: 13%; }
.monitor-table thead th:nth-child(5) { width: 14%; }
.monitor-table thead th:nth-child(6) { width: 17%; }
.monitor-table thead th:nth-child(7) { width: 148px; }

.site-title {
  font-size: .84rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.site-link,
.summary-cell .summary-text,
.compact-meta {
  font-size: .78rem;
  line-height: 1.3;
}

.compact-actions {
  flex-wrap: nowrap;
  gap: 4px;
}

.btn-icon {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 10px;
}

.btn-icon .material-symbols-rounded {
  font-size: .98rem;
}

@media (max-width: 1500px) {
  .app-shell {
    width: min(100%, calc(100% - 14px));
  }

  .dashboard-grid {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  }

  .monitor-table {
    font-size: .81rem;
  }

  .site-title {
    font-size: .8rem;
  }

  .site-link,
  .summary-cell .summary-text,
  .compact-meta {
    font-size: .75rem;
  }

  .monitor-table thead th:nth-child(2) { width: 21%; }
  .monitor-table thead th:nth-child(5) { width: 13%; }
  .monitor-table thead th:nth-child(6) { width: 18%; }
  .monitor-table thead th:nth-child(7) { width: 136px; }
}


/* --- overflow fix v8 --- */
.table-wrap {
  overflow-x: hidden;
}

.monitor-table,
.compact-table {
  min-width: 0;
}

.monitor-table {
  width: 100%;
  table-layout: fixed;
}

.monitor-table thead th,
.monitor-table tbody td {
  box-sizing: border-box;
  overflow: hidden;
}

.monitor-table thead th:nth-child(1),
.monitor-table tbody td:nth-child(1) { width: 42px; }
.monitor-table thead th:nth-child(2),
.monitor-table tbody td:nth-child(2) { width: 29%; }
.monitor-table thead th:nth-child(3),
.monitor-table tbody td:nth-child(3) { width: 8%; }
.monitor-table thead th:nth-child(4),
.monitor-table tbody td:nth-child(4) { width: 15%; }
.monitor-table thead th:nth-child(5),
.monitor-table tbody td:nth-child(5) { width: 15%; }
.monitor-table thead th:nth-child(6),
.monitor-table tbody td:nth-child(6) { width: 21%; }
.monitor-table thead th:nth-child(7),
.monitor-table tbody td:nth-child(7) { width: 88px; }

.site-cell,
.meta-stack,
.summary-cell,
.summary-cell .summary-text,
.site-title,
.site-link,
.compact-meta {
  min-width: 0 !important;
  max-width: 100%;
}

.site-cell {
  gap: 3px;
}

.site-title,
.site-link,
.summary-cell .summary-text,
.compact-meta,
.summary-email {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.site-title {
  font-size: .8rem;
  line-height: 1.18;
}

.site-link,
.compact-meta,
.summary-cell .summary-text,
.summary-email {
  font-size: .74rem;
  line-height: 1.22;
}

.summary-cell {
  display: block;
}

.summary-cell > div {
  margin-bottom: 4px;
}

.summary-email {
  display: inline-block;
}

.stack-badges {
  gap: 6px;
}

.badge {
  min-height: 26px;
  padding: 0 10px;
  font-size: .78rem;
}

.compact-actions {
  display: grid;
  grid-template-columns: repeat(2, 32px);
  justify-content: end;
  align-content: start;
  gap: 5px;
}

.btn-icon {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
}

.small-error {
  font-size: .74rem;
  line-height: 1.18;
}

@media (max-width: 1500px) {
  .dashboard-grid {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  }

  .monitor-table thead th:nth-child(2),
  .monitor-table tbody td:nth-child(2) { width: 26%; }
  .monitor-table thead th:nth-child(6),
  .monitor-table tbody td:nth-child(6) { width: 22%; }
}

@media (max-width: 1280px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .monitor-table {
    min-width: 1080px;
  }
}

/* --- detail dashboard + visible action buttons v9 --- */
.monitor-table thead th:nth-child(2),
.monitor-table tbody td:nth-child(2) { width: 24%; }
.monitor-table thead th:nth-child(3),
.monitor-table tbody td:nth-child(3) { width: 10%; }
.monitor-table thead th:nth-child(4),
.monitor-table tbody td:nth-child(4) { width: 14%; }
.monitor-table thead th:nth-child(5),
.monitor-table tbody td:nth-child(5) { width: 14%; }
.monitor-table thead th:nth-child(6),
.monitor-table tbody td:nth-child(6) { width: 20%; }
.monitor-table thead th:nth-child(7),
.monitor-table tbody td:nth-child(7) { width: 178px; }

.site-title-link {
  display: inline-block;
  color: var(--text-strong);
  text-decoration: none;
}

.site-title-link:hover {
  color: var(--accent);
}

.compact-actions-vertical {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.compact-actions-vertical form {
  margin: 0;
  width: 100%;
}

.btn-action-line {
  width: 100%;
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 12px;
  gap: 8px;
  border-radius: 12px;
  white-space: normal;
  text-align: left;
  font-size: .78rem;
  line-height: 1.2;
}

.btn-action-line .material-symbols-rounded {
  font-size: 1rem;
}

.monitor-detail-page {
  gap: 18px;
}

.monitor-detail-topbar {
  margin-bottom: 0;
}

.monitor-hero {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .95fr);
  align-items: start;
}

.monitor-hero-main h2 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.monitor-hero-main p {
  margin: 0;
  color: var(--text-soft);
}

.monitor-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--accent);
  font-weight: 700;
  font-size: .88rem;
}

.monitor-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.monitor-hero-side {
  display: grid;
  gap: 12px;
}

.health-overview-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.monitor-detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, .95fr);
  align-items: start;
}

.monitor-detail-main,
.monitor-detail-side {
  display: grid;
  gap: 18px;
}

.chart-panel .card-header,
.monitor-detail-side .card-header {
  margin-bottom: 18px;
}

.response-chart-shell {
  padding: 12px 0 4px;
}

.response-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  color: var(--accent);
}

.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-axis-label {
  fill: var(--text-soft);
  font-size: 11px;
  font-family: Inter, system-ui, sans-serif;
}

.chart-area {
  fill: url(#monitorz-chart-fill);
  stroke: none;
}

.chart-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: currentColor;
  stroke: var(--surface);
  stroke-width: 2;
}

.chart-dot-danger {
  fill: var(--danger);
}

.chart-metrics-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.detail-table-wrap {
  overflow-x: auto;
}

.detail-history-table {
  min-width: 860px;
}

.detail-history-table th,
.detail-history-table td {
  font-size: .8rem;
}

.history-detail-stack {
  display: grid;
  gap: 4px;
}

.detail-meta-list {
  display: grid;
  gap: 10px;
  font-size: .85rem;
  color: var(--text-soft);
}

.detail-meta-list strong {
  color: var(--text-strong);
}

.detail-snapshot-grid {
  grid-template-columns: 1fr;
}

.monitor-detail-side .btn-block {
  width: 100%;
}

@media (max-width: 1600px) {
  .health-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1380px) {
  .monitor-detail-grid {
    grid-template-columns: 1fr;
  }

  .monitor-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1280px) {
  .monitor-table {
    min-width: 1220px;
  }
}

@media (max-width: 960px) {
  .health-overview-grid,
  .chart-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .health-overview-grid,
  .chart-metrics-grid {
    grid-template-columns: 1fr;
  }

  .monitor-detail-page {
    gap: 14px;
  }
}

/* --- monitor detail harmony refresh v10 --- */
:root {
  --text-strong: #10213a;
  --accent: var(--primary-strong);
}

html[data-theme="dark"] {
  --text-strong: #edf4ff;
  --accent: var(--primary);
}

.monitor-detail-page {
  display: grid;
  gap: 26px;
  width: min(1640px, calc(100% - 40px));
  margin: 28px auto 48px;
}

.monitor-detail-page .alert {
  margin: 0;
}

.monitor-detail-topbar {
  margin-bottom: 0;
  padding: 22px 24px;
  border-radius: 30px;
}

.monitor-detail-topbar .topbar-copy h1 {
  font-size: clamp(1.9rem, 2.8vw, 2.45rem);
}

.monitor-detail-topbar .topbar-copy p {
  margin-top: 8px;
}

.monitor-detail-topbar .toolbar-actions {
  gap: 12px;
}

.monitor-detail-topbar .toolbar-actions form {
  margin: 0;
}

.monitor-hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
  gap: 24px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 38%),
    radial-gradient(circle at bottom left, rgba(15, 118, 110, 0.08), transparent 32%),
    var(--gradient-3);
}

.monitor-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent 58%);
}

.monitor-hero > * {
  position: relative;
  z-index: 1;
}

.monitor-hero-main {
  display: grid;
  gap: 14px;
}

.monitor-hero-main h2 {
  margin: 0;
  font-size: clamp(2.05rem, 4vw, 2.8rem);
  line-height: 1.02;
  max-width: 14ch;
}

.monitor-hero-main p {
  max-width: 62ch;
  font-size: 0.98rem;
}

.monitor-hero-kicker {
  margin-bottom: 0;
}

.monitor-hero-badges {
  margin-top: 2px;
  gap: 10px;
}

.monitor-hero-badges .badge {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.84rem;
}

.monitor-hero-side {
  gap: 14px;
  align-content: start;
}

.monitor-hero-side .mini-stat {
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), transparent), var(--surface-strong);
}

.monitor-hero-side .mini-stat strong {
  font-size: 1.1rem;
  line-height: 1.2;
}

.monitor-hero-side .mini-stat small {
  margin-top: 6px;
  color: var(--text-soft);
}

.health-overview-grid {
  gap: 18px;
}

.health-overview-grid .stat-card {
  min-height: 112px;
  padding: 20px;
  border-radius: 24px;
}

.health-overview-grid .stat-card strong {
  margin-top: 8px;
  font-size: 1.44rem;
}

.health-overview-grid .stat-icon {
  width: 58px;
  height: 58px;
}

.monitor-detail-grid {
  gap: 34px;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 27vw, 380px);
  align-items: start;
}

.monitor-detail-main,
.monitor-detail-side {
  min-width: 0;
  width: 100%;
  gap: 24px;
  align-content: start;
}

.monitor-detail-main > *,
.monitor-detail-side > * {
  min-width: 0;
  width: 100%;
}

.lane-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), transparent 70%), var(--surface);
  box-shadow: var(--shadow-card);
}

.lane-heading-icon {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  flex: 0 0 auto;
}

.lane-heading-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lane-heading h3 {
  margin: 6px 0 6px;
  font-size: 1.12rem;
  line-height: 1.2;
}

.lane-heading p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.93rem;
}

.monitor-detail-page .panel {
  padding: 28px;
  border-radius: 28px;
}

.monitor-detail-page .card-header {
  margin-bottom: 24px;
}

.monitor-detail-page .card-header h2 {
  font-size: 1.42rem;
}

.monitor-detail-page .card-header p {
  margin-top: 6px;
  max-width: 60ch;
}

.chart-panel {
  overflow: hidden;
}

.response-chart-shell {
  padding: 18px 18px 10px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.05), transparent 58%), var(--surface-muted);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.chart-axis-label {
  font-size: 10.5px;
}

.chart-dot {
  stroke: var(--surface-strong);
}

.chart-metrics-grid {
  gap: 14px;
  margin-top: 16px;
}

.chart-metrics-grid .mini-stat {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface-strong);
}

.detail-table-wrap {
  max-width: 100%;
  padding: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.04), transparent 55%), var(--surface-muted);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.detail-history-table {
  min-width: 980px;
}

.detail-history-table thead th {
  background: var(--surface-strong);
}

.detail-history-table th,
.detail-history-table td {
  font-size: 0.79rem;
}

.detail-history-table tbody td {
  padding: 18px 14px;
}

.detail-history-table td:first-child {
  min-width: 142px;
  white-space: nowrap;
}

.detail-history-table td:nth-child(7) {
  min-width: 320px;
}

.history-detail-stack {
  gap: 6px;
  max-width: 460px;
}

.monitor-detail-side .form-stack {
  gap: 16px;
}

.monitor-detail-side .field {
  gap: 9px;
}

.monitor-detail-side .field-input {
  min-height: 56px;
  border-radius: 18px;
  background: var(--surface-strong);
}

.monitor-detail-side .toggle-row {
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent), var(--surface-muted);
}

.monitor-detail-side .btn-block {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  border-radius: 18px;
}

.detail-meta-list {
  gap: 12px;
}

.detail-meta-list > div {
  display: grid;
  gap: 4px;
  padding: 14px 15px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent), var(--surface-muted);
  border: 1px solid var(--border);
}

.detail-meta-list strong {
  color: var(--text);
}

.detail-snapshot-grid {
  gap: 16px;
}

.detail-snapshot-grid .snapshot-card {
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.04), transparent 52%), var(--surface-muted);
}

.snapshot-title {
  font-size: 1rem;
}

.snapshot-meta {
  font-size: 0.88rem;
}

.snapshot-text {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-strong);
}

.monitor-detail-side .empty-state {
  border-radius: 20px;
}

.monitor-detail-main .panel,
.monitor-detail-side .panel,
.lane-heading,
.chart-panel,
.monitor-hero {
  min-width: 0;
}

.detail-history-table {
  width: max-content;
}

@media (max-width: 1640px) {
  .monitor-detail-grid {
    gap: 28px;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 360px);
  }
}

@media (max-width: 1460px) {
  .monitor-detail-page {
    width: min(100%, calc(100% - 28px));
  }

  .monitor-hero,
  .monitor-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .monitor-detail-page {
    gap: 20px;
    width: min(100%, calc(100% - 20px));
    margin: 16px auto 30px;
  }

  .monitor-detail-topbar,
  .monitor-hero,
  .monitor-detail-page .panel {
    padding: 22px;
    border-radius: 24px;
  }

  .lane-heading {
    padding: 16px;
    border-radius: 20px;
  }

  .health-overview-grid,
  .chart-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .monitor-detail-page {
    gap: 16px;
  }

  .monitor-detail-topbar,
  .monitor-hero,
  .monitor-detail-page .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .monitor-hero-main h2 {
    max-width: none;
  }

  .lane-heading {
    gap: 12px;
  }

  .health-overview-grid,
  .chart-metrics-grid {
    grid-template-columns: 1fr;
  }

  .detail-history-table {
    min-width: 820px;
  }
}
