/* =============================================================
   SHUBHARAMBH INFRA CRM — Global Stylesheet
   Author: Shubharambh Infra CRM Team
   ============================================================= */

/* ── Google Font ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Variables ────────────────────────────────────────────── */
:root {
  /* Colors */
  --bg-primary:    #080d1a;
  --bg-secondary:  #0d1526;
  --bg-card:       #111827;
  --bg-elevated:   #1a2744;
  --bg-glass:      rgba(17, 24, 39, 0.85);

  --accent-gold:   #f59e0b;
  --accent-gold-d: #d97706;
  --accent-gold-l: #fbbf24;
  --accent-blue:   #3b82f6;
  --accent-teal:   #06b6d4;

  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;
  --text-gold:     #f59e0b;

  --border:        rgba(255,255,255,0.08);
  --border-gold:   rgba(245,158,11,0.3);

  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #f43f5e;
  --info:    #3b82f6;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-gold: 0 0 24px rgba(245,158,11,0.2);
  --shadow-glow: 0 0 40px rgba(245,158,11,0.15), 0 0 80px rgba(59,130,246,0.1);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  --transition-fast: all 0.15s ease;

  /* Sidebar */
  --sidebar-w: 260px;
  --sidebar-collapsed: 72px;
  --topbar-h: 64px;

  /* Font */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-gold); }

/* ── Typography ──────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.2; color: var(--text-primary); }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
p  { color: var(--text-secondary); }
a  { color: var(--accent-gold); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--accent-gold-l); }

/* ── Auth Layout ─────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(245,158,11,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(59,130,246,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 90%, rgba(139,92,246,0.08) 0%, transparent 60%),
    linear-gradient(160deg, #080d1a 0%, #0a1020 50%, #080d1a 100%);
  z-index: 0;
}

.auth-bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
}

/* ── Auth Side Panel ─────────────────────────────────────────── */
.auth-side {
  flex: 0 0 45%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 56px;
  position: relative;
  z-index: 1;
}

.auth-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(245,158,11,0.06), rgba(59,130,246,0.04));
  border-right: 1px solid var(--border);
}

.auth-brand {
  margin-bottom: 48px;
  position: relative;
}

.auth-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-d));
  padding: 10px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.auth-brand-badge .dot {
  width: 8px; height: 8px;
  background: var(--bg-primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.auth-brand-badge span {
  color: var(--bg-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.auth-brand h1 {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.auth-brand h1 .text-gold {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-l));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-brand p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

.auth-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 14px;
  position: relative;
}

.auth-features li .feat-icon {
  width: 36px; height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Auth Form Panel ─────────────────────────────────────────── */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  position: relative;
  z-index: 1;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.auth-card-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.auth-card-sub {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 32px;
}

/* ── Form Elements ────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
  transition: var(--transition-fast);
  z-index: 2;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  padding: 13px 16px;
  transition: var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-control.has-icon { padding-left: 44px; }

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

.form-control:focus {
  border-color: var(--accent-gold);
  background: rgba(245,158,11,0.04);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}

.form-control:focus + .input-icon,
.input-wrapper:focus-within .input-icon { color: var(--accent-gold); }

.form-control.error {
  border-color: var(--danger);
  background: rgba(244,63,94,0.04);
}

.form-control.success { border-color: var(--success); }

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

/* Select */
select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%2394a3b8' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  background-color: rgba(255,255,255,0.04);
}

select.form-control option { background: var(--bg-card); color: var(--text-primary); }

/* Password Toggle */
.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  z-index: 2;
  transition: var(--transition-fast);
}

.toggle-password:hover { color: var(--accent-gold); }

/* ── Profile Upload ───────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--accent-gold);
  background: rgba(245,158,11,0.04);
}

.upload-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-gold);
  margin: 0 auto 12px;
  display: block;
}

.upload-icon {
  width: 60px; height: 60px;
  background: var(--bg-elevated);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 24px;
  transition: var(--transition);
}

.upload-area:hover .upload-icon {
  background: rgba(245,158,11,0.15);
  transform: scale(1.05);
}

.upload-text { font-size: 13px; color: var(--text-secondary); }
.upload-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.upload-area input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.08), transparent);
  opacity: 0;
  transition: var(--transition-fast);
}

.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-d));
  color: #0a0f1e;
  box-shadow: 0 4px 16px rgba(245,158,11,0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(245,158,11,0.45);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #e11d48);
  color: #fff;
  box-shadow: 0 4px 16px rgba(244,63,94,0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; border-radius: var(--radius-md); }

/* ── OTP Input ────────────────────────────────────────────────── */
.otp-inputs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 24px 0;
}

.otp-digit {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  background: rgba(255,255,255,0.04);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
  caret-color: var(--accent-gold);
}

.otp-digit:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
  background: rgba(245,158,11,0.04);
}

.otp-digit.filled { border-color: var(--accent-gold); color: var(--accent-gold); }

/* ── Timer ────────────────────────────────────────────────────── */
.otp-timer-wrap {
  text-align: center;
  margin: 16px 0;
}

.otp-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.otp-timer .timer-count {
  font-weight: 700;
  color: var(--accent-gold);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}

.otp-timer.expired { border-color: var(--border-gold); }

.btn-resend {
  background: none;
  border: 1.5px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.btn-resend:hover {
  background: rgba(245,158,11,0.1);
  transform: none;
}

.btn-resend:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Alert / Toast ────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert-success { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: #34d399; }
.alert-danger  { background: rgba(244,63,94,0.1);  border-color: rgba(244,63,94,0.3);  color: #fb7185; }
.alert-warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
.alert-info    { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); color: #60a5fa; }

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.35s cubic-bezier(0.4,0,0.2,1);
}

.toast.removing { animation: slideOutRight 0.3s ease forwards; }
.toast-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.toast-msg   { font-size: 13px; color: var(--text-secondary); }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; margin-left: 4px; padding: 0; line-height: 1; }
.toast-success .toast-icon, .toast-success .toast-title { color: var(--success); }
.toast-error   .toast-icon, .toast-error   .toast-title { color: var(--danger);  }
.toast-warning .toast-icon, .toast-warning .toast-title { color: var(--warning); }
.toast-info    .toast-icon, .toast-info    .toast-title { color: var(--info);    }

/* ── Loading Spinner ─────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn .spinner { width: 16px; height: 16px; border-width: 2px; }

/* ── Divider ──────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── CRM Dashboard Layout ────────────────────────────────────── */
.crm-layout {
  display: flex;
  min-height: 100vh;
}

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

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-d));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-title span {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 8px;
  margin: 16px 0 6px;
}

.nav-section-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05));
  color: var(--accent-gold);
  border: 1px solid rgba(245,158,11,0.2);
}

.nav-item .nav-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

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

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.user-mini:hover { border-color: var(--accent-gold); }

.user-mini-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-gold);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold);
  flex-shrink: 0;
}

.user-mini-info { flex: 1; min-width: 0; }
.user-mini-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mini-role  { font-size: 11px; color: var(--text-muted); }

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

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

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.topbar-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

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

.topbar-btn {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  position: relative;
}

.topbar-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(245,158,11,0.08); }

.topbar-btn .badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 16px; height: 16px;
  background: var(--danger);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-gold);
  cursor: pointer;
}

/* Page Content */
.page-content {
  padding: 32px;
  flex: 1;
}

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

.card:hover { border-color: rgba(255,255,255,0.12); }

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

.card-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.card-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Stats Cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-color, var(--accent-gold));
  opacity: 0.7;
}

.stat-card:hover {
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--stat-bg, rgba(245,158,11,0.12));
  color: var(--stat-color, var(--accent-gold));
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-change {
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Table ────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-new         { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.badge-contacted   { background: rgba(139,92,246,0.15);  color: #a78bfa; }
.badge-progress    { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.badge-visit       { background: rgba(6,182,212,0.15);   color: #22d3ee; }
.badge-negotiation { background: rgba(249,115,22,0.15);  color: #fb923c; }
.badge-won         { background: rgba(16,185,129,0.15);  color: #34d399; }
.badge-lost        { background: rgba(244,63,94,0.15);   color: #fb7185; }
.badge-cold        { background: rgba(100,116,139,0.15); color: #94a3b8; }
.badge-default     { background: rgba(255,255,255,0.08); color: var(--text-secondary); }

.priority-hot  { color: #f87171; }
.priority-warm { color: #fbbf24; }
.priority-cold { color: #60a5fa; }

/* ── Animations ───────────────────────────────────────────────── */
@keyframes spin           { to { transform: rotate(360deg); } }
@keyframes pulse          { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes fadeIn         { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
@keyframes slideInRight   { from{opacity:0;transform:translateX(24px)} to{opacity:1;transform:translateX(0)} }
@keyframes slideOutRight  { to{opacity:0;transform:translateX(24px)} }
@keyframes shimmer        { 0%{background-position:-200% 0} 100%{background-position:200% 0} }
@keyframes countUp        { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

.animate-fade    { animation: fadeIn 0.4s ease; }
.animate-counter { animation: countUp 0.6s ease; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── Mobile / Responsive ─────────────────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(4px);
}

/* ── Dropdown ────────────────────────────────────────────────── */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  animation: fadeIn 0.2s ease;
}

.dropdown.open .dropdown-menu { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font);
}

.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.dropdown-item.danger:hover { background: rgba(244,63,94,0.1); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(8px);
  transition: var(--transition);
}

.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title  { font-size: 18px; font-weight: 700; }
.modal-close  { background: none; border: none; color: var(--text-muted); font-size: 22px; cursor: pointer; padding: 4px; border-radius: var(--radius-sm); transition: var(--transition-fast); }
.modal-close:hover { color: var(--danger); background: rgba(244,63,94,0.1); }
.modal-footer { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ── Utilities ────────────────────────────────────────────────── */
.text-gold    { color: var(--accent-gold) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.w-full { width: 100%; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .auth-side { display: none; }
  .auth-main { padding: 32px 24px; }
  .auth-card { padding: 36px 28px; max-width: 100%; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }

  .page-content { padding: 20px 16px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 14px; }

  .topbar { padding: 0 16px; }
  .topbar-title { font-size: 15px; }

  .auth-main { padding: 24px 16px; }
  .auth-card { padding: 28px 20px; }
  .otp-digit { width: 48px; height: 56px; font-size: 20px; }
  .otp-inputs { gap: 8px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { border-radius: var(--radius-lg); }
  .modal { border-radius: var(--radius-lg); padding: 24px 16px; }
}

/* ── Search & Filter Bar ──────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 16px 10px 40px;
  transition: var(--transition);
  outline: none;
}

.search-input:focus { border-color: var(--accent-gold); }
.search-input::placeholder { color: var(--text-muted); }

.filter-select {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 36px 10px 14px;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%2394a3b8' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-select:focus { border-color: var(--accent-gold); }
.filter-select option { background: var(--bg-card); }

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

.page-btn {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.page-btn:hover  { border-color: var(--accent-gold); color: var(--accent-gold); }
.page-btn.active { background: var(--accent-gold); color: #0a0f1e; border-color: var(--accent-gold); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-text  { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

/* ── Progress Bar ────────────────────────────────────────────── */
.progress {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-l));
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* ── Timeline ─────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 10px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
  border-radius: var(--radius-full);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  background: var(--bg-primary);
}

.timeline-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.timeline-type {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-time { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.timeline-text { font-size: 14px; color: var(--text-secondary); }
.timeline-follow-up { font-size: 12px; color: var(--success); margin-top: 6px; display: flex; align-items: center; gap: 4px; }

/* ── Kanban ───────────────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.kanban-column {
  flex: 0 0 280px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.kanban-col-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.kanban-col-title { font-size: 13px; font-weight: 700; }
.kanban-col-count {
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.kanban-cards { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 80px; }

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.kanban-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.kanban-card-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.kanban-card-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }
