/* ============================================================
   ISO CRM - Premium UI Styles v2.0
   ============================================================ */

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

:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --primary-glow: rgba(79,70,229,0.15);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --sidebar-width: 265px;
  --topbar-height: 64px;
  --border-radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f4ff;
  color: #1e293b;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ─── APP LAYOUT ─── */
#app { display: flex; min-height: 100vh; }

/* ═══════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════ */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-bg::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  top: -100px; right: -100px;
  border-radius: 50%;
}

.login-bg::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
  bottom: -50px; left: -50px;
  border-radius: 50%;
}

.login-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-particles span {
  position: absolute;
  width: 2px; height: 2px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  animation: float-particle 6s infinite linear;
}

@keyframes float-particle {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

.login-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 0;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.1);
  position: relative;
  z-index: 1;
  overflow: hidden;
  animation: slideUpIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpIn {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  padding: 36px 40px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-header::before {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  top: -60px; right: -40px;
}

.login-header::after {
  content: '';
  position: absolute;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  bottom: -30px; left: -20px;
}

.login-logo {
  width: 72px; height: 72px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  margin: 0 auto 16px;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  position: relative; z-index: 1;
}

.login-header h1 {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  position: relative; z-index: 1;
}

.login-header p {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  margin-top: 4px;
  position: relative; z-index: 1;
}

.login-body {
  padding: 32px 40px 36px;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-form-group {
  margin-bottom: 18px;
}

.login-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
}

.login-input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

.login-input:focus {
  border-color: #4f46e5;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79,70,229,0.08);
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
  letter-spacing: 0.2px;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79,70,229,0.45);
}

.login-btn:active { transform: translateY(0); }

.login-hint {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

.login-hint-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0f0c29 0%, #1a1747 40%, #1e1b4b 100%);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,0.4);
}

