/* ============================================================
   Universal CRM — Main Stylesheet
   ============================================================ */

:root {
  --primary:        #4f46e5;
  --primary-dark:   #4338ca;
  --primary-light:  #eef2ff;
  --secondary:      #6b7280;
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #06b6d4;
  --dark:           #111827;
  --sidebar-w:      260px;
  --topbar-h:       60px;
  --radius:         0.625rem;
  --radius-lg:      1rem;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
  --shadow:         0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.12);
  --border:         #e5e7eb;
  --bg:             #f5f6fa;
  --card-bg:        #ffffff;
  --text:           #111827;
  --text-muted:     #6b7280;
  --font:           'Segoe UI', system-ui, -apple-system, sans-serif;
  --sidebar-bg:     #1e1b4b;
  --sidebar-text:   rgba(255,255,255,0.75);
  --sidebar-active: rgba(255,255,255,0.12);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.crm-body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  margin: 0;
  overflow-x: hidden;
}

/* ---- Layout ---- */
.crm-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .3s ease;
  overflow: hidden;
}

.crm-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin .3s ease;
}

/* ---- Sidebar ---- */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.sidebar-logo { height: 32px; width: auto; }
.brand-text { color: #fff; font-weight: 700; font-size: 1.1rem; flex: 1; }

.sidebar-toggle-btn {
  background: none; border: none; color: rgba(255,255,255,0.6);
  cursor: pointer; padding: .25rem; line-height: 1;
}

.sidebar-search {
  padding: .75rem 1rem;
  position: relative;
  flex-shrink: 0;
}

.sidebar-search input {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: .5rem;
  color: #fff;
  padding: .4rem .75rem .4rem 2rem;
  font-size: .8rem;
  outline: none;
}

.sidebar-search input::placeholder { color: rgba(255,255,255,0.4); }
.sidebar-search input:focus { border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.12); }
.sidebar-search > i { position: absolute; left: 1.6rem; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.4); font-size: .8rem; pointer-events: none; }

.search-results {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.search-results .sr-item {
  display: flex; gap: .75rem; align-items: center;
  padding: .6rem 1rem; cursor: pointer; text-decoration: none; color: var(--text);
}
.search-results .sr-item:hover { background: var(--bg); }
.search-results .sr-ticket { font-size: .75rem; color: var(--primary); font-weight: 600; }
.search-results .sr-name { font-size: .875rem; font-weight: 500; }

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: .5rem 0;
  overflow-y: auto;
  flex: 1;
}

.sidebar-nav .nav-section {
  padding: .6rem 1.25rem .2rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 1.25rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius);
  margin: .1rem .75rem;
  font-size: .875rem;
  transition: background .15s, color .15s;
  position: relative;
}

.sidebar-nav li a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar-nav li.active > a { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.sidebar-nav li.active > a::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 50%; transform: translateY(-50%);
  height: 20px; width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.sidebar-nav li a i { font-size: 1rem; flex-shrink: 0; }
.sidebar-nav li a span:first-of-type { flex: 1; }

.badge-count {
  font-size: .65rem;
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: .1rem .4rem;
  border-radius: 2rem;
  font-weight: 600;
}
.badge-count.badge-danger { background: var(--danger); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.sidebar-user img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-name { display: block; color: #fff; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; color: rgba(255,255,255,0.45); font-size: .7rem; }
.logout-btn { color: rgba(255,255,255,0.4); font-size: 1.1rem; transition: color .15s; }
.logout-btn:hover { color: var(--danger); }

/* ---- Topbar ---- */
.crm-topbar {
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
  background: none; border: none; font-size: 1.25rem; color: var(--text-muted); cursor: pointer; padding: .25rem; display: none;
}

.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.1rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .breadcrumb { margin: 0; padding: 0; font-size: .75rem; }
.topbar-title .breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

.topbar-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

.topbar-icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: background .15s;
}
.topbar-icon-btn:hover { background: var(--bg); color: var(--text); }

.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
  border: 2px solid #fff;
}

.topbar-avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%; border: 2px solid var(--border);
  padding: 0; cursor: pointer; overflow: hidden;
}
.topbar-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

