/* ═══════════════════════════════════════════════════════════════════════════
   VF2PVE Dashboard — Professional Enterprise Theme
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Surfaces ── */
  --bg-app: #0b0d17;
  --bg-surface: #111420;
  --bg-surface-2: #161928;
  --bg-elevated: #1c1f31;
  --bg-input: #0e1019;
  --bg-sidebar: #0d0f1a;

  /* ── Borders ── */
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(124, 108, 240, 0.5);

  /* ── Text ── */
  --text-1: #f0f1f7;
  --text-2: #a0a4b8;
  --text-3: #6b6f85;
  --text-4: #44475a;

  /* ── Accents ── */
  --accent: #7c6cf0;
  --accent-hover: #6b5ce0;
  --accent-subtle: rgba(124, 108, 240, 0.1);
  --accent-glow: rgba(124, 108, 240, 0.25);

  --blue: #4a9eff;
  --blue-subtle: rgba(74, 158, 255, 0.1);
  --green: #2ecf94;
  --green-subtle: rgba(46, 207, 148, 0.1);
  --amber: #f5b342;
  --amber-subtle: rgba(245, 179, 66, 0.1);
  --red: #ff5c5c;
  --red-subtle: rgba(255, 92, 92, 0.1);

  /* ── Geometry ── */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px var(--accent-glow);

  /* ── Motion ── */
  --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ── Layout ── */
  --sidebar-w: 250px;
  --topbar-h: 60px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-app);
  color: var(--text-1);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--accent-subtle); }

.hidden { display: none !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ════ AUTH GATE ══════════════════════════════════════════════════════════ */

.auth-gate {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-app);
  z-index: 9999;
}
.auth-gate::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 50% 20%, var(--accent-subtle), transparent),
    radial-gradient(ellipse 400px 300px at 70% 80%, var(--green-subtle), transparent);
}

.auth-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 400px; max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.35s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-brand {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 2rem;
}
.brand-mark { flex-shrink: 0; }
.brand-name h1 {
  font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text-1);
}
.brand-tag {
  font-size: 0.75rem; color: var(--text-3); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-hint {
  margin-top: 1.5rem; text-align: center;
  font-size: 0.8rem; color: var(--text-3);
}
.auth-hint code {
  background: var(--bg-input); padding: 2px 8px;
  border-radius: var(--radius-xs); border: 1px solid var(--border);
  font-size: 0.78rem; color: var(--accent);
}

/* ════ APP LAYOUT ═════════════════════════════════════════════════════════ */

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

/* ════ SIDEBAR ═══════════════════════════════════════════════════════════ */

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 200;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}
.sidebar-brand-text {
  font-size: 1.15rem; font-weight: 800;
  letter-spacing: -0.02em; color: var(--text-1);
}

.nav {
  flex: 1; padding: 0.75rem;
  overflow-y: auto;
}

.nav-section { margin-bottom: 0.5rem; }

.nav-section-label {
  display: block;
  padding: 0.75rem 0.75rem 0.35rem;
  font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-4);
}

.nav-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: none; background: transparent;
  color: var(--text-2);
  font-family: inherit; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all var(--t);
  text-align: left; width: 100%;
  position: relative;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
}
.nav-item.active {
  background: var(--accent-subtle);
  color: var(--text-1);
}
.nav-item.active::before {
  content: ''; position: absolute;
  left: -0.75rem; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}
.sidebar-footer-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-footer-row .conn-indicator { flex: 1; }
.logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-3);
  cursor: pointer; transition: all var(--t);
  flex-shrink: 0;
}
.logout-btn:hover { color: var(--red); border-color: rgba(255,92,92,0.2); background: var(--red-subtle); }
.sidebar-user {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.5rem 0.75rem;
}
.avatar {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #5b4edb);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff;
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.82rem; font-weight: 600; color: var(--text-1); }
.user-role { font-size: 0.72rem; color: var(--text-3); }

.conn-indicator {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem; color: var(--text-3);
}
.dot { width: 6px; height: 6px; border-radius: 50%; }
.dot-ok { background: var(--green); box-shadow: 0 0 6px rgba(46,207,148,0.5); }
.dot-err { background: var(--red); box-shadow: 0 0 6px rgba(255,92,92,0.4); }

.conn-indicator span:last-child { transition: color var(--t); }

/* ════ CONTENT ═══════════════════════════════════════════════════════════ */

.content {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* ── Top Bar ── */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center;
  gap: 1rem; padding: 0 1.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 23, 0.8);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
}

.topbar-title {
  font-size: 1rem; font-weight: 600; color: var(--text-1);
}

