:root {
  --bg: #07111f;
  --bg-soft: #0d1829;
  --panel: rgba(13, 22, 40, 0.78);
  --panel-border: rgba(148, 163, 184, 0.13);
  --text: #e4edf8;
  --muted: #8fa3c0;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: rgba(148, 163, 184, 0.18);
  --secondary-hover: rgba(148, 163, 184, 0.3);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.18);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.18);
  --info: #38bdf8;
  --info-bg: rgba(56, 189, 248, 0.18);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.18);
  --focus: 0 0 0 3px rgba(59, 130, 246, 0.28);
  --radius: 12px;
  --sidebar-w: 240px;
  --header-h: 56px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.32), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

* {
  box-sizing: border-box;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html::-webkit-scrollbar {
  width: 6px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 1400px 700px at 8% -5%, rgba(59, 130, 246, 0.14), transparent 65%),
    radial-gradient(ellipse 1200px 800px at 92% -15%, rgba(16, 185, 129, 0.08), transparent 60%),
    radial-gradient(ellipse 800px 600px at 50% 100%, rgba(99, 102, 241, 0.06), transparent 70%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 55%);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #93c5fd;
  text-decoration: none;
  transition: color 0.12s ease;
}

a:hover {
  color: #bfdbfe;
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
  line-height: 1.2;
  font-weight: 700;
}

p {
  margin-top: 0;
}

code {
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  color: #93c5fd;
  font-size: 0.83rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  word-break: break-all;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.muted {
  color: var(--muted);
}

/* ─── Page enter animation ─── */

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Header ─── */

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(7, 17, 31, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  width: 100%;
  padding: 0 1.1rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f0f6ff;
  font-size: 1.05rem;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.42rem;
  line-height: 1;
}

.brand svg {
  color: var(--primary);
  flex-shrink: 0;
}

.brand:hover {
  color: #f0f6ff;
}

.sidebar-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-toggle:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.4);
}

.toggle-bar {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 4px;
  background: #d8e6ff;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  padding: 0.22rem 0.65rem 0.22rem 0.28rem;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.header-user {
  color: #c8d8f0;
  font-size: 0.82rem;
  font-weight: 500;
}

/* ─── App body shell ─── */

.app-body {
  padding-top: var(--header-h);
  min-height: 100vh;
  display: flex;
}

/* ─── Sidebar ─── */

.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 900;
  background: rgba(5, 9, 18, 0.98);
  border-right: 1px solid rgba(148, 163, 184, 0.09);
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.18) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
}

/* Sidebar brand header */

.sidebar-brand-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 1rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  margin-bottom: 0.35rem;
}

.sidebar-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.85), rgba(99, 102, 241, 0.85));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.sidebar-brand-logo svg {
  color: #fff;
}

.sidebar-brand-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #e8f0ff;
  letter-spacing: 0.01em;
}

.sidebar-brand-sub {
  font-size: 0.67rem;
  color: rgba(148, 163, 184, 0.55);
  letter-spacing: 0.02em;
  margin-top: 1px;
}

/* Sidebar nav */

.sidebar-nav {
  padding: 0.25rem 0.6rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.52rem 0.72rem;
  border-radius: 8px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  color: #a8c0dc;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-link svg {
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.12s ease;
}

.sidebar-link:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #dbeafe;
  border-left-color: rgba(59, 130, 246, 0.4);
}

.sidebar-link:hover svg {
  opacity: 0.9;
}

.sidebar-link.is-active {
  background: rgba(59, 130, 246, 0.16);
  color: #dbeafe;
  border-left-color: #3b82f6;
  border-right-color: transparent;
  border-top-color: rgba(59, 130, 246, 0.2);
  border-bottom-color: rgba(59, 130, 246, 0.2);
  font-weight: 600;
}

.sidebar-link.is-active svg {
  opacity: 1;
  color: #60a5fa;
}

.sidebar-section-label {
  padding: 0.9rem 0.72rem 0.24rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.38);
}

/* ─── Sidebar overlay (mobile) ─── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 850;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ─── Desktop sidebar collapse ─── */

.has-js.sidebar-collapsed .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-w)));
}

.has-js.sidebar-collapsed .app-main {
  margin-left: 0;
}

/* ─── Main content ─── */

.app-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 1.35rem 1.85rem 2.5rem;
  animation: page-in 0.22s ease both;
}

.container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
}

/* ─── Cards & panels ─── */

.glass,
.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.card-body {
  padding: 1.1rem;
}

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

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f0f6ff 30%, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.2rem;
}