.notification-panel {
  width: 340px; padding: 0;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .875rem;
}
.notif-header a { font-size: .75rem; color: var(--primary); font-weight: 400; }

.notif-list { max-height: 380px; overflow-y: auto; }

.notif-item {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: background .15s;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-light); }
.notif-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .9rem; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: .8rem; font-weight: 600; margin-bottom: .1rem; }
.notif-msg { font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: .7rem; color: var(--text-muted); margin-top: .2rem; }

/* ---- Content ---- */
.crm-content { padding: 1.5rem; flex: 1; }

.crm-flash { border-radius: var(--radius); }

/* ---- Cards ---- */
.crm-card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.crm-card .card-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: .875rem 1.25rem;
  display: flex; align-items: center; gap: .75rem;
  font-weight: 600;
  font-size: .875rem;
}
.card-title { font-weight: 600; font-size: .875rem; color: var(--text); }

/* ---- Stat Cards ---- */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent, var(--primary));
}
.stat-icon { font-size: 1.5rem; color: var(--accent, var(--primary)); margin-bottom: .5rem; opacity: .8; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; font-weight: 500; }
.stat-progress { margin-top: .5rem; }

/* ---- Tables ---- */
.crm-table { font-size: .875rem; }
.crm-table thead th {
  background: var(--bg);
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .03em;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding: .75rem 1rem;
  white-space: nowrap;
}
.crm-table tbody td { padding: .75rem 1rem; vertical-align: middle; border-bottom: 1px solid var(--border); }
.crm-table tbody tr:hover { background: var(--primary-light); }
.crm-table tbody tr:last-child td { border-bottom: none; }

/* ---- Lead Info ---- */
.lead-info { display: flex; align-items: center; gap: .75rem; }
.lead-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.lead-name { font-weight: 600; color: var(--text); text-decoration: none; font-size: .875rem; }
.lead-name:hover { color: var(--primary); }
.lead-contact { font-size: .75rem; color: var(--text-muted); }
.lead-contact span { margin-right: .75rem; }
.lead-contact i { font-size: .7rem; }

/* ---- Badges ---- */
.ticket-badge {
  font-family: 'Courier New', monospace;
  font-size: .75rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  padding: .15rem .5rem;
  border-radius: .25rem;
  text-decoration: none;
  letter-spacing: .5px;
  display: inline-block;
}