.topbar-actions { margin-left: auto; display: flex; gap: 0.5rem; }

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-2);
  cursor: pointer; transition: all var(--t);
}
.icon-btn:hover { color: var(--text-1); border-color: var(--border-strong); background: var(--bg-elevated); }

.mobile-menu-btn {
  display: none;
  background: none; border: none; color: var(--text-2);
  cursor: pointer; padding: 0.25rem;
}

/* ── Views ── */
.view {
  display: none; flex: 1;
  padding: 1.75rem;
  animation: fadeIn 0.25s ease;
}
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Page Header ── */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.page-header h1 {
  font-size: 1.4rem; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text-1);
}
.page-header p {
  font-size: 0.85rem; color: var(--text-2); margin-top: 0.2rem;
}
.page-header-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ════ STAT CARDS ════════════════════════════════════════════════════════ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  cursor: pointer;
  transition: all var(--t);
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon-purple { background: var(--accent-subtle); color: var(--accent); }
.stat-icon-blue { background: var(--blue-subtle); color: var(--blue); }
.stat-icon-green { background: var(--green-subtle); color: var(--green); }
.stat-icon-amber { background: var(--amber-subtle); color: var(--amber); }

.stat-data { display: flex; flex-direction: column; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.stat-label { font-size: 0.78rem; color: var(--text-3); margin-top: 0.1rem; }

/* ════ DASHBOARD GRID ════════════════════════════════════════════════════ */

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Infrastructure Status Rows ── */

.infra-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
}
.infra-row:last-child { border-bottom: none; }
.infra-row:hover { background: rgba(255,255,255,0.02); }

.infra-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform var(--t);
}
.infra-row:hover .infra-icon { transform: scale(1.05); }
.infra-icon-vf { background: var(--accent-subtle); color: var(--accent); }
.infra-icon-pve { background: var(--green-subtle); color: var(--green); }

.infra-info { flex: 1; min-width: 0; }
.infra-name {
  font-size: 0.875rem; font-weight: 600; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.infra-sub {
  font-size: 0.72rem; color: var(--text-3); margin-top: 0.15rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.infra-sub code {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.7rem;
}

.infra-badge {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem;
  flex-shrink: 0;
}

.infra-status {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.68rem; font-weight: 500;
}
.infra-status-ok { color: var(--green); }
.infra-status-err { color: var(--red); }

/* ── Activity Feed Rows ── */

.act-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast), padding var(--t-fast);
  border-radius: var(--radius-xs);
  padding-left: 0.5rem; padding-right: 0.5rem;
}
.act-row:last-child { border-bottom: none; }
.act-row:hover {
  background: var(--accent-subtle);
  padding-left: 0.75rem;
}

.act-badge-wrap { flex-shrink: 0; width: 90px; }

.act-info { flex: 1; min-width: 0; }
.act-title {
  font-size: 0.825rem; font-weight: 600; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.act-sub {
  font-size: 0.7rem; color: var(--text-3); margin-top: 0.1rem;
}

.act-time {
  font-size: 0.7rem; color: var(--text-4);
  white-space: nowrap; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ════ CARDS ═════════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 1rem; font-weight: 600; color: var(--text-1); }
.card-header p { font-size: 0.8rem; color: var(--text-3); margin-top: 0.2rem; }

.card-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.card-badge-purple { background: var(--accent-subtle); color: var(--accent); }
.card-badge-green { background: var(--green-subtle); color: var(--green); }
.card-badge-blue { background: var(--blue-subtle); color: var(--blue); }

.card-body { padding: 1.25rem; }

.card-footer {
  display: flex; gap: 0.6rem; justify-content: flex-end;
  padding: 0 1.25rem 1.25rem;
}

/* ════ FORMS ═════════════════════════════════════════════════════════════ */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-field { display: flex; flex-direction: column; gap: 0.35rem; }
.form-field.full { grid-column: 1 / -1; }

.form-field label, .auth-card label {
  font-size: 0.78rem; font-weight: 500; color: var(--text-2);
}
.field-hint { font-size: 0.72rem; color: var(--text-4); }

.input, input[type="text"], input[type="password"], select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  color: var(--text-1);
  font-family: inherit; font-size: 0.875rem;
  transition: border-color var(--t), box-shadow var(--t);
  outline: none; width: 100%;
}
.input:focus, input:focus, select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.input::placeholder, input::placeholder { color: var(--text-4); }
select { cursor: pointer; }

.input-sm { padding: 0.45rem 0.7rem; font-size: 0.82rem; }