.sidebar-brand-text h1 {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-brand-text p {
  color: #7c86b7;
  font-size: 10.5px;
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 12px 0 20px; }

.nav-section {
  padding: 14px 20px 5px;
}

.nav-section span {
  color: #4b5899;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: #9ba3c7;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  margin: 1px 0;
  position: relative;
}

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

.nav-item.active {
  background: rgba(79,70,229,0.18);
  color: #a5b4fc;
  border-left-color: #6366f1;
}

.nav-item.active .nav-item-icon {
  color: #6366f1;
}

.nav-item-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-item:hover .nav-item-icon {
  background: rgba(255,255,255,0.06);
}

.nav-item.active .nav-item-icon {
  background: rgba(79,70,229,0.25);
}

.nav-item-label { flex: 1; }

.nav-badge {
  background: #ef4444;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge.warning { background: #f59e0b; }
.nav-badge.success { background: #10b981; }
.nav-badge.info { background: #3b82f6; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-user:hover { background: rgba(255,255,255,0.05); }

.sidebar-user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #4f46e5, #a855f7);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info p:first-child { font-size: 12.5px; font-weight: 600; color: #e2e8f0; }
.sidebar-user-info p:last-child { font-size: 10.5px; color: #6b7db3; }

.sidebar-user-logout {
  color: #6b7db3;
  font-size: 13px;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}

.sidebar-user-logout:hover { color: #ef4444; }

/* ═══════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f0f4ff;
}

/* ─── TOP BAR ─── */
.topbar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226,232,240,0.8);
  padding: 0 28px;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 20px rgba(0,0,0,0.04);
}

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

.topbar-breadcrumb {
  display: flex;
  flex-direction: column;
}

.topbar-breadcrumb span:first-child {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.topbar-breadcrumb h2 {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

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

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: none;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: var(--transition);
  position: relative;
}

.topbar-btn:hover { background: #f1f5f9; color: #374151; }

.topbar-notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid #fff;
}

/* ─── PAGE CONTENT ─── */
.page-content {
  padding: 24px 28px;
  flex: 1;
}

/* ─── SEARCH BAR ─── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 14px;
  width: 260px;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: #4f46e5;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  width: 100%;
  color: #374151;
  font-family: inherit;
}

.search-bar i { color: #94a3b8; font-size: 13px; flex-shrink: 0; }

/* ─── AVATAR ─── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #a855f7);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

.avatar:hover { transform: scale(1.05); }

/* ═══════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════ */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226,232,240,0.6);
  transition: var(--transition);
}

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

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

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════
   STAT CARDS (Dashboard)
   ═══════════════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(226,232,240,0.6);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-card-bg {
  position: absolute;
  top: -20px; right: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  opacity: 0.07;
}

.stat-card.blue .stat-card-bg { background: #3b82f6; }
.stat-card.green .stat-card-bg { background: #10b981; }
.stat-card.yellow .stat-card-bg { background: #f59e0b; }
.stat-card.red .stat-card-bg { background: #ef4444; }
.stat-card.purple .stat-card-bg { background: #8b5cf6; }
.stat-card.indigo .stat-card-bg { background: #6366f1; }
.stat-card.teal .stat-card-bg { background: #14b8a6; }
.stat-card.orange .stat-card-bg { background: #f97316; }
.stat-card.pink .stat-card-bg { background: #ec4899; }

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

.stat-card.blue .stat-icon { background: #eff6ff; color: #3b82f6; }
.stat-card.green .stat-icon { background: #f0fdf4; color: #10b981; }
.stat-card.yellow .stat-icon { background: #fffbeb; color: #d97706; }
.stat-card.red .stat-icon { background: #fef2f2; color: #ef4444; }
.stat-card.purple .stat-icon { background: #faf5ff; color: #7c3aed; }
.stat-card.indigo .stat-icon { background: #eef2ff; color: #4f46e5; }
.stat-card.teal .stat-icon { background: #f0fdfa; color: #0d9488; }
.stat-card.orange .stat-icon { background: #fff7ed; color: #ea580c; }
.stat-card.pink .stat-icon { background: #fdf2f8; color: #db2777; }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 5px;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.stat-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  margin-top: 6px;
}

.stat-trend.up { background: #f0fdf4; color: #16a34a; }
.stat-trend.down { background: #fef2f2; color: #dc2626; }

/* ═══════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }

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

thead th {
  background: #f8fafc;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1.5px solid #e2e8f0;
  white-space: nowrap;
}

thead th:first-child { border-radius: 8px 0 0 0; }
thead th:last-child { border-radius: 0 8px 0 0; }

tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

tbody tr:hover { background: #f8fafc; }
tbody td { padding: 11px 14px; color: #374151; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ═══════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.1px;
}

.badge-new { background: #eff6ff; color: #1d4ed8; }
.badge-contacted { background: #f0f9ff; color: #0369a1; }
.badge-qualified { background: #ecfdf5; color: #065f46; }
.badge-quotation { background: #fffbeb; color: #92400e; }
.badge-negotiation { background: #fef3c7; color: #78350f; }
.badge-won { background: #d1fae5; color: #065f46; }
.badge-lost { background: #fee2e2; color: #991b1b; }
.badge-upcoming { background: #dbeafe; color: #1e40af; }
.badge-renewed { background: #d1fae5; color: #065f46; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-unpaid { background: #fee2e2; color: #991b1b; }
.badge-partial { background: #fef3c7; color: #78350f; }
.badge-iso { background: #f0f4ff; color: #4f46e5; }

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  letter-spacing: 0.1px;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,0.25); }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(79,70,229,0.4); }

.btn-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,0.25); }
.btn-success:hover { box-shadow: 0 4px 14px rgba(16,185,129,0.35); }

.btn-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; box-shadow: 0 2px 8px rgba(245,158,11,0.25); }
.btn-warning:hover { box-shadow: 0 4px 14px rgba(245,158,11,0.35); }

.btn-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: #fff; box-shadow: 0 2px 8px rgba(239,68,68,0.25); }
.btn-danger:hover { box-shadow: 0 4px 14px rgba(239,68,68,0.35); }

.btn-secondary { background: #f8fafc; color: #475569; border: 1.5px solid #e2e8f0; box-shadow: none; }
.btn-secondary:hover { background: #f1f5f9; border-color: #cbd5e1; }

.btn-outline { background: transparent; color: #4f46e5; border: 1.5px solid #c7d2fe; }
.btn-outline:hover { background: #f0f4ff; border-color: #6366f1; }

.btn-ghost { background: transparent; color: #64748b; border: none; box-shadow: none; padding: 8px; }
.btn-ghost:hover { background: #f1f5f9; color: #374151; transform: none; }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 11px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 12px; }
.btn-icon { padding: 8px; min-width: 34px; justify-content: center; border-radius: 9px; }

/* WhatsApp & Email Buttons */
.btn-wa { background: linear-gradient(135deg, #25d366 0%, #1ebe5d 100%); color: #fff; box-shadow: 0 2px 8px rgba(37,211,102,0.3); }
.btn-wa:hover { box-shadow: 0 4px 14px rgba(37,211,102,0.45); }

.btn-email { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,0.3); }
.btn-email:hover { box-shadow: 0 4px 14px rgba(79,70,229,0.45); }

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

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

.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-label span { color: #ef4444; }

.form-control {
  padding: 10px 13px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  transition: var(--transition);
  outline: none;
  width: 100%;
  font-family: inherit;
}

.form-control:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}

.form-control:invalid:not(:placeholder-shown) { border-color: #ef4444; }

textarea.form-control { resize: vertical; min-height: 80px; }

/* ═══════════════════════════════════════════════════════
   FOLLOWUP COLOR CODING
   ═══════════════════════════════════════════════════════ */
.followup-overdue { background: linear-gradient(90deg, #fef2f2 0%, #fff 100%) !important; }
.followup-today { background: linear-gradient(90deg, #fffbeb 0%, #fff 100%) !important; }
.followup-future { background: linear-gradient(90deg, #f0fdf4 0%, #fff 100%) !important; }

.dot-overdue {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.2);
  animation: pulse-red 2s infinite;
}

.dot-today {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(245,158,11,0.2);
  animation: pulse-yellow 2s infinite;
}

.dot-future {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 2px rgba(239,68,68,0.2); }
  50% { box-shadow: 0 0 0 5px rgba(239,68,68,0.1); }
}

@keyframes pulse-yellow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(245,158,11,0.2); }
  50% { box-shadow: 0 0 0 5px rgba(245,158,11,0.1); }
}

/* ═══════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { transform: translateY(24px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-sm { max-width: 440px; }
.modal-md { max-width: 620px; }
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1020px; }

.modal-header {
  padding: 20px 26px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  border-radius: 20px 20px 0 0;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: #f0f4ff;
  color: #4f46e5;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.modal-body { padding: 22px 26px; }

.modal-footer {
  padding: 18px 26px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fafafa;
  border-radius: 0 0 20px 20px;
}

.btn-close {
  width: 34px; height: 34px;
  border: none;
  background: #f8fafc;
  border-radius: 9px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #64748b;
  transition: var(--transition);
  font-size: 14px;
}

.btn-close:hover { background: #fee2e2; color: #dc2626; }

/* ═══════════════════════════════════════════════════════
   KANBAN BOARD
   ═══════════════════════════════════════════════════════ */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 500px;
}

.kanban-board::-webkit-scrollbar { height: 5px; }

.kanban-col {
  flex: 0 0 240px;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}

.kanban-col-header {
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 14px 14px 0 0;
  background: #fff;
  border-top: 3px solid transparent;
}

.kanban-col-header span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kanban-col-count {
  font-size: 11px;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.kanban-cards {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.kanban-card:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(79,70,229,0.12);
  transform: translateY(-2px);
}

.kanban-card-title { font-size: 13px; font-weight: 600; color: #0f172a; margin-bottom: 4px; }
.kanban-card-sub { font-size: 11.5px; color: #64748b; }
.kanban-score { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.score-high { background: #d1fae5; color: #065f46; }
.score-mid { background: #fef3c7; color: #78350f; }
.score-low { background: #fee2e2; color: #991b1b; }

/* ═══════════════════════════════════════════════════════
   RENEWAL TIMELINES
   ═══════════════════════════════════════════════════════ */
.renewal-90 { border-left: 3px solid #3b82f6; }
.renewal-30 { border-left: 3px solid #f59e0b; }
.renewal-7 { border-left: 3px solid #ef4444; }
.renewal-expired { border-left: 3px solid #dc2626; background: #fef2f2; }

/* ═══════════════════════════════════════════════════════
   SCORE BAR
   ═══════════════════════════════════════════════════════ */
.score-bar {
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 5px;
}

.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* ═══════════════════════════════════════════════════════
   CHARTS
   ═══════════════════════════════════════════════════════ */
.chart-container { position: relative; height: 240px; }
.chart-container-lg { position: relative; height: 300px; }

/* ═══════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #94a3b8;
  text-align: center;
}

.empty-state-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}

.empty-state i { font-size: 36px; opacity: 0.35; }
.empty-state p { font-size: 14px; margin-top: 8px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: #475569; margin-top: 4px; }

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

.toast {
  background: #1e293b;
  color: #fff;
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 270px;
  max-width: 380px;
  font-family: inherit;
}

@keyframes toastIn {
  from { transform: translateX(100%) scale(0.95); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

.toast i { font-size: 16px; flex-shrink: 0; }
.toast.success { background: linear-gradient(135deg, #166534, #15803d); }
.toast.error { background: linear-gradient(135deg, #991b1b, #b91c1c); }
.toast.warning { background: linear-gradient(135deg, #78350f, #92400e); }

/* ═══════════════════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════════════════ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
  flex-direction: column;
  gap: 14px;
  color: #94a3b8;
}

.spinner {
  width: 40px; height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════ */
.tabs {
  display: flex;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
  gap: 4px;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  border-radius: 6px 6px 0 0;
  font-family: inherit;
}

.tab-btn:hover { color: #4f46e5; background: #f0f4ff; }
.tab-btn.active { color: #4f46e5; border-bottom-color: #4f46e5; font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   PDF PREVIEW
   ═══════════════════════════════════════════════════════ */
.pdf-preview {
  background: #fff;
  max-width: 740px;
  margin: 0 auto;
  padding: 48px;
  box-shadow: var(--shadow-md);
  border-radius: 4px;
}

.pdf-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.pdf-company-name { font-size: 22px; font-weight: 800; color: #1e40af; }
.pdf-title { font-size: 28px; font-weight: 800; color: #0f172a; text-align: right; }
.pdf-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.pdf-table th { background: #1e40af; color: #fff; padding: 10px 14px; text-align: left; font-size: 12px; }
.pdf-table td { padding: 9px 14px; border-bottom: 1px solid #e2e8f0; font-size: 13px; }
.pdf-table tr:nth-child(even) td { background: #f8fafc; }
.pdf-total { background: #eff6ff; font-weight: 700; }

/* ═══════════════════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,0.6);
  box-shadow: var(--shadow-sm);
}

.filter-select {
  padding: 8px 11px;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  font-size: 12.5px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

.filter-select:focus { border-color: #4f46e5; }

/* ═══════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0;
}

.page-btn {
  width: 34px; height: 34px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  color: #374151;
  font-family: inherit;
}

.page-btn:hover { border-color: #4f46e5; color: #4f46e5; }
.page-btn.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }

/* ═══════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════ */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #374151;
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: var(--transition);
}

.menu-toggle:hover { background: #f1f5f9; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.3); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .kanban-board { min-height: 400px; }
  .page-content { padding: 16px; }
  .filter-bar { padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .pdf-preview { padding: 24px; }
  .search-bar { width: 180px; }
  table { font-size: 12px; }
  tbody td, thead th { padding: 9px 10px; }
  .topbar { padding: 0 16px; }
  .login-body { padding: 24px; }
  .login-header { padding: 28px 24px 24px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .search-bar { width: 150px; }
}

/* ─── SIDEBAR OVERLAY ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

/* ═══════════════════════════════════════════════════════
   MISC UTILITIES
   ═══════════════════════════════════════════════════════ */
.text-muted { color: #94a3b8; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.gap-8 { gap: 8px; }
.gap-4 { gap: 4px; }
.flex-center { display: flex; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.justify-between { justify-content: space-between; }
.mb-4 { margin-bottom: 16px; }
.mb-2 { margin-bottom: 8px; }
.mt-4 { margin-top: 16px; }
.mt-2 { margin-top: 8px; }
.p-0 { padding: 0 !important; }

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
[data-tooltip]:hover::after { opacity: 1; }

/* ─── SECTION HEADERS ─── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.section-sub {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

/* ─── INFO ROW ─── */
.info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.info-row:last-child { border-bottom: none; }
.info-row .info-label { color: #64748b; font-weight: 500; min-width: 140px; flex-shrink: 0; }
.info-row .info-value { color: #1e293b; font-weight: 500; }

/* ─── SETTINGS ─── */
.settings-section {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(226,232,240,0.6);
  margin-bottom: 20px;
  overflow: hidden;
}

.settings-section-header {
  padding: 18px 22px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-section-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.settings-section-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.settings-section-header p {
  font-size: 12px;
  color: #64748b;
  margin-top: 1px;
}

.settings-section-body { padding: 22px; }

/* ─── DANGER ZONE ─── */
.danger-zone {
  background: #fff8f8;
  border: 1.5px solid #fecaca;
  border-radius: 14px;
  padding: 20px;
}

.danger-zone h3 { color: #dc2626; font-size: 14px; font-weight: 700; }
.danger-zone p { color: #7f1d1d; font-size: 12.5px; margin-top: 6px; margin-bottom: 14px; }

/* ─── HIGHLIGHT ─── */
.highlight-row { background: #fffbeb !important; }

/* ─── PRINT ─── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin-left: 0; }
  .pdf-preview { box-shadow: none; padding: 20px; }
  .modal-overlay { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; border-radius: 0; max-height: none; overflow: visible; }
  .modal-header, .modal-footer { display: none; }
  .modal-body { padding: 0; }
  body { background: white; }
}

/* ─── COLOR INPUT ─── */
input[type="color"] {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
  height: 40px;
  width: 60px;
}

/* ─── GRID HELPERS ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── WELCOME BANNER ─── */
.welcome-banner {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6d28d9 100%);
  border-radius: 16px;
  padding: 24px 28px;
  color: #fff;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  top: -100px; right: -50px;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  bottom: -80px; right: 200px;
}

.welcome-banner h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  position: relative; z-index: 1;
}

.welcome-banner p {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin-top: 4px;
  position: relative; z-index: 1;
}

.welcome-banner-right {
  display: flex;
  gap: 16px;
  position: relative; z-index: 1;
}

.welcome-stat {
  text-align: center;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px 20px;
  backdrop-filter: blur(4px);
}

.welcome-stat-value { font-size: 24px; font-weight: 800; }
.welcome-stat-label { font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 2px; }