.page-header .muted {
  font-size: 0.88rem;
}

.inline-form,
.actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panel {
  padding: 1.1rem;
  margin-bottom: 0.95rem;
}

.panel-inner {
  margin-top: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(10, 16, 30, 0.55);
  border-radius: 10px;
  padding: 0.9rem;
}

/* ─── Grid ─── */

.grid {
  display: grid;
  gap: 1rem;
}

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

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

/* ─── Forms ─── */

.form-group {
  margin-bottom: 1.05rem;
}

.form-label {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: rgba(10, 16, 30, 0.7);
  color: var(--text);
  font-size: 0.93rem;
  padding: 0.62rem 0.82rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-control::placeholder {
  color: rgba(148, 163, 184, 0.4);
}

.form-control:focus {
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
  outline: none;
}

textarea.form-control {
  resize: vertical;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238fa3c0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.2rem;
}

/* ─── Buttons ─── */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.62rem 1rem;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 1px 6px rgba(59, 130, 246, 0.3);
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
  letter-spacing: 0.005em;
}

.btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.42);
  color: #fff;
}

.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: transparent;
  color: #fff;
}

.btn-secondary {
  background: var(--secondary);
  border-color: rgba(148, 163, 184, 0.28);
  color: #d6e6f8;
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
  border-color: rgba(148, 163, 184, 0.42);
  color: #e8f2ff;
  box-shadow: none;
}

.btn-danger {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  box-shadow: none;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.58);
  box-shadow: none;
}

.btn-warning {
  background: var(--warning-bg);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  box-shadow: none;
}

.btn-warning:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: none;
}

.btn-sm {
  padding: 0.4rem 0.68rem;
  font-size: 0.79rem;
  border-radius: 8px;
}

/* ─── Alerts ─── */

.alert {
  border-radius: 10px;
  border: 1px solid transparent;
  border-left-width: 3px;
  padding: 0.72rem 0.9rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.alert.success {
  background: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.35);
  border-left-color: var(--success);
  color: #a7f3d0;
}

.alert.danger,
.alert.error {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.38);
  border-left-color: var(--danger);
  color: #fca5a5;
}

.alert.info {
  background: var(--info-bg);
  border-color: rgba(56, 189, 248, 0.38);
  border-left-color: var(--info);
  color: #bae6fd;
}

.alert.warning {
  background: var(--warning-bg);
  border-color: rgba(245, 158, 11, 0.38);
  border-left-color: var(--warning);
  color: #fde68a;
}

/* ─── Tables ─── */

.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
}

.table-wrap::-webkit-scrollbar {
  height: 6px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.68rem 0.72rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
  vertical-align: middle;
  font-size: 0.88rem;
}

.table th {
  color: #8fa3c0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  background: rgba(7, 11, 22, 0.4);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table tbody tr {
  transition: background-color 0.1s ease;
}

.table tbody tr:hover {
  background: rgba(59, 130, 246, 0.055);
}

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

/* ─── Badges ─── */

.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-badge::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.75);
  }
}

