@import url('https://fonts.googleapis.com/css2?family=Saira+Stencil+One&display=swap');

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

:root {
  --bg:        #080810;
  --surface:   #11111f;
  --surface2:  #17172a;
  --border:    rgba(255,255,255,.07);
  --accent:    #6c63ff;
  --accent2:   #a78bfa;
  --success:   #00e5a0;
  --danger:    #ff5f70;
  --warning:   #f59e0b;
  --text:      #f0f0fa;
  --muted:     #9090b0;
  --muted2:    #50507a;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 8px 32px rgba(0,0,0,.45);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--text); }

/* ── Navbar ───────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: rgba(8,8,16,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'Saira Stencil One', sans-serif;
  font-size: 32px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 2px;
  line-height: 1;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface2); }
.nav-links a.active { color: var(--accent2); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(108,99,255,.35);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(108,99,255,.5); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: rgba(255,95,112,.15);
  color: var(--danger);
  border: 1px solid rgba(255,95,112,.3);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: .3px;
}
.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,.2);
}
.form-control::placeholder { color: var(--muted2); }

.form-hint {
  font-size: 12px;
  color: var(--muted2);
  margin-top: 5px;
}

/* File input */
.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.drag-over {
  border-color: var(--accent);
  background: rgba(108,99,255,.06);
}
.file-drop input[type=file] { display: none; }
.file-drop .file-icon { font-size: 36px; margin-bottom: 10px; opacity: .5; }
.file-drop .file-label { font-size: 14px; color: var(--muted); }
.file-drop .file-label strong { color: var(--accent2); }
.file-drop .file-name { font-size: 13px; color: var(--success); margin-top: 8px; font-weight: 600; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.card-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

/* ── Stat cards ───────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.stat-value.accent { color: var(--accent2); }
.stat-value.success { color: var(--success); }
.stat-value.danger { color: var(--danger); }

/* ── Table ────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .1s;
}
tbody tr:hover { background: var(--surface2); }
tbody td {
  padding: 12px 14px;
  color: var(--muted);
  vertical-align: middle;
}
tbody td:first-child { color: var(--text); font-weight: 500; }

/* ── Badges / Status pills ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-success { background: rgba(0,229,160,.12); color: var(--success); }
.badge-warning { background: rgba(245,158,11,.12); color: var(--warning); }
.badge-danger  { background: rgba(255,95,112,.12); color: var(--danger); }
.badge-muted   { background: rgba(144,144,176,.1); color: var(--muted); }
.badge-accent  { background: rgba(108,99,255,.15); color: var(--accent2); }
.badge-test    { background: rgba(108,99,255,.1);  color: var(--muted2); }

/* ── Alert ────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 18px;
  display: none;
}
.alert.show { display: block; }
.alert-error   { background: rgba(255,95,112,.12); color: var(--danger); border: 1px solid rgba(255,95,112,.25); }
.alert-success { background: rgba(0,229,160,.1);  color: var(--success); border: 1px solid rgba(0,229,160,.25); }
.alert-info    { background: rgba(108,99,255,.12); color: var(--accent2); border: 1px solid rgba(108,99,255,.25); }

/* ── Auth layout ──────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(108,99,255,.12) 0%, transparent 70%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow);
}
.auth-logo {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 28px;
  color: var(--text);
}
.auth-logo span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
}
.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 20px;
}

/* ── Page layout ──────────────────────────────────────────────────────── */
.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px;
}
.page-header {
  margin-bottom: 28px;
}
.page-title {
  font-size: 22px;
  font-weight: 800;
}
.page-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

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

/* ── Empty state ──────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted2);
}
.empty-icon { font-size: 40px; margin-bottom: 14px; opacity: .4; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.empty-text { font-size: 13px; }

/* ── Landing page ─────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 100px 24px 80px;
  background: radial-gradient(ellipse at 50% 0%, rgba(108,99,255,.15) 0%, transparent 65%);
}
.hero-badge {
  display: inline-block;
  background: rgba(108,99,255,.15);
  border: 1px solid rgba(108,99,255,.3);
  color: var(--accent2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}
.hero h1 .grad {
  background: linear-gradient(135deg, var(--accent), var(--accent2), #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 36px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn { padding: 13px 28px; font-size: 15px; }

.features {
  padding: 80px 24px;
  max-width: 1000px;
  margin: 0 auto;
}
.features-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 48px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color .2s, transform .2s;
}
.feature-card:hover {
  border-color: rgba(108,99,255,.35);
  transform: translateY(-3px);
}
.feature-icon {
  font-size: 28px;
  margin-bottom: 14px;
}
.feature-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

.landing-footer {
  text-align: center;
  padding: 32px;
  font-size: 13px;
  color: var(--muted2);
  border-top: 1px solid var(--border);
}

/* ── Sidebar nav (dashboard pages) ───────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
  transition: background .12s, color .12s;
}
.sidebar-link:hover { background: var(--surface2); color: var(--text); }
.sidebar-link.active { background: rgba(108,99,255,.15); color: var(--accent2); font-weight: 600; }
.sidebar-link .icon { font-size: 16px; width: 20px; text-align: center; }

.main-content {
  flex: 1;
  padding: 36px 32px;
  overflow-y: auto;
}

/* ── Progress bar ─────────────────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .4s ease;
}

/* ── Pagination ───────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
}
.pagination button {
  padding: 6px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.pagination button:hover:not(:disabled) { background: var(--surface); color: var(--text); }
.pagination button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination button:disabled { opacity: .35; cursor: not-allowed; }
.pagination .page-info { font-size: 12px; color: var(--muted2); padding: 0 8px; }

/* ── Utilities ────────────────────────────────────────────────────────── */
.text-muted   { color: var(--muted); }
.text-accent  { color: var(--accent2); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-sm      { font-size: 13px; }
.text-xs      { font-size: 11px; }
.font-bold    { font-weight: 700; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.flex { display: flex; }
.flex-center  { display: flex; align-items: center; }
.gap-2 { gap: 10px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 20px 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar { padding: 0 16px; }
  .nav-links a { padding: 5px 10px; }
}
