/* ============================================
   HelpU SaaS Platform - Complete Design System
   ============================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #7c3aed;
  --accent-light: #ede9fe;
  --success: #059669;
  --success-light: #d1fae5;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --info: #0891b2;
  --info-light: #cffafe;

  --bg: #f1f5f9;
  --card: #ffffff;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #1d4ed8;
  --sidebar-text: #94a3b8;
  --sidebar-active-text: #ffffff;

  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #93c5fd;

  --sidebar-w: 240px;
  --topbar-h: 60px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --shadow-primary: 0 4px 16px rgba(37,99,235,.25);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============ LAYOUT ============ */
.app-wrapper { display: flex; min-height: 100vh; }

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .3s ease;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.sidebar-logo {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-primary);
}

.logo-text { font-size: 18px; font-weight: 700; color: #f1f5f9; letter-spacing: -.3px; }
.logo-badge {
  font-size: 9px; font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.sidebar-section { padding: 8px 0; flex-shrink: 0; }

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 18px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: var(--sidebar-text);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .18s ease;
  font-size: 13.5px;
  font-weight: 450;
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,.05);
  color: #e2e8f0;
}

.nav-item.active {
  background: rgba(37,99,235,.2);
  color: #fff;
  border-left-color: var(--primary);
  font-weight: 600;
}

.nav-item i { font-size: 17px; width: 20px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,.07);
  margin-top: auto;
  flex-shrink: 0;
}

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

.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12.5px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: #64748b; }

/* ============ MAIN CONTENT ============ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============ TOPBAR ============ */
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text); }
.topbar-subtitle { font-size: 12px; color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
  position: relative;
}

.topbar-btn:hover { background: var(--bg); color: var(--text); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--card);
}

/* ============ PAGE CONTENT ============ */
.page-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title { font-size: 20px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ============ CARDS ============ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============ STATS ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-card.blue::before { background: var(--primary); }
.stat-card.green::before { background: var(--success); }
.stat-card.purple::before { background: var(--accent); }
.stat-card.orange::before { background: var(--warning); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-change { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .18s ease;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.1px;
}

.btn:active { transform: scale(.98); }

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

.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }

.btn-danger { background: var(--danger-light); color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fecaca; }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #6d28d9; }

.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -.1px;
}