.status-active,
.status-done {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-inactive {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.status-running {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.status-running::before {
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.status-pending,
.status-queued {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-inserted {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-skipped {
  background: rgba(100, 116, 139, 0.18);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.status-failed,
.status-cancelled {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ─── Progress ─── */

@keyframes progress-shine {
  0% {
    background-position: 200% center;
  }

  100% {
    background-position: -200% center;
  }
}

.progress {
  width: 180px;
  max-width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
  margin-top: 0.35rem;
}

.progress>span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981, #3b82f6);
  background-size: 200% 100%;
  animation: progress-shine 2.5s linear infinite;
  border-radius: inherit;
}

.progress-meta {
  font-size: 0.78rem;
  color: #8fa3c0;
}

.error-cell {
  max-width: 320px;
  word-break: break-word;
  color: #f87171;
  font-size: 0.82rem;
}

.actions-cell {
  white-space: nowrap;
}

/* ─── Checkboxes & radios ─── */

.checkbox-inline,
.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  margin-right: 0.6rem;
  color: #c8d8ef;
  font-size: 0.88rem;
  cursor: pointer;
}

/* ─── Pagination ─── */

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 1rem;
}

.page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 9px;
  padding: 0 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(13, 22, 40, 0.6);
  color: #c8d8ef;
  font-size: 0.86rem;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.page:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #dbeafe;
}

.page.current {
  background: rgba(59, 130, 246, 0.26);
  border-color: rgba(59, 130, 246, 0.5);
  color: #dbeafe;
  font-weight: 600;
}

/* ─── Stat cards ─── */

.stat-card {
  padding: 1.1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--success));
  opacity: 0.6;
}

.stat-value {
  font-size: 1.95rem;
  font-weight: 800;
  margin-top: 0.35rem;
  background: linear-gradient(135deg, #f0f6ff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ─── Analytics ─── */

.analytics-filter-panel .inline-form {
  align-items: flex-end;
}

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

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.95rem;
}

.chart-card {
  min-height: 290px;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.chart-head h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #c8d8ef;
}

.line-chart {
  width: 100%;
  height: 210px;
  display: block;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  background: rgba(7, 11, 22, 0.5);
}

.line-chart polyline {
  fill: none;
  stroke: #60a5fa;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── Bar charts ─── */

.bars-list {
  display: grid;
  gap: 0.5rem;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(120px, 3fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.bar-label {
  font-size: 0.78rem;
  color: #c8d8ef;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-value {
  font-size: 0.78rem;
  color: #8fa3c0;
  font-weight: 600;
}

.bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}

.bar-track>span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.5s ease;
}

.status-label {
  text-transform: uppercase;
}

.bar-track.status-pending>span {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.bar-track.status-running>span {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.bar-track.status-done>span {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.bar-track.status-failed>span {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.bar-track.status-skipped>span {
  background: linear-gradient(90deg, #475569, #64748b);
}

/* ─── Campaign builder ─── */

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

.campaign-panel {
  min-height: 420px;
}

.campaign-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.campaign-table td code {
  display: inline-block;
  max-width: 100%;
}

.campaign-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.campaign-action-grid .panel-inner h4 {
  margin: 0 0 0.7rem;
  font-size: 0.9rem;
}

.campaign-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.campaign-actions .btn {
  flex: 1 1 260px;
  text-align: center;
}

/* ─── Auth ─── */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  width: min(420px, 100%);
  padding: 1.5rem;
}

/* ─── Responsive: tablet (sidebar becomes overlay) ─── */

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }

  .app-main {
    margin-left: 0;
    padding: 1rem 1rem 2rem;
  }

  .has-js.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .has-js.sidebar-open .sidebar-overlay {
    display: block;
  }

  /* Reset desktop collapse on mobile */
  .has-js.sidebar-collapsed .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }

  .has-js.sidebar-collapsed .app-main {
    margin-left: 0;
  }

  .analytics-cards {
    grid-template-columns: 1fr 1fr;
  }

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

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

  .campaign-action-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Responsive: mobile ─── */

@media (max-width: 768px) {
  .app-main {
    padding: 0.85rem 0.85rem 2rem;
  }

  .page-header h1 {
    font-size: 1.25rem;
  }

  .grid-2,
  .grid-cols-3 {
    grid-template-columns: 1fr;
  }

  .page-header {
    margin-bottom: 0.8rem;
  }

  .panel {
    padding: 0.85rem;
  }

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

  .inline-form .btn,
  .actions-row .btn {
    width: 100%;
    text-align: center;
  }

  .table th,
  .table td {
    font-size: 0.84rem;
  }

  /* Domain table → card layout on mobile */
  .route-domains .table-wrap {
    overflow: visible;
  }

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

  .route-domains .table thead {
    display: none;
  }

  .route-domains .table tbody {
    display: grid;
    gap: 0.7rem;
  }

  .route-domains .table tr {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 10px;
    background: rgba(10, 16, 30, 0.6);
    padding: 0.7rem;
  }

  .route-domains .table td {
    border-bottom: 0;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.45rem;
    padding: 0.26rem 0;
    align-items: start;
  }

  .route-domains .table td::before {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .route-domains .table td:nth-child(1)::before {
    content: 'Select';
  }

  .route-domains .table td:nth-child(2)::before {
    content: 'Domain';
  }

  .route-domains .table td:nth-child(3)::before {
    content: 'Path';
  }

  .route-domains .table td:nth-child(4)::before {
    content: 'Group';
  }

  .route-domains .table td:nth-child(5)::before {
    content: 'Status';
  }

  .route-domains .table td:nth-child(6)::before {
    content: 'Links';
  }

  .route-domains .table td:nth-child(7)::before {
    content: 'Actions';
  }

  .analytics-cards {
    grid-template-columns: 1fr 1fr;
  }

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

  .bar-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .bar-track {
    height: 10px;
  }

  .campaign-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .campaign-actions .btn {
    width: 100%;
    flex: 1 1 auto;
  }

  .header-user {
    display: none;
  }

  .user-pill {
    padding: 0.22rem 0.28rem;
  }
}