:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --border: #e5e7eb;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at top, #f9fbff, #f5f7fb 40%, #f1f4fb 100%);
  color: var(--text);
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #5b5af7, #4f46e5);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}

.brand-name { font-weight: 800; }

.brand-sub { color: var(--muted); font-size: 12px; }

.nav-links {
  display: flex;
  gap: 10px;
  background: #f3f4ff;
  padding: 6px;
  border-radius: 12px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 10px;
  color: #4b5563;
  font-weight: 600;
  font-size: 14px;
}

.nav-link.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

@media (max-width: 960px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-inner { flex-direction: column; align-items: flex-start; }
  .nav-links { width: 100%; justify-content: space-between; }
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 14px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 32px;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  font-weight: 700;
  color: #1d4ed8;
  background: #f8fafc;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.btn-light {
  background: #f8fafc;
  color: #334155;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover { background: var(--primary-dark); }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
}

.search-input {
  background: #f8fafc;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--muted);
  margin-bottom: 12px;
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #166534;
  margin-bottom: 16px;
}

.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

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

.toolbar {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar .actions { display: flex; gap: 12px; }

.filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  /*flex-wrap: wrap;*/
}

.pagination { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }

.pagination .page {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 600;
}

.pagination .page.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination .page.disabled {
  color: var(--muted);
  background: #f8fafc;
  cursor: not-allowed;
}

.kpi { font-size: 28px; font-weight: 700; }

.small { font-size: 12px; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
}

.page-title { font-size: 22px; font-weight: 800; }

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

.actions { display: flex; gap: 10px; align-items: center; }

.form-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
}

.link { color: var(--primary); font-weight: 600; }

.stat-card {
  display: flex;
  gap: 12px;
  align-items: center;
}

.stat-link {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.stat-link.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}

.stat-icon.danger { background: #ef4444; }

.stat-icon.warning { background: #f59e0b; }

.stat-icon.success { background: #22c55e; }

.stat-icon.primary { background: #6366f1; }

.stat-title { color: var(--muted); font-size: 13px; }

.stat-value { font-size: 26px; font-weight: 800; }

.stat-value.danger { color: #ef4444; }

.stat-value.warning { color: #f59e0b; }

.stat-value.success { color: #22c55e; }

.stat-sub { color: var(--muted); font-size: 12px; }

.stat-primary {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #fff;
}

.stat-primary .stat-title,
.stat-primary .stat-sub { color: #e0e7ff; }

.stat-primary .stat-value { color: #fff; }

.bulk-page { padding-top: 8px; }

.bulk-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

.upload-card { padding: 20px; }

.upload-form { display: grid; gap: 14px; }

.dropzone {
  border: 2px dashed #d8ddf1;
  border-radius: 16px;
  padding: 22px;
  display: grid;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  background: #f8f9ff;
}

.dropzone input { display: none; }

.drop-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 12px;
  background: #eef2ff;
  color: #4f46e5;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.drop-title { font-weight: 700; }

.drop-sub { color: var(--muted); font-size: 12px; }

.upload-btn { width: 100%; }

.how-card {
  margin-top: 16px;
  background: #2f2a7a;
  color: #fff;
}

.how-title {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 10px;
  color: #c7c9ff;
}

.how-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: #e4e5ff;
  display: grid;
  gap: 8px;
}

.template-card { margin-top: 16px; }

.preview-card { min-height: 360px; padding: 0; }

.preview-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-body {
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.preview-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  color: #9ca3af;
  font-weight: 800;
  margin-bottom: 8px;
}

.preview-table {
  width: 100%;
  overflow: auto;
  max-height: 320px;
  text-align: left;
}

.preview-card .table {
  min-width: 760px;
}

.preview-footer {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.map-source {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill {
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.file-pill {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.file-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #eef2ff;
  color: #4f46e5;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 11px;
}

.file-name { font-weight: 700; }

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

.auth-wrap {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(420px, 100%);
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.auth-title { font-size: 22px; font-weight: 800; }

.auth-sub { color: var(--muted); margin-bottom: 16px; }

.auth-form { display: grid; gap: 12px; }
