/* ============================================================
   CyberCare CHRM — Main Stylesheet
   Design: Industrial-Tech / Dark-Blue + Amber Accent
   Fonts: Rajdhani (headings) + Inter (body)
   ============================================================ */

:root {
  --bg-dark:      #0b0f1a;
  --bg-card:      #111827;
  --bg-sidebar:   #0d1424;
  --bg-topbar:    #111827;
  --border:       #1e2d45;
  --accent:       #f59e0b;
  --accent-hover: #d97706;
  --accent-soft:  rgba(245,158,11,0.12);
  --blue:         #2563eb;
  --blue-soft:    rgba(37,99,235,0.15);
  --green:        #10b981;
  --red:          #ef4444;
  --orange:       #f97316;
  --purple:       #8b5cf6;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:   #475569;
  --sidebar-w:    240px;
  --topbar-h:     60px;
  --radius:       8px;
  --radius-lg:    14px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --font-head:    'Rajdhani', sans-serif;
  --font-body:    'Inter', sans-serif;
  --transition:   0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
}

.logo-img {
  max-width: 100%;
  max-height: 54px;
  object-fit: contain;
  filter: brightness(1.1);
}

.nav-section { padding: 12px 0 4px; }

.nav-label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  padding: 0 16px 4px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-item i { width: 18px; text-align: center; font-size: 0.9rem; }
.nav-logout { color: var(--red) !important; }
.nav-logout:hover { background: rgba(239,68,68,0.1) !important; border-left-color: var(--red) !important; }

/* ── Main Wrapper ──────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
}

.topbar-title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  flex: 1;
}

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

.user-info { text-align: right; }
.user-name { display: block; font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }
.user-role { display: block; font-size: 0.72rem; color: var(--text-muted); }
.user-avatar { font-size: 1.8rem; color: var(--accent); }

/* ── Page Content ──────────────────────────────── */
.page-content { flex: 1; padding: 24px; }
.page-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Cards ─────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Stat Cards ────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--accent);
  transition: width var(--transition);
}

.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.stat-card:hover::before { width: 6px; }

.stat-card.blue::before  { background: var(--blue); }
.stat-card.green::before { background: var(--green); }
.stat-card.red::before   { background: var(--red); }
.stat-card.orange::before{ background: var(--orange); }
.stat-card.purple::before{ background: var(--purple); }

.stat-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}
.stat-card.blue .stat-icon  { color: var(--blue); }
.stat-card.green .stat-icon { color: var(--green); }
.stat-card.red .stat-icon   { color: var(--red); }
.stat-card.orange .stat-icon{ color: var(--orange); }
.stat-card.purple .stat-icon{ color: var(--purple); }
.stat-card .stat-icon       { color: var(--accent); }

.stat-value {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Tables ────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

thead th {
  background: rgba(245,158,11,0.08);
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody td { padding: 10px 14px; color: var(--text-secondary); }
tbody td:first-child { color: var(--text-primary); font-weight: 500; }

/* ── Badges ────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-hot    { background: rgba(239,68,68,0.15);  color: var(--red);    border: 1px solid rgba(239,68,68,0.3); }
.badge-cold   { background: rgba(37,99,235,0.15);  color: var(--blue);   border: 1px solid rgba(37,99,235,0.3); }
.badge-won    { background: rgba(16,185,129,0.15); color: var(--green);  border: 1px solid rgba(16,185,129,0.3); }
.badge-lost   { background: rgba(100,116,139,0.15);color: #64748b;       border: 1px solid rgba(100,116,139,0.3); }
.badge-new    { background: rgba(245,158,11,0.15); color: var(--accent); border: 1px solid rgba(245,158,11,0.3); }
.badge-pending{ background: rgba(249,115,22,0.15); color: var(--orange); border: 1px solid rgba(249,115,22,0.3); }

/* ── Buttons ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary   { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-success   { background: var(--green); color: #fff; }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm        { padding: 5px 10px; font-size: 0.78rem; }
.btn-icon      { padding: 6px 8px; }

/* ── Forms ─────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }

label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }

input, select, textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 9px 12px;
  transition: border-color var(--transition);
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(245,158,11,0.05);
}

select option { background: var(--bg-card); }
textarea { resize: vertical; min-height: 80px; }

.form-section-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  grid-column: 1 / -1;
  text-transform: uppercase;
}

/* ── Alerts ────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: var(--green); }
.alert-error   { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.3);  color: var(--red); }
.alert-info    { background: var(--blue-soft);       border: 1px solid rgba(37,99,235,0.3);  color: #60a5fa; }

/* ── Pagination ────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.page-link {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.83rem;
  transition: all var(--transition);
}

.page-link:hover, .page-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

/* ── Toolbar ───────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar-search {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

/* ── Charts ────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
}

/* ── Login Page ────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-dark);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(245,158,11,0.06) 0%, transparent 60%);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

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

.login-logo img {
  max-width: 260px;
  max-height: 54px;
  object-fit: contain;
}

.login-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 6px;
}

.login-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.83rem;
  margin-bottom: 24px;
}

.login-form { display: flex; flex-direction: column; gap: 14px; }

.btn-login {
  width: 100%;
  justify-content: center;
  padding: 11px;
  font-size: 0.95rem;
  font-family: var(--font-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .sidebar-toggle {
    display: block;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .page-content {
    padding: 16px;
  }
}

/* ── Utility ───────────────────────────────────── */
.d-flex       { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-right  { text-align: right; }
.fw-700      { font-weight: 700; }
.font-head   { font-family: var(--font-head); }
