/* ═══════════════════════════════════════════════════
   MarkSix — Cyber Dark Theme
   科技感暗色设计系统
   ═══════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --bg-primary: #0b0f1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(23, 32, 52, 0.85);
  --bg-input: rgba(15, 23, 42, 0.8);
  --bg-sidebar: #0d1220;

  --border-primary: rgba(56, 189, 248, 0.12);
  --border-hover: rgba(56, 189, 248, 0.3);
  --border-active: rgba(56, 189, 248, 0.5);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-heading: #f1f5f9;

  --accent-cyan: #22d3ee;
  --accent-blue: #3b82f6;
  --accent-purple: #a78bfa;
  --accent-green: #34d399;
  --accent-amber: #fbbf24;
  --accent-red: #f87171;
  --accent-pink: #f472b6;

  --glow-cyan: 0 0 20px rgba(34, 211, 238, 0.15);
  --glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);
  --glow-sm: 0 0 10px rgba(34, 211, 238, 0.1);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;

  --sidebar-w: 260px;
  --topbar-h: 0px;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Subtle grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(34, 211, 238, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent-cyan); text-decoration: none; transition: color var(--transition); }
a:hover { color: #67e8f9; }

::selection { background: rgba(34, 211, 238, 0.25); color: #fff; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.5); }

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

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

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border-primary);
}

.sidebar-logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #0b0f1a;
  font-weight: 800;
}

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.nav-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(34, 211, 238, 0.06);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
  box-shadow: inset 3px 0 0 var(--accent-cyan);
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ws-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ws-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-red);
  transition: background var(--transition);
}
.ws-dot.connected {
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
}

.btn-logout {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border-primary);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-logout:hover { color: var(--accent-red); border-color: rgba(248, 113, 113, 0.3); }

/* Main content area */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  position: relative;
  z-index: 1;
}

/* ── Page Header ── */
.page-header { margin-bottom: 28px; }

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--glow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

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

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover::before { opacity: 1; }
.stat-card:hover { border-color: var(--border-hover); box-shadow: var(--glow-sm); }

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-heading);
  line-height: 1.2;
}

.stat-value .stat-sub {
  font-size: 0.9rem;
  color: var(--accent-green);
  font-weight: 500;
}

.stat-value.cyan { color: var(--accent-cyan); }
.stat-value.blue { color: var(--accent-blue); }
.stat-value.purple { color: var(--accent-purple); }
.stat-value.amber { color: var(--accent-amber); }

.stat-icon {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 211, 238, 0.08);
  color: var(--accent-cyan);
}
.stat-icon svg { width: 18px; height: 18px; }