.badge-blue   { background: var(--primary-light); color: var(--primary-dark); }
.badge-green  { background: var(--success-light); color: #065f46; }
.badge-purple { background: var(--accent-light); color: #5b21b6; }
.badge-red    { background: var(--danger-light); color: #991b1b; }
.badge-yellow { background: var(--warning-light); color: #92400e; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-cyan   { background: var(--info-light); color: #164e63; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-control::placeholder { color: var(--text-light); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.6; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }

.input-group { position: relative; }
.input-group .form-control { padding-left: 38px; }
.input-group-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 15px;
}

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

table { width: 100%; border-collapse: collapse; }

thead tr { background: #f8fafc; }

th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfc; }

.td-name { font-weight: 600; }
.td-muted { color: var(--text-muted); font-size: 12px; margin-top: 1px; }

/* ============ TABS ============ */
.tabs {
  display: flex;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 20px;
  gap: 2px;
}

.tab {
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  transition: all .15s;
  border-radius: 6px 6px 0 0;
}

.tab:hover { color: var(--text); background: var(--bg); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; background: transparent; }

/* ============ TOGGLE ============ */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  transition: .3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .3s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ============ ALERTS ============ */
.alert {
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.5;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-success { background: #f0fdf4; color: #14532d; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #78350f; border: 1px solid #fde68a; }
.alert-danger  { background: #fef2f2; color: #7f1d1d; border: 1px solid #fecaca; }

/* ============ MODAL ============ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 16px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 26px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}

.modal-lg { max-width: 680px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-title { font-size: 17px; font-weight: 700; }

.close-btn {
  width: 30px; height: 30px;
  background: var(--bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  transition: all .15s;
}

.close-btn:hover { background: var(--border); color: var(--text); }

/* ============ TOAST ============ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease;
  min-width: 280px;
}

.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-info    { background: var(--primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ CODE BLOCK ============ */
.code-block {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 18px;
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
  position: relative;
  white-space: pre;
  border: 1px solid #1e293b;
}

.code-block .token-keyword { color: #93c5fd; }
.code-block .token-string  { color: #86efac; }
.code-block .token-comment { color: #64748b; }

.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all .15s;
  font-weight: 600;
}

.copy-btn:hover { background: #334155; color: #e2e8f0; }

/* ============ SMTP / AUTOREPLY CARDS ============ */
.list-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  transition: box-shadow .15s;
}

.list-card:hover { box-shadow: var(--shadow-sm); }

.list-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.list-card-body { flex: 1; min-width: 0; }
.list-card-title { font-weight: 600; font-size: 13.5px; }
.list-card-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-card-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ============ AI INDICATOR ============ */
.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.ai-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: aiPulse 1.8s ease-in-out infinite;
}

@keyframes aiPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.8); }
}

/* ============ WIDGET PREVIEW ============ */
.widget-preview-wrap {
  background: linear-gradient(135deg, #667eea22 0%, #764ba222 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 420px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 20px;
}

.widget-preview-label {
  position: absolute;
  top: 14px; left: 14px;
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--card);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-weight: 500;
}

.chat-widget-frame {
  width: 330px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 12px 48px rgba(0,0,0,.18);
  overflow: hidden;
}

.chat-widget-header {
  background: var(--primary);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.chat-widget-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #fff;
}

.chat-widget-name  { font-weight: 700; font-size: 14px; color: #fff; }
.chat-widget-status{ font-size: 11.5px; color: rgba(255,255,255,.8); margin-top: 1px; }

.chat-messages-wrap {
  height: 240px;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: #f8fafc;
}

.chat-bubble-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.55;
}

.chat-bubble-msg.bot {
  background: #fff;
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble-msg.user {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-input-wrap {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  background: #fff;
}

.chat-input-wrap input {
  flex: 1;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12.5px;
  outline: none;
}

.chat-input-wrap input:focus { border-color: var(--primary); }

.chat-send-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 7px 13px;
  cursor: pointer;
  font-size: 13px;
  transition: background .15s;
}

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

.chat-fab {
  width: 54px; height: 54px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37,99,235,.45);
  margin-bottom: 14px;
  margin-right: 6px;
  transition: transform .2s;
}

.chat-fab:hover { transform: scale(1.08); }

/* ============ SEARCH ============ */
.search-wrap { position: relative; }
.search-wrap .form-control { padding-left: 36px; }
.search-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: 16px; }

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; opacity: .3; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 13.5px; margin-bottom: 20px; }

/* ============ LOGIN PAGE ============ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-bg-circles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.login-bg-circles::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.15) 0%, transparent 70%);
  top: -200px; right: -200px;
}
.login-bg-circles::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.12) 0%, transparent 70%);
  bottom: -100px; left: -100px;
}

.login-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 1;
}

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

.login-logo-icon {
  width: 60px; height: 60px;
  background: var(--primary);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900; color: #fff;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(37,99,235,.4);
}

.login-logo h1 { font-size: 24px; font-weight: 800; color: #f1f5f9; letter-spacing: -.5px; }
.login-logo p { font-size: 13.5px; color: #64748b; margin-top: 4px; }

.login-form-label { font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; display: block; }

.login-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: rgba(255,255,255,.05);
  color: #f1f5f9;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.login-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.2);
}

.login-input::placeholder { color: #475569; }

.login-divider {
  text-align: center;
  font-size: 12px;
  color: #475569;
  margin: 14px 0;
  position: relative;
}

.login-divider::before, .login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: rgba(255,255,255,.08);
}
.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }

.login-demo-box {
  background: rgba(37,99,235,.1);
  border: 1px solid rgba(37,99,235,.2);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 12px;
  color: #93c5fd;
  margin-top: 16px;
  line-height: 1.8;
}

/* ============ LEAD KANBAN ============ */
.lead-stage-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stage-filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sidebar .logo-text, .sidebar .sidebar-label, .sidebar .nav-item span,
  .sidebar .sidebar-user-info, .sidebar .logo-badge { display: none; }
  .main-content { margin-left: 64px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
}

/* ============ UTILITIES ============ */
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }
