:root {
  --sidebar-bg: #0f172a;
  --sidebar-width: 240px;
  --topbar-height: 56px;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --body-bg: #f1f5f9;
  --card-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
}

body {
  background: var(--body-bg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---- Topbar ---- */
.jsk-topbar {
  background: var(--sidebar-bg) !important;
  height: var(--topbar-height);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  z-index: 1030;
}

/* ---- Layout ---- */
.jsk-wrapper {
  display: flex;
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
}

/* ---- Sidebar ---- */
.jsk-sidebar {
  width: var(--sidebar-width);
  min-height: calc(100vh - var(--topbar-height));
  background: var(--sidebar-bg);
  flex-shrink: 0;
  padding: 1rem 0;
  position: fixed;
  top: var(--topbar-height);
  bottom: 0;
  overflow-y: auto;
}

.sidebar-section {
  color: #64748b;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .75rem 1.25rem .3rem;
  margin-top: .25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .625rem;
  color: #94a3b8;
  text-decoration: none;
  padding: .5rem 1.25rem;
  font-size: .875rem;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}

.sidebar-link:hover {
  background: rgba(255,255,255,.06);
  color: #e2e8f0;
  border-left-color: var(--accent);
}

.sidebar-link.active {
  background: rgba(59,130,246,.15);
  color: #93c5fd;
  border-left-color: var(--accent);
  font-weight: 500;
}

/* ---- Main Content ---- */
.jsk-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 1.75rem 2rem;
  min-width: 0;
}

/* ---- Page Header ---- */
.page-header {
  padding-bottom: .75rem;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

/* ---- Cards ---- */
.card {
  border: none;
  border-radius: .75rem;
  box-shadow: var(--card-shadow);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  border-radius: .75rem .75rem 0 0 !important;
  font-weight: 600;
  color: #1e293b;
}

/* ---- Stat Cards ---- */
.stat-card {
  background: #fff;
  border-radius: .75rem;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: .625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.blue   { background: #eff6ff; color: #3b82f6; }
.stat-icon.green  { background: #f0fdf4; color: #22c55e; }
.stat-icon.orange { background: #fff7ed; color: #f97316; }
.stat-icon.purple { background: #faf5ff; color: #a855f7; }

.stat-label { font-size: .75rem; color: #64748b; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: #1e293b; line-height: 1; }

/* ---- Tables ---- */
.table th {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.table td {
  vertical-align: middle;
  color: #374151;
  font-size: .875rem;
}

/* ---- Forms ---- */
.form-label {
  font-weight: 500;
  font-size: .875rem;
  color: #374151;
}

.form-control, .form-select {
  border-color: #d1d5db;
  font-size: .875rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 .2rem rgba(59,130,246,.2);
}

/* ---- Buttons ---- */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ---- Lead Number badge ---- */
.lead-num {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: .875rem;
  background: #f0f9ff;
  color: #0369a1;
  padding: .2rem .5rem;
  border-radius: .375rem;
  border: 1px solid #bae6fd;
}

/* ---- Login page ---- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

.login-logo {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.03em;
}
