/* ============================================
   GROWSKILL CRM - Main Stylesheet
   Design: Deep navy + electric teal + white
   Font: Inter (utility) + Syne (display)
============================================ */

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

/* ---- CSS Variables ---- */
:root {
  --navy:       #0D1B2A;
  --navy-2:     #162233;
  --navy-3:     #1E2F42;
  --teal:       #00C8A0;
  --teal-dark:  #00A882;
  --teal-light: #D6FBF3;
  --white:      #FFFFFF;
  --gray-50:    #F7F9FC;
  --gray-100:   #EEF2F7;
  --gray-200:   #D9E2EE;
  --gray-400:   #8FA3BC;
  --gray-600:   #4D6680;
  --gray-800:   #1A2E42;
  --danger:     #EF4444;
  --warning:    #F59E0B;
  --success:    #10B981;
  --info:       #3B82F6;

  /* Status Colors */
  --lead:       #8B5CF6;
  --contacted:  #3B82F6;
  --qualified:  #F59E0B;
  --proposal:   #EC4899;
  --won:        #10B981;
  --lost:       #EF4444;

  --sidebar-w:  240px;
  --topbar-h:   64px;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 4px rgba(13,27,42,.08);
  --shadow:     0 4px 16px rgba(13,27,42,.12);
  --shadow-lg:  0 8px 32px rgba(13,27,42,.18);
  --transition: .2s cubic-bezier(.4,0,.2,1);
}

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

html { font-size: 15px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--gray-50);
  color: var(--navy);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================
   LOGIN PAGE
============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--navy);
  overflow: hidden;
}

.login-left {
  flex: 1;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 60%, #0a3d2e 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,160,.15) 0%, transparent 70%);
  top: -100px; left: -100px;
}

.login-left::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,160,.10) 0%, transparent 70%);
  bottom: -80px; right: -80px;
}

.login-brand {
  position: relative; z-index: 1;
  text-align: center;
}

.login-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-family: 'Syne', sans-serif;
  font-size: 28px; font-weight: 800;
  color: var(--white);
  box-shadow: 0 8px 24px rgba(0,200,160,.4);
}

.login-brand h1 {
  font-family: 'Syne', sans-serif;
  font-size: 2.4rem; font-weight: 800;
  color: var(--white);
  line-height: 1.1;
}

.login-brand h1 span { color: var(--teal); }

.login-brand p {
  color: var(--gray-400);
  margin-top: 12px;
  font-size: .95rem;
}

.login-features {
  position: relative; z-index: 1;
  margin-top: 56px;
  display: flex; flex-direction: column; gap: 20px;
}

.lf-item {
  display: flex; align-items: center; gap: 14px;
}

.lf-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  background: rgba(0,200,160,.12);
  border: 1px solid rgba(0,200,160,.25);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--teal);
  font-size: 18px;
}

.lf-text strong { display: block; color: var(--white); font-size: .9rem; }
.lf-text span { color: var(--gray-400); font-size: .8rem; }

.login-right {
  width: 480px;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 56px;
}

.login-form-wrap { width: 100%; }

.login-form-wrap h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.9rem; font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.login-form-wrap .subtitle {
  color: var(--gray-600);
  font-size: .9rem;
  margin-bottom: 36px;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: .83rem; font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 7px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .93rem;
  color: var(--navy);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,200,160,.12);
}

.input-icon-wrap { position: relative; }
.input-icon-wrap input { padding-left: 42px; }
.input-icon-wrap .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); font-size: 16px;
  pointer-events: none;
}

.pass-toggle {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  color: var(--gray-400); font-size: 15px;
  cursor: pointer;
}

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

.checkbox-wrap {
  display: flex; align-items: center; gap: 8px;
  font-size: .87rem; color: var(--gray-600);
  cursor: pointer;
}

.checkbox-wrap input { width: auto; }

.link { color: var(--teal); font-weight: 600; font-size: .87rem; }
.link:hover { color: var(--teal-dark); }

.role-select-row {
  display: flex; gap: 10px; margin-bottom: 20px;
}

.role-option {
  flex: 1;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: .82rem;
  color: var(--gray-600);
}

.role-option.active {
  border-color: var(--teal);
  background: var(--teal-light);
  color: var(--teal-dark);
  font-weight: 600;
}

.role-option i { display: block; font-size: 20px; margin-bottom: 4px; }

/* ============================================
   BUTTONS
============================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: .88rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(0,200,160,.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,200,160,.45);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-800);
  border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover { background: var(--gray-200); }

.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
}

.btn-outline:hover { background: var(--teal-light); }

.btn-danger {
  background: rgba(239,68,68,.1);
  color: var(--danger);
  border: 1.5px solid rgba(239,68,68,.25);
}

.btn-danger:hover { background: rgba(239,68,68,.18); }

.btn-lg { padding: 13px 28px; font-size: .95rem; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

/* ============================================
   LAYOUT - SIDEBAR + CONTENT
============================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

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

.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 14px;
  color: var(--white);
  flex-shrink: 0;
}

.sidebar-logo-text strong {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: .95rem; font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.sidebar-logo-text span {
  font-size: .72rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: .5px;
}

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

.nav-section-label {
  font-size: .68rem; font-weight: 700;
  color: var(--gray-400); text-transform: uppercase; letter-spacing: 1px;
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--gray-400);
  font-size: .87rem; font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}

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

.nav-item:hover { background: rgba(255,255,255,.06); color: var(--white); }

.nav-item.active {
  background: rgba(0,200,160,.15);
  color: var(--teal);
}

.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--teal);
  border-radius: 0 2px 2px 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--teal);
  color: var(--white);
  font-size: .68rem; font-weight: 700;
  padding: 1px 7px; border-radius: 20px;
  min-width: 20px; text-align: center;
}

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

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

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

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), #0099CC);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: var(--white);
  flex-shrink: 0;
}

.user-info strong { display: block; font-size: .83rem; color: var(--white); }
.user-info span { font-size: .73rem; color: var(--gray-400); }

.user-menu-btn { margin-left: auto; color: var(--gray-400); font-size: 14px; }

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center;
  padding: 0 28px;
  position: fixed; top: 0;
  left: var(--sidebar-w); right: 0;
  z-index: 90;
  gap: 16px;
}

.topbar-title h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem; font-weight: 700;
  color: var(--navy);
}

.topbar-title p { font-size: .78rem; color: var(--gray-400); }

.topbar-search {
  flex: 1; max-width: 380px; margin-left: 24px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--gray-200);
  border-radius: 40px;
  font-size: .85rem;
  outline: none;
  transition: border-color var(--transition);
  background: var(--gray-50);
}

.topbar-search input:focus {
  border-color: var(--teal);
  background: var(--white);
}

.topbar-search i {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); font-size: 15px;
}

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

.topbar-btn {
  width: 38px; height: 38px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-600);
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.topbar-btn:hover { border-color: var(--teal); color: var(--teal); }

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

.topbar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), #0099CC);
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700; color: var(--white);
  cursor: pointer;
  border: 2px solid var(--teal-light);
}

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ============================================
   CARDS & PANELS
============================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem; font-weight: 700;
  color: var(--navy);
}

.card-subtitle { font-size: .8rem; color: var(--gray-400); margin-top: 2px; }

.card-body { padding: 22px; }

/* ============================================
   STAT CARDS (DASHBOARD)
============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden;
}

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

.stat-card.teal::after { background: var(--teal); }
.stat-card.purple::after { background: var(--lead); }
.stat-card.orange::after { background: var(--warning); }
.stat-card.green::after { background: var(--success); }
.stat-card.red::after { background: var(--danger); }
.stat-card.blue::after { background: var(--info); }

.stat-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.stat-icon.teal { background: rgba(0,200,160,.12); color: var(--teal); }
.stat-icon.purple { background: rgba(139,92,246,.12); color: var(--lead); }
.stat-icon.orange { background: rgba(245,158,11,.12); color: var(--warning); }
.stat-icon.green { background: rgba(16,185,129,.12); color: var(--success); }
.stat-icon.red { background: rgba(239,68,68,.12); color: var(--danger); }
.stat-icon.blue { background: rgba(59,130,246,.12); color: var(--info); }

.stat-info { flex: 1; min-width: 0; }
.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.7rem; font-weight: 700;
  color: var(--navy); line-height: 1;
}

.stat-label { font-size: .8rem; color: var(--gray-600); margin-top: 4px; }

.stat-trend {
  font-size: .75rem; font-weight: 600;
  display: flex; align-items: center; gap: 3px;
  margin-top: 6px;
}

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

/* ============================================
   STATUS BADGES
============================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .75rem; font-weight: 600;
  white-space: nowrap;
}

.badge-lead      { background: rgba(139,92,246,.12); color: var(--lead); }
.badge-contacted { background: rgba(59,130,246,.12); color: var(--contacted); }
.badge-qualified { background: rgba(245,158,11,.12); color: var(--warning); }
.badge-proposal  { background: rgba(236,72,153,.12); color: var(--proposal); }
.badge-won       { background: rgba(16,185,129,.12); color: var(--success); }
.badge-lost      { background: rgba(239,68,68,.12); color: var(--danger); }

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

/* Role badges */
.badge-admin      { background: rgba(0,200,160,.12); color: var(--teal-dark); }
.badge-sales      { background: rgba(59,130,246,.12); color: var(--info); }
.badge-viewer     { background: rgba(77,102,128,.12); color: var(--gray-600); }
.badge-superadmin { background: rgba(139,92,246,.12); color: var(--lead); }

/* ============================================
   DATA TABLE
============================================ */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%; border-collapse: collapse;
  font-size: .85rem;
}

.data-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: .75rem; font-weight: 700;
  color: var(--gray-400); text-transform: uppercase; letter-spacing: .5px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--navy);
  vertical-align: middle;
}

.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

.table-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), #0099CC);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: var(--white);
  flex-shrink: 0;
}

.contact-name-cell { display: flex; align-items: center; gap: 10px; }
.contact-name-cell .name { font-weight: 600; }
.contact-name-cell .email { font-size: .78rem; color: var(--gray-400); }

.table-actions { display: flex; gap: 6px; }

/* Checkbox */
.table-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: var(--teal); }

/* ============================================
   PIPELINE BOARD
============================================ */
.pipeline-board {
  display: flex; gap: 16px;
  overflow-x: auto; padding-bottom: 16px;
  align-items: flex-start;
}

.pipeline-col {
  flex: 0 0 260px;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.pipeline-col-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .87rem; font-weight: 700;
  color: var(--navy);
}

.pipeline-col-title .dot {
  width: 10px; height: 10px; border-radius: 50%;
}

.col-count {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  font-size: .72rem; font-weight: 700; color: var(--gray-600);
  padding: 1px 8px;
}

.pipeline-cards { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 100px; }

.pipeline-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  cursor: grab;
  transition: box-shadow var(--transition), transform var(--transition);
}

.pipeline-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.pipeline-card.dragging { opacity: .5; }

.pc-name { font-weight: 600; font-size: .88rem; color: var(--navy); }
.pc-company { font-size: .77rem; color: var(--gray-400); margin-top: 2px; }

.pc-meta {
  margin-top: 10px; display: flex; align-items: center; justify-content: space-between;
}

.pc-assignee { display: flex; align-items: center; gap: 6px; font-size: .77rem; color: var(--gray-600); }

.pc-assignee .mini-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--lead), #6D28D9);
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 700; color: var(--white);
}

.pc-date { font-size: .73rem; color: var(--gray-400); }

/* ============================================
   CONTACT DETAIL / TIMELINE
============================================ */
.detail-header {
  display: flex; align-items: flex-start; gap: 20px;
  margin-bottom: 24px;
}

.detail-avatar {
  width: 60px; height: 60px; flex-shrink: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--teal), #0099CC);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem; font-weight: 700; color: var(--white);
}

.detail-info h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem; font-weight: 700;
}

.detail-info .detail-meta { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.detail-info .detail-meta span { font-size: .82rem; color: var(--gray-600); display: flex; align-items: center; gap: 4px; }

.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: flex; gap: 14px;
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.tl-line {
  display: flex; flex-direction: column; align-items: center;
}

.tl-dot {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--teal-light);
  border: 2px solid var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--teal);
  z-index: 1;
}

.tl-connector {
  flex: 1; width: 2px;
  background: var(--gray-200);
  margin-top: 4px;
}

.tl-content {
  flex: 1; padding-top: 4px;
}

.tl-content .tl-title { font-weight: 600; font-size: .87rem; }
.tl-content .tl-desc { font-size: .82rem; color: var(--gray-600); margin-top: 3px; }
.tl-content .tl-time { font-size: .75rem; color: var(--gray-400); margin-top: 4px; }
.tl-content .tl-comment {
  margin-top: 8px; padding: 10px 14px;
  background: var(--gray-50); border-radius: var(--radius);
  border-left: 3px solid var(--teal);
  font-size: .83rem; color: var(--gray-800);
  font-style: italic;
}

/* ============================================
   MODAL
============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(13,27,42,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}

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

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(20px) scale(.97);
  transition: transform var(--transition);
}

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

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-header h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem; font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  background: var(--gray-100); border: none;
  border-radius: var(--radius); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--gray-600);
  transition: background var(--transition);
}

.modal-close:hover { background: var(--gray-200); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ============================================
   FILTERS BAR
============================================ */
.filters-bar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 18px;
}

.filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .83rem; color: var(--gray-800);
  background: var(--white); outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.filter-select:focus { border-color: var(--teal); }

.search-input-inline {
  padding: 8px 14px 8px 36px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .83rem; outline: none;
  width: 220px;
  background: var(--white);
  transition: border-color var(--transition);
  position: relative;
}

.search-input-inline:focus { border-color: var(--teal); }

.search-wrap { position: relative; }
.search-wrap i {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); font-size: 14px; pointer-events: none;
}

/* ============================================
   UPLOAD ZONE
============================================ */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  background: var(--gray-50);
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--teal);
  background: var(--teal-light);
}

.upload-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: rgba(0,200,160,.12); color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin: 0 auto 14px;
}

.upload-zone h4 { font-size: .95rem; font-weight: 600; color: var(--navy); }
.upload-zone p { font-size: .82rem; color: var(--gray-400); margin-top: 5px; }
.upload-zone .formats { margin-top: 12px; display: flex; gap: 8px; justify-content: center; }
.format-tag {
  padding: 3px 10px; border-radius: 20px;
  background: var(--white); border: 1px solid var(--gray-200);
  font-size: .75rem; font-weight: 600; color: var(--gray-600);
}

/* ============================================
   SETTINGS SECTION
============================================ */
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}

.settings-nav { display: flex; flex-direction: column; gap: 2px; }

.settings-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  font-size: .87rem; font-weight: 500; color: var(--gray-600);
  cursor: pointer; transition: all var(--transition);
}

.settings-nav-item:hover { background: var(--gray-100); color: var(--navy); }
.settings-nav-item.active { background: var(--teal-light); color: var(--teal-dark); font-weight: 600; }
.settings-nav-item i { font-size: 16px; width: 18px; }

/* ============================================
   FORM GRID
============================================ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

.form-section-title {
  font-family: 'Syne', sans-serif;
  font-size: .87rem; font-weight: 700; color: var(--teal-dark);
  text-transform: uppercase; letter-spacing: .5px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 16px; margin-top: 8px;
}

/* ============================================
   ALERTS / TOASTS
============================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px;
  font-size: .85rem; font-weight: 500;
  margin-bottom: 16px;
}

.alert-success { background: rgba(16,185,129,.10); color: var(--success); border: 1px solid rgba(16,185,129,.25); }
.alert-warning { background: rgba(245,158,11,.10); color: var(--warning); border: 1px solid rgba(245,158,11,.25); }
.alert-error   { background: rgba(239,68,68,.10); color: var(--danger); border: 1px solid rgba(239,68,68,.25); }
.alert-info    { background: rgba(59,130,246,.10); color: var(--info); border: 1px solid rgba(59,130,246,.25); }

/* ============================================
   CHART AREA PLACEHOLDER
============================================ */
.chart-placeholder {
  height: 220px;
  background: var(--gray-50);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400); font-size: .9rem;
  border: 1px dashed var(--gray-200);
}

/* ============================================
   PAGINATION
============================================ */
.pagination {
  display: flex; align-items: center; gap: 6px;
  justify-content: center; margin-top: 20px;
}

.page-btn {
  width: 34px; height: 34px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: .83rem; font-weight: 600;
  color: var(--gray-600); cursor: pointer;
  transition: all var(--transition);
}

.page-btn:hover { border-color: var(--teal); color: var(--teal); }
.page-btn.active { background: var(--teal); border-color: var(--teal); color: var(--white); }

/* ============================================
   UTILITY
============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.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; }
.text-sm { font-size: .82rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--gray-400); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-600 { font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

.page { display: none; }
.page.active { display: block; }

/* ============================================
   EMPTY STATE
============================================ */
.empty-state {
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  width: 72px; height: 72px;
  background: var(--gray-100); border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--gray-400);
  margin: 0 auto 16px;
}

.empty-state h4 { font-size: 1rem; font-weight: 600; color: var(--navy); }
.empty-state p { font-size: .85rem; color: var(--gray-400); margin-top: 6px; max-width: 300px; margin-left: auto; margin-right: auto; }

/* ============================================
   SCROLLBAR STYLE
============================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); --sidebar-w: 240px; }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: flex !important; }
  .settings-layout { grid-template-columns: 1fr; }
}

.mobile-menu-btn { display: none; }

@media (max-width: 768px) {
  .login-left { display: none; }
  .login-right { width: 100%; padding: 40px 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .pipeline-board { flex-direction: column; }
  .pipeline-col { flex: none; width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
}
