:root {
  --bg: #0d1220;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #a9b4c7;
  --line: rgba(255, 255, 255, 0.12);
  --primary: #7c3aed;
  --primary-2: #06b6d4;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.35), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.24), transparent 32rem),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
code {
  display: inline-block;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  color: #d8ecff;
  font-size: 0.9rem;
  max-width: 100%;
  overflow: auto;
}

.app-shell { display: grid; grid-template-columns: 285px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.4rem;
  border-right: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.brand { display: flex; gap: 0.85rem; align-items: center; }
.brand-mark, .login-logo {
  width: 48px; height: 48px;
  border-radius: 16px;
  display: grid; place-items: center;
  font-weight: 900;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 16px 38px rgba(124, 58, 237, 0.35);
}
.brand strong { display: block; font-size: 1.05rem; }
.brand span, .sidebar-note { color: var(--muted); font-size: 0.88rem; }
.nav { display: grid; gap: 0.45rem; }
.nav a {
  padding: 0.9rem 1rem;
  color: var(--muted);
  border-radius: 16px;
  transition: 0.2s ease;
}
.nav a:hover, .nav a.active { color: var(--text); background: var(--panel-strong); }
.sidebar-footer { margin-top: auto; display: grid; gap: 0.8rem; }
.user-pill {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.user-pill span { display: block; font-weight: 800; }
.user-pill small { color: var(--muted); }

.main { padding: 2rem; max-width: 1280px; width: 100%; }
.hero, .page-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.3rem;
}
h1 { margin: 0; font-size: clamp(2rem, 5vw, 4.5rem); letter-spacing: -0.07em; line-height: 0.96; }
h2 { margin-top: 0; letter-spacing: -0.03em; }
p { color: var(--muted); line-height: 1.6; }
.eyebrow {
  margin: 0 0 0.6rem;
  color: #9ae6ff;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 800;
}
.card, .stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.105), rgba(255,255,255,0.055));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.card { padding: 1.35rem; margin-bottom: 1.25rem; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { padding: 1.25rem; }
.stat-card span, .stat-card small { color: var(--muted); display: block; }
.stat-card strong { display: block; font-size: 2.4rem; letter-spacing: -0.06em; margin: 0.2rem 0; }
.split-card { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.actions-stack { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: flex-end; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.btn-secondary { background: rgba(255,255,255,0.16); border: 1px solid var(--line); }
.btn-ghost { background: rgba(255,255,255,0.06); border: 1px solid var(--line); }
.btn-danger { background: rgba(239, 68, 68, 0.22); border: 1px solid rgba(239, 68, 68, 0.45); }
.btn.small { padding: 0.5rem 0.7rem; font-size: 0.85rem; }
.btn.full { width: 100%; }

.alert {
  padding: 1rem 1.1rem;
  border-radius: 16px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
}
.alert-success { border-color: rgba(34,197,94,0.5); background: rgba(34,197,94,0.12); }
.alert-error { border-color: rgba(239,68,68,0.5); background: rgba(239,68,68,0.13); }

.form-grid { display: grid; gap: 0.9rem; }
label { display: grid; gap: 0.35rem; color: var(--muted); font-weight: 700; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: rgba(2, 6, 23, 0.45);
  color: var(--text);
  outline: none;
}
input:focus, select:focus { border-color: rgba(6,182,212,0.8); box-shadow: 0 0 0 4px rgba(6,182,212,0.12); }

.login-wrap { min-height: calc(100vh - 4rem); display: grid; place-items: center; }
.login-card { width: min(440px, 100%); text-align: center; }
.login-logo { margin: 0 auto 1rem; }
.hint { margin-top: 1rem; color: var(--muted); font-size: 0.9rem; }

.drop-zone {
  border: 2px dashed rgba(154, 230, 255, 0.42);
  border-radius: 24px;
  padding: 2.5rem 1rem;
  text-align: center;
  background: rgba(6, 182, 212, 0.08);
  cursor: pointer;
  transition: 0.2s ease;
}
.drop-zone input { display: none; }
.drop-zone strong { color: var(--text); font-size: 1.25rem; }
.drop-zone em { color: var(--muted); font-style: normal; }
.drop-zone span, .drop-zone strong, .drop-zone em { display: block; }
.drop-icon { font-size: 3rem; margin-bottom: 0.7rem; }
.drop-zone.is-dragover { background: rgba(124, 58, 237, 0.22); border-color: #bda8ff; transform: scale(1.01); }
.selected-files {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,0.18);
  color: var(--muted);
  line-height: 1.5;
}

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.section-head span, .muted { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td { padding: 0.85rem; border-bottom: 1px solid var(--line); text-align: left; }
th { color: #d8ecff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
td { color: #eef4ff; }
.badge, .role-pill {
  display: inline-flex;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.82rem;
  background: rgba(255,255,255,0.12);
}
.badge-imported { color: #bbf7d0; background: rgba(34,197,94,0.15); }
.badge-skipped { color: #fde68a; background: rgba(245,158,11,0.16); }
.badge-error { color: #fecaca; background: rgba(239,68,68,0.18); }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.narrow-card { max-width: 560px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; margin-bottom: 1rem; }
.mini-stats div { padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,0.14); }
.mini-stats strong { display: block; font-size: 1.8rem; }
.mini-stats span { color: var(--muted); }


.workflow-card {
  border-color: rgba(6,182,212,0.32);
  background: linear-gradient(135deg, rgba(6,182,212,0.13), rgba(124,58,237,0.10));
}
.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}
.workflow-steps div {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,0.16);
}
.workflow-steps strong {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 0.65rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.workflow-steps span {
  display: block;
  color: #eef4ff;
  font-weight: 800;
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 1rem; }
  .hero, .page-head, .split-card { flex-direction: column; align-items: flex-start; }
  .stats-grid, .grid-two, .mini-stats, .workflow-steps { grid-template-columns: 1fr; }
  h1 { font-size: 2.4rem; }
}

.status-ok strong { color: #bbf7d0; }
.status-error strong { color: #fecaca; }
.transfer-card { position: relative; overflow: hidden; }
.transfer-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: rgba(148, 163, 184, 0.5);
}
.transfer-ok::before { background: rgba(34,197,94,0.85); }
.transfer-error::before { background: rgba(239,68,68,0.85); }
.transfer-meta {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,0.16);
  color: var(--muted);
  line-height: 1.65;
}
.transfer-meta span { color: #d8ecff; font-weight: 800; }
.transfer-meta code { overflow-wrap: anywhere; }
.transfer-result {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,0.14);
}
.transfer-result strong, .transfer-result span { display: block; }
.transfer-result span { color: var(--muted); margin-top: 0.25rem; }
.transfer-result.transfer-ok { border-color: rgba(34,197,94,0.45); background: rgba(34,197,94,0.10); }
.transfer-result.transfer-error { border-color: rgba(239,68,68,0.45); background: rgba(239,68,68,0.10); }