/* ════ BUTTONS ═══════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all var(--t);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 2px 12px var(--accent-glow); }

.btn-success {
  background: var(--green); color: #06281c;
  border-color: var(--green);
}
.btn-success:hover { filter: brightness(1.1); box-shadow: 0 2px 12px rgba(46,207,148,0.3); }

.btn-ghost {
  background: var(--bg-surface-2); color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text-1); border-color: var(--border-strong); background: var(--bg-elevated); }

.btn-danger {
  background: var(--red-subtle); color: var(--red);
  border-color: rgba(255,92,92,0.2);
}
.btn-danger:hover { background: rgba(255,92,92,0.18); }

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ════ TABLE ═════════════════════════════════════════════════════════════ */

.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

th {
  text-align: left; padding: 0.65rem 1rem;
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3);
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  font-size: 0.85rem; color: var(--text-1);
  border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover { background: rgba(255,255,255,0.02); }

td .mono { font-size: 0.8rem; color: var(--text-2); }

/* ════ BADGES ════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  font-size: 0.72rem; font-weight: 600;
  white-space: nowrap;
}
.badge-vf { background: var(--accent-subtle); color: var(--accent); }
.badge-pve { background: var(--green-subtle); color: var(--green); }
.badge-ready { background: var(--green-subtle); color: var(--green); }
.badge-warn { background: var(--amber-subtle); color: var(--amber); }
.badge-err { background: var(--red-subtle); color: var(--red); }
.badge-info { background: var(--blue-subtle); color: var(--blue); }
.badge-muted { background: rgba(255,255,255,0.05); color: var(--text-3); }
.badge-purple { background: rgba(160, 80, 240, 0.15); color: #c084fc; }
.badge-stopped { background: var(--red-subtle); color: var(--red); }

/* ── Batch Action Bar ── */
.batch-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 24px var(--accent-glow);
  animation: slideUp 0.3s ease;
}
.batch-count { color: var(--text-1); font-size: 0.875rem; font-weight: 500; }

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(1rem); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Checkbox Column ── */
.check-col { width: 40px; text-align: center; }
.check-col input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.table-card table th.check-col,
.table-card table td.check-col { padding: 0.5rem 0.25rem; }

/* ── Migrate Button ── */
.btn-migrate {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-migrate:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.125rem; font-weight: 600; color: var(--text-1); margin: 0; }
.modal-close {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  padding: 4px; border-radius: var(--radius-xs); display: flex;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text-1); }
.modal-body { padding: 1.25rem 1.5rem; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ── Progress bar (in migration history) ── */
.progress-bar-bg {
  width: 100%; height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  border-radius: 3px;
  transition: width 0.5s ease;
}
.progress-pct { font-size: 0.75rem; color: var(--text-3); margin-left: 0.5rem; white-space: nowrap; }

/* ── IP Address display ── */
.ip-addr {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.8125rem;
  color: var(--text-2);
  background: rgba(255,255,255,0.03);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}
.ip-addr.ipv6 { font-size: 0.75rem; }

/* ════ WIZARD ════════════════════════════════════════════════════════════ */

.wizard-steps {
  display: flex; align-items: center;
  margin-bottom: 1.5rem; gap: 0;
}

.wstep {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text-3);
  font-size: 0.8rem; font-weight: 500;
}

.wstep-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  transition: all var(--t);
  flex-shrink: 0;
}

.wstep.active .wstep-num {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.wstep.active { color: var(--text-1); }

.wstep.done .wstep-num {
  background: var(--green); border-color: var(--green); color: #06281c;
}
.wstep.done { color: var(--green); }

.wstep-connector {
  flex: 1; height: 2px;
  background: var(--border);
  margin: 0 0.75rem;
  border-radius: 1px;
}

.wizard-panel { display: none; }
.wizard-panel.active { display: block; animation: fadeIn 0.25s ease; }

/* ════ REVIEW ════════════════════════════════════════════════════════════ */

.review-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}

.review-section {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.review-header {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.review-header h3 { font-size: 0.9rem; font-weight: 600; color: var(--text-1); }

.review-list { display: flex; flex-direction: column; }

.review-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.review-row:last-child { border-bottom: none; }
.review-row .key { color: var(--text-3); }
.review-row .val { color: var(--text-1); font-weight: 500; max-width: 60%; text-align: right; overflow: hidden; text-overflow: ellipsis; }

/* ════ JOB CARDS ═════════════════════════════════════════════════════════ */

.job-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color var(--t);
}
.job-card:hover { border-color: var(--border-strong); }

.job-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.6rem; flex-wrap: wrap; gap: 0.5rem;
}