/* ── Grid Layouts ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

/* ── Tables ── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

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

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

thead th {
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid var(--border-primary);
  white-space: nowrap;
  text-align: left;
}

tbody td {
  padding: 10px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.05);
  color: var(--text-secondary);
  vertical-align: middle;
}

tbody tr { transition: background var(--transition); }
tbody tr:hover { background: rgba(34, 211, 238, 0.03); }
tbody tr:last-child td { border-bottom: none; }

td.mono, .font-mono { font-family: var(--font-mono); font-size: 0.88rem; }
td.actions { white-space: nowrap; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #0b0f1a;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { box-shadow: var(--glow-cyan); filter: brightness(1.1); }

.btn-secondary {
  background: rgba(56, 189, 248, 0.08);
  color: var(--accent-cyan);
  border: 1px solid var(--border-primary);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--border-hover); background: rgba(56, 189, 248, 0.12); }

.btn-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.18); border-color: rgba(248, 113, 113, 0.4); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}
.btn-ghost:hover:not(:disabled) { color: var(--text-primary); border-color: var(--border-hover); }

.btn-sm { padding: 5px 10px; font-size: 0.85rem; }
.btn-xs { padding: 3px 8px; font-size: 0.8rem; }

/* ── Form Inputs ── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.form-select option { background: var(--bg-secondary); color: var(--text-primary); }

.form-textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Checkbox ── */
input[type="checkbox"] {
  appearance: none;
  width: 16px; height: 16px;
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
input[type="checkbox"]:checked {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 5px;
  width: 4px; height: 8px;
  border: solid #0b0f1a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-online, .badge-completed, .badge-success { background: rgba(52, 211, 153, 0.12); color: var(--accent-green); }
.badge-offline { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }
.badge-skip { background: rgba(251, 191, 36, 0.12); color: var(--accent-amber); }
.badge-logging_in, .badge-assigned, .badge-unassigned, .badge-pending, .badge-running { background: rgba(251, 191, 36, 0.12); color: var(--accent-amber); }
.badge-error, .badge-failed, .badge-orphaned, .badge-fail { background: rgba(248, 113, 113, 0.12); color: var(--accent-red); }
.badge-partial_fail, .badge-degraded { background: rgba(251, 191, 36, 0.12); color: var(--accent-amber); }
.badge-released, .badge-claimed { background: rgba(167, 139, 250, 0.12); color: var(--accent-purple); }
.badge-unsupported { background: rgba(148, 163, 184, 0.12); color: var(--text-secondary); }
.badge-info { background: rgba(59, 130, 246, 0.12); color: var(--accent-blue); }
.badge-cancelled { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease-out;
}
.modal-overlay.hidden { display: none; }

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.2s ease-out;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-primary);
  margin-top: 20px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.96) translateY(-8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(12px);
  animation: toastIn 0.25s ease-out, toastOut 0.25s ease-in 2.75s forwards;
  max-width: 380px;
  border: 1px solid;
}

.toast-success { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.2); color: var(--accent-green); }
.toast-error { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.2); color: var(--accent-red); }
.toast-warning { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.2); color: var(--accent-amber); }
.toast-info { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }

@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(30px); } }

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(34, 211, 238, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }

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

/* ── Pagination ── */
.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.pagination button:hover:not(:disabled) { border-color: var(--border-hover); color: var(--text-primary); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }
.pagination button.active {
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(34, 211, 238, 0.3);
}

.page-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
}

.filter-bar .form-input,
.filter-bar .form-select {
  width: auto;
  min-width: 140px;
  padding: 7px 10px;
  font-size: 0.88rem;
}

.filter-bar .spacer { flex: 1; }

/* ── Progress Bar ── */
.progress-wrap {
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.progress-label { font-size: 0.9rem; font-weight: 500; color: var(--accent-cyan); }
.progress-count { font-size: 0.85rem; color: var(--text-muted); font-family: var(--font-mono); }

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(100, 116, 139, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.progress-stats .success { color: var(--accent-green); }
.progress-stats .fail { color: var(--accent-red); }
.progress-stats .skip { color: var(--text-muted); }

/* ── Worker Cards ── */
.worker-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
  position: relative;
}
.worker-card:hover { border-color: var(--border-hover); box-shadow: var(--glow-sm); }

.worker-card.online { border-left: 3px solid var(--accent-green); }
.worker-card.degraded { border-left: 3px solid var(--accent-amber); }
.worker-card.offline { border-left: 3px solid var(--text-muted); }

.worker-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.worker-id { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; color: var(--text-heading); }

.worker-load-bar {
  width: 100%;
  height: 4px;
  background: rgba(100, 116, 139, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0;
}
.worker-load-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.worker-load-fill.low { background: var(--accent-green); }
.worker-load-fill.mid { background: var(--accent-amber); }
.worker-load-fill.high { background: var(--accent-red); }

.worker-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.worker-meta span { display: flex; justify-content: space-between; }

/* ── Info Grid ── */
.info-grid {
  display: grid;
  gap: 8px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(56, 189, 248, 0.05);
  font-size: 0.9rem;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); }
.info-value { color: var(--text-primary); font-family: var(--font-mono); font-size: 0.88rem; }
.info-value.ok { color: var(--accent-green); }
.info-value.err { color: var(--accent-red); }

/* ── Activity Feed ── */
.activity-feed { max-height: 320px; overflow-y: auto; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(56, 189, 248, 0.04);
  font-size: 0.88rem;
}
.activity-item:last-child { border-bottom: none; }

.activity-time { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.8rem; white-space: nowrap; padding-top: 2px; }
.activity-level { font-weight: 600; font-size: 0.82rem; text-transform: uppercase; }
.activity-level.info { color: var(--accent-blue); }
.activity-level.warn { color: var(--accent-amber); }
.activity-level.error { color: var(--accent-red); }
.activity-msg { color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Log level row colors ── */
.log-row-info { }
.log-row-warn { background: rgba(251, 191, 36, 0.03); }
.log-row-error { background: rgba(248, 113, 113, 0.04); }
.log-row-fatal { background: rgba(248, 113, 113, 0.06); }

.log-info { color: var(--accent-blue); }
.log-warn { color: var(--accent-amber); }
.log-error { color: var(--accent-red); }
.log-fatal { color: var(--accent-pink); }

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(34, 211, 238, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 36px;
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #0b0f1a;
  font-weight: 800;
  margin-bottom: 12px;
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.login-error {
  padding: 10px 14px;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.login-error.hidden { display: none; }

/* ── Quick Actions ── */
.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Settings ── */
.settings-section { margin-bottom: 24px; }
.settings-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-primary);
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Pulse animation for live indicators ── */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse { animation: pulse 2s ease-in-out infinite; }

/* ── Utility Classes ── */
.text-cyan { color: var(--accent-cyan); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-amber { color: var(--accent-amber); }
.text-blue { color: var(--accent-blue); }
.text-purple { color: var(--accent-purple); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-heading { color: var(--text-heading); }
.text-xs { font-size: 0.8rem; }
.text-sm { font-size: 0.88rem; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ── Tab Navigation ── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 16px;
}
.tab-nav button {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-sans);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.tab-nav button:hover { color: var(--text-primary); }
.tab-nav button.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Drop Zone ── */
.drop-zone {
  border: 2px dashed var(--border-primary);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.04);
  color: var(--text-primary);
}
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.drop-zone-icon { font-size: 2rem; margin-bottom: 8px; }
.drop-zone-text { font-size: 0.95rem; }
.drop-zone-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Import Preview ── */
.import-preview {
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
}
.import-summary {
  display: flex;
  gap: 16px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-top: 12px;
  font-size: 0.88rem;
}
.import-summary .count { font-weight: 600; font-family: var(--font-mono); }
.import-summary .ok { color: var(--accent-green); }
.import-summary .warn { color: var(--accent-amber); }
.import-summary .err { color: var(--accent-red); }

/* ── Order Expand/Collapse ── */
.expandable-row { cursor: pointer; }
.expandable-row:hover { background: rgba(34, 211, 238, 0.05); }
.expand-icon {
  display: inline-block;
  width: 16px;
  text-align: center;
  color: var(--text-muted);
  transition: transform var(--transition);
}
.expand-icon.expanded { transform: rotate(90deg); }
.expanded-content {
  display: none;
  background: rgba(15, 23, 42, 0.3);
}
.expanded-content.show { display: table-row; }
.expanded-inner {
  padding: 12px 16px 12px 40px;
}

/* ── Report P/L Colors ── */
.profit { color: var(--accent-green); font-weight: 600; }
.loss { color: var(--accent-red); font-weight: 600; }
.neutral { color: var(--text-muted); }

/* ── Summary Row ── */
.summary-row {
  background: rgba(34, 211, 238, 0.04) !important;
  font-weight: 600;
}
.summary-row td { color: var(--text-heading) !important; border-top: 2px solid var(--border-primary); }