.status-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 2rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.status-new        { background: #eff6ff; color: #3b82f6; }
.status-contacted  { background: #f0fdf4; color: #10b981; }
.status-qualified  { background: #fefce8; color: #d97706; }
.status-unqualified{ background: #f3f4f6; color: #6b7280; }
.status-converted  { background: #d1fae5; color: #059669; }
.status-lost       { background: #fef2f2; color: #ef4444; }
.status-junk       { background: #f3f4f6; color: #9ca3af; }

.priority-badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: .25rem;
  font-size: .7rem;
  font-weight: 600;
}
.priority-low    { background: #f3f4f6; color: #6b7280; }
.priority-medium { background: #eff6ff; color: #3b82f6; }
.priority-high   { background: #fefce8; color: #d97706; }
.priority-urgent { background: #fef2f2; color: #ef4444; }

.source-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 2rem;
  font-size: .75rem;
  font-weight: 500;
  background: color-mix(in srgb, var(--color) 12%, transparent);
  color: var(--color);
  border: 1px solid color-mix(in srgb, var(--color) 25%, transparent);
}

.stage-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: .25rem;
  font-size: .75rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--color) 12%, transparent);
  color: var(--color);
}

/* ---- Avatars ---- */
.avatar-xs { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

/* ---- Lead Detail ---- */
.lead-big-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800;
}

.info-list { display: flex; flex-direction: column; gap: .75rem; }
.info-item { display: flex; align-items: flex-start; gap: .75rem; }
.info-item > i { color: var(--text-muted); font-size: .9rem; margin-top: .1rem; flex-shrink: 0; }
.info-label { font-size: .7rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.info-value { font-size: .875rem; font-weight: 500; color: var(--text); }

.btn-copy { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0; font-size: .75rem; }
.btn-copy:hover { color: var(--primary); }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0; font-size: .75rem; text-decoration: underline; }

/* Pipeline stages list (lead detail) */
.pipeline-stages-list { display: flex; flex-direction: column; gap: .1rem; }
.pipeline-stage-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .6rem; border-radius: var(--radius); cursor: pointer;
  font-size: .8rem; transition: background .15s;
}
.pipeline-stage-item:hover { background: var(--bg); }
.pipeline-stage-item.active { background: color-mix(in srgb, var(--color) 10%, transparent); font-weight: 600; color: var(--color); }
.pipeline-stage-item.done { color: var(--text-muted); }
.stage-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color); flex-shrink: 0; }
.stage-indicator { font-size: .8rem; color: var(--color); font-weight: 600; }

/* ---- Tabs ---- */
.crm-tabs { border-bottom: 1px solid var(--border); }
.crm-tabs .nav-link {
  color: var(--text-muted); border: none; border-bottom: 2px solid transparent;
  padding: .75rem 1.25rem; font-size: .875rem; font-weight: 500;
  border-radius: 0; transition: color .15s;
}
.crm-tabs .nav-link:hover { color: var(--text); }
.crm-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.crm-tab-content { }

/* ---- Activity Timeline ---- */
.activity-feed-wrap { max-height: 450px; overflow-y: auto; }
.activity-feed { padding: 0; }
.activity-item { display: flex; gap: .75rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary);
}
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: .8rem; line-height: 1.5; }
.activity-time { font-size: .7rem; color: var(--text-muted); margin-top: .15rem; }

.activity-timeline { padding: 1.25rem; }
.timeline-item { display: flex; gap: 1rem; padding-bottom: 1.25rem; position: relative; }
.timeline-item::before {
  content: ''; position: absolute; left: 15px; top: 28px; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-icon {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .8rem;
  background: var(--primary-light); color: var(--primary); position: relative; z-index: 1;
}
.timeline-content { flex: 1; }
.timeline-header { font-size: .875rem; }
.timeline-data { font-size: .75rem; background: var(--bg); padding: .5rem .75rem; border-radius: .375rem; margin-top: .4rem; color: var(--text-muted); white-space: pre-wrap; font-family: monospace; }
.timeline-time { font-size: .7rem; color: var(--text-muted); margin-top: .25rem; }

/* ---- Followups ---- */
.followup-list { display: flex; flex-direction: column; gap: .75rem; }
.followup-item { display: flex; gap: .875rem; padding: .875rem; background: var(--bg); border-radius: var(--radius); }
.followup-item.missed { border-left: 3px solid var(--danger); }
.followup-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.type-call { background: #eff6ff; color: #3b82f6; }
.type-email { background: #fef3c7; color: #d97706; }
.type-meeting { background: #f0fdf4; color: #10b981; }
.type-whatsapp { background: #f0fdf4; color: #25d366; }
.followup-body { flex: 1; }
.followup-header { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .25rem; }
.followup-type { font-weight: 600; font-size: .8rem; }
.followup-time { font-size: .8rem; color: var(--text-muted); }
.followup-notes { font-size: .8rem; color: var(--text); margin-bottom: .25rem; }

/* ---- Notes ---- */
.notes-list { display: flex; flex-direction: column; gap: .875rem; }
.note-item { background: var(--bg); border-radius: var(--radius); padding: .875rem; }
.note-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; font-size: .8rem; }
.note-content { font-size: .875rem; color: var(--text); white-space: pre-wrap; }

/* ---- Tasks ---- */
.tasks-list { display: flex; flex-direction: column; gap: .5rem; }
.task-item { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem; background: var(--bg); border-radius: var(--radius); }
.task-item.status-completed .task-title { color: var(--text-muted); }
.task-body { flex: 1; }
.task-title { font-size: .875rem; font-weight: 500; }
.task-desc { font-size: .8rem; }
.task-meta { display: flex; gap: .5rem; align-items: center; margin-top: .3rem; flex-wrap: wrap; }

/* ---- Documents ---- */
.documents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .875rem; }
.doc-item { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .875rem; display: flex; gap: .75rem; align-items: flex-start; }
.doc-icon { width: 40px; height: 40px; border-radius: .375rem; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; background: var(--primary-light); color: var(--primary); }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: .8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: .7rem; }
.doc-actions { display: flex; gap: .25rem; flex-shrink: 0; }

/* ---- Email List ---- */
.email-list { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; }
.email-item { background: var(--bg); border-radius: var(--radius); padding: .75rem; }
.email-header { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .25rem; font-size: .875rem; }

/* ---- Buttons ---- */
.btn-xs {
  padding: .15rem .45rem;
  font-size: .75rem;
  border-radius: .25rem;
  line-height: 1.4;
}

/* ---- Toolbar ---- */
.page-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: .5rem; }

/* ---- Bulk Actions ---- */
.bulk-actions-bar {
  background: var(--primary);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}
.bulk-count { font-weight: 600; font-size: .875rem; }
.bulk-btns { display: flex; gap: .5rem; }

/* ---- Report Stats ---- */
.report-stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  border-top: 3px solid var(--accent, var(--primary));
}
.rs-label { font-size: .75rem; color: var(--text-muted); font-weight: 500; margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em; }
.rs-value { font-size: 1.8rem; font-weight: 800; color: var(--text); }
.rs-change { font-size: .75rem; margin-top: .2rem; }

/* ---- Settings ---- */
.settings-nav .list-group-item { border: none; padding: .6rem 1rem; font-size: .875rem; border-radius: var(--radius) !important; margin: .1rem 0; }
.settings-nav .list-group-item i { margin-right: .5rem; }
.settings-nav .list-group-item.active { background: var(--primary-light); color: var(--primary); border-color: transparent; }

.role-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.role-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.role-name { font-weight: 700; font-size: .875rem; }
.role-perms { display: flex; flex-wrap: wrap; gap: .3rem; }
.perm-badge { font-size: .7rem; background: var(--primary-light); color: var(--primary); padding: .15rem .5rem; border-radius: .25rem; }

.perm-module-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .875rem; }
.perm-module-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .5rem; }
.perm-module-card .form-check { padding: .15rem 0 .15rem 1.5rem; }

.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }

/* ---- Toast ---- */
.toast { border-radius: var(--radius); box-shadow: var(--shadow-lg); }

/* ---- Login ---- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); padding: 1rem; }
.login-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; padding: 2.5rem; }
.login-logo { display: flex; align-items: center; justify-content: center; margin-bottom: 2rem; }
.login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin: 0; }

/* ---- Mobile ---- */
@media (max-width: 991.98px) {
  .crm-sidebar { transform: translateX(-100%); }
  .crm-sidebar.open { transform: translateX(0); }
  .crm-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .crm-content { padding: 1rem; }
  .topbar-title h1 { font-size: .95rem; }
  .stat-value { font-size: 1.4rem; }
}

@media (max-width: 575.98px) {
  .crm-content { padding: .75rem; }
  .page-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { flex-wrap: wrap; }
}

/* ---- Sidebar Overlay ---- */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 999;
}
.sidebar-overlay.show { display: block; }

/* ---- Misc ---- */
.color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.crm-body .form-control, .crm-body .form-select {
  border-color: var(--border); border-radius: var(--radius);
  font-size: .875rem;
}
.crm-body .form-control:focus, .crm-body .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.sticky-top { top: calc(var(--topbar-h) + 1rem) !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