.job-title { display: flex; align-items: center; gap: 0.6rem; }
.job-title h3 { font-size: 0.95rem; font-weight: 600; }

.job-meta {
  display: flex; gap: 1rem; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--text-3);
}
.job-meta span { display: flex; align-items: center; gap: 0.25rem; }

.job-progress { display: flex; gap: 3px; margin: 0.6rem 0; }
.job-step {
  flex: 1; height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
}
.job-step.done { background: var(--green); }
.job-step.running { background: var(--accent); animation: shimmer 1.2s ease infinite; }
.job-step.failed { background: var(--red); }

@keyframes shimmer { 0%,100%{opacity:1} 50%{opacity:0.35} }

.job-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* ════ ACTIVITY FEED ═════════════════════════════════════════════════════ */

.activity-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

.activity-text { flex: 1; font-size: 0.82rem; color: var(--text-2); }
.activity-text strong { color: var(--text-1); font-weight: 600; }
.activity-time { font-size: 0.72rem; color: var(--text-4); white-space: nowrap; }

/* ════ EMPTY STATES ══════════════════════════════════════════════════════ */

.empty-state {
  text-align: center; padding: 2.5rem 1rem;
  color: var(--text-3); font-size: 0.85rem;
}
.empty-state-sm {
  text-align: center; padding: 1.5rem 1rem;
  color: var(--text-4); font-size: 0.82rem;
}

/* ════ SKELETON ══════════════════════════════════════════════════════════ */

.skeleton-row {
  height: 44px; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-surface-2) 25%, var(--bg-elevated) 50%, var(--bg-surface-2) 75%);
  background-size: 200% 100%;
  animation: skel 1.5s ease infinite;
  margin-bottom: 0.5rem;
}
@keyframes skel { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ════ TOAST ═════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 5000;
  display: flex; flex-direction: column-reverse; gap: 0.5rem;
}

.toast {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.1rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
  max-width: 380px;
}
@keyframes toastIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }

.toast::before { content: ''; width: 4px; height: 24px; border-radius: 2px; flex-shrink: 0; }
.toast.success::before { background: var(--green); }
.toast.error::before { background: var(--red); }
.toast.info::before { background: var(--blue); }

/* (modal styles already defined above) */

/* ════ MISC ══════════════════════════════════════════════════════════════ */

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════ JOB LOG VIEWER ═══════════════════════════════════════════════════ */

.log-viewer {
  max-height: 70vh;
  overflow-y: auto;
}

/* Step timeline */
.log-steps {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-input);
}

.log-step {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.8rem; color: var(--text-2);
}

.log-step-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0;
}

.log-step-done { color: var(--green); }
.log-step-done .log-step-icon { color: var(--green); }
.log-step-run { color: var(--accent); }
.log-step-run .log-step-icon { color: var(--accent); animation: shimmer 1.2s ease infinite; }
.log-step-fail { color: var(--red); }
.log-step-fail .log-step-icon { color: var(--red); }

.log-step-summary {
  color: var(--text-4); font-size: 0.75rem; margin-left: 0.25rem;
}

/* Log entries */
.log-entries {
  padding: 0.5rem 0;
}

.log-line {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.2rem 1.25rem;
  font-size: 0.78rem; line-height: 1.6;
  color: var(--text-2);
}
.log-line:hover { background: rgba(255,255,255,0.02); }

.log-time {
  color: var(--text-4); flex-shrink: 0;
  min-width: 65px;
}

.log-level {
  flex-shrink: 0; font-weight: 600;
  min-width: 56px; text-align: center;
  padding: 0 0.3rem; border-radius: var(--radius-xs);
  font-size: 0.7rem;
}
.log-lvl-info { color: var(--blue); background: var(--blue-subtle); }
.log-lvl-warn { color: var(--amber); background: var(--amber-subtle); }
.log-lvl-error { color: var(--red); background: var(--red-subtle); }
.log-lvl-debug { color: var(--text-4); background: rgba(255,255,255,0.04); }

.log-msg { flex: 1; word-break: break-word; color: var(--text-1); }

.log-empty {
  padding: 2rem; text-align: center;
  color: var(--text-4); font-size: 0.85rem;
}


/* ════ RESPONSIVE ════════════════════════════════════════════════════════ */

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--t);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: flex; }
  .content { margin-left: 0; }
  .view { padding: 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header-actions { width: 100%; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .wizard-steps .wstep-label { display: none; }
  .wstep-connector { margin: 0 0.4rem; }
}
