/* ==========================================================================
   SsAcademy Lead Management ERP — Theme
   Design language: soft lavender background, white rounded cards,
   deep indigo primary accent, pill-shaped active states.
   ========================================================================== */

:root {
  /* Palette */
  --bg-gradient: linear-gradient(160deg, #EEF0FC 0%, #E4E8FB 45%, #ECEEFB 100%);
  --surface: #FFFFFF;
  --surface-muted: #F6F7FD;

  --primary: #241E63;          /* deep indigo — sidebar active pill, headings */
  --primary-dark: #171340;
  --accent: #6C5DD3;           /* soft purple — icons, links, focus rings */
  --accent-light: #EFEBFB;     /* icon chip backgrounds */

  --text-primary: #1E1B33;
  --text-secondary: #6B7086;
  --text-muted: #9598AA;
  --border: #E7E8F3;

  --success-bg: #E4F9EC;
  --success-text: #189B54;
  --danger-bg: #FDEAEE;
  --danger-text: #E23A54;
  --warning-bg: #FFF4E1;
  --warning-text: #B4790C;
  --info-bg: #E7F1FF;
  --info-text: #2563EB;

  --shadow-sm: 0 1px 3px rgba(30, 27, 51, 0.06);
  --shadow-md: 0 6px 20px rgba(30, 27, 51, 0.08);
  --shadow-lg: 0 16px 40px rgba(30, 27, 51, 0.14);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --sidebar-width: 264px;
  --topbar-height: 76px;

  --font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

/* Safety default: inline <svg> icons with no explicit size otherwise render
   at the browser's default (~300x150). More specific rules below override
   this per-context (nav icons, buttons, stat cards, etc). */
svg { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-gradient);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D3D6EE; border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- LAYOUT */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}

.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 48px;
}

/* --------------------------------------------------------------- SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 24px;
}

.sidebar-logo img { width: 30px; height: 30px; }

.sidebar-logo .logo-text {
  font-size: 19px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.sidebar-logo .logo-text span { color: var(--accent); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 18px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 14.5px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}

.nav-item:hover { background: var(--surface-muted); color: var(--text-primary); }

.nav-item.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.nav-item .nav-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-item .nav-icon svg { width: 100%; height: 100%; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 10px;
}

/* ---------------------------------------------------------------- TOPBAR */
.topbar {
  height: var(--topbar-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  background: transparent;
}

.topbar-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
}

.topbar-search svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.topbar-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  width: 100%;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  color: var(--text-secondary);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn .dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger-text);
  border: 2px solid var(--surface);
}

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 6px 14px 6px 6px;
  box-shadow: var(--shadow-sm);
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.avatar-circle.sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar-circle.lg { width: 64px; height: 64px; font-size: 20px; }

.topbar-profile .name-block { line-height: 1.25; }
.topbar-profile .name { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.topbar-profile .role { font-size: 11.5px; color: var(--text-muted); }

/* ------------------------------------------------------------- PAGE HEAD */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.page-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.page-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
