/* ============================================================
   Unavoidable Marketing CRM — App Styles
   Dark space theme: deep navy + purple/blue/pink neon
   Font: Rajdhani (headings) + DM Sans (body)
   ============================================================ */

:root {
  --bg-base:       #06061a;
  --bg-surface:    #0d0d2b;
  --bg-elevated:   #13133a;
  --bg-hover:      #1a1a45;
  --bg-input:      #0f0f30;

  --border:        rgba(139, 92, 246, 0.18);
  --border-hover:  rgba(139, 92, 246, 0.4);
  --border-strong: rgba(139, 92, 246, 0.6);

  --purple:        #8b5cf6;
  --purple-light:  #a78bfa;
  --blue:          #3b82f6;
  --blue-light:    #60a5fa;
  --pink:          #ec4899;
  --cyan:          #06b6d4;
  --green:         #10b981;
  --amber:         #f59e0b;
  --red:           #ef4444;

  --text-primary:  #e8e6f5;
  --text-secondary:#9b99b8;
  --text-muted:    #5a5878;

  --grad-primary:  linear-gradient(135deg, #7c3aed, #2563eb);
  --grad-accent:   linear-gradient(135deg, #8b5cf6, #3b82f6, #ec4899);

  --sidebar-w:     240px;
  --sidebar-collapsed: 60px;
  --topbar-h:      58px;
  --radius:        10px;
  --radius-lg:     14px;
  --radius-sm:     6px;

  --font-head:     'Rajdhani', sans-serif;
  --font-body:     'DM Sans', sans-serif;

  --transition:    .18s ease;
}

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

html { font-size: 15px; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,.3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,.6); }

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

.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .company-switcher,
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0 10px; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 0; }
.sidebar.collapsed .sidebar-toggle { display: flex; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}

.logo-mark { flex-shrink: 0; }

.logo-text { flex: 1; min-width: 0; }
.logo-primary {
  display: block;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .08em;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}
.logo-secondary {
  display: block;
  font-family: var(--font-head);
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .18em;
  color: var(--text-muted);
  line-height: 1;
}

.sidebar-toggle {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; border-radius: 4px;
  transition: color var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--purple-light); }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.company-switcher {
  margin: .5rem .75rem .25rem;
  padding: .5rem .65rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: default;
  transition: border-color .15s;
}
.cs-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.cs-value  { font-size: .85rem; color: var(--purple-light); font-weight: 500; }

.sidebar-nav {
  flex: 1;
  padding: .5rem 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 .75rem;
  height: 40px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 500;
  border-radius: 0;
  position: relative;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.nav-item.active {
  color: var(--purple-light);
  background: rgba(139,92,246,.1);
}
.nav-active-bar {
  position: absolute;
  right: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--grad-primary);
  border-radius: 2px 0 0 2px;
}
.nav-icon { display: flex; align-items: center; flex-shrink: 0; width: 18px; }
.nav-label { flex: 1; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: .75rem;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: .4rem .2rem;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.user-name { font-size: .85rem; font-weight: 500; color: var(--text-primary); line-height: 1.2; }
.user-role { font-size: .7rem; color: var(--text-muted); text-transform: capitalize; }
.logout-btn {
  margin-left: auto;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
  flex-shrink: 0;
}
.logout-btn:hover { color: var(--red); }

/* ============================================================
   MAIN WRAP
   ============================================================ */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
.sidebar.collapsed ~ .main-wrap { margin-left: var(--sidebar-collapsed); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 1rem;
}
.topbar-left { display: flex; align-items: center; gap: .75rem; }
.page-title {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: .02em;
}
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.topbar-time { font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.mobile-menu-btn {
  display: none;
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 4px;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1600px;
  width: 100%;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-primary);
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-primary);
  opacity: .7;
}
.stat-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .4rem; }
.stat-value { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-sub   { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }
.stat-trend-up   { color: var(--green); }
.stat-trend-down { color: var(--red); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.btn-primary {
  background: var(--grad-primary);
  color: #fff;
}
.btn-primary:hover { opacity: .85; }

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

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

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

.btn-sm { padding: .35rem .7rem; font-size: .8rem; }
.btn-icon { padding: .45rem; border-radius: var(--radius-sm); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: .6rem .8rem;
  font-family: var(--font-body);
  font-size: .9rem;
  outline: none;
  transition: border var(--transition);
  appearance: none;
}
.form-control:focus { border-color: var(--purple); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
thead th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  padding: .75rem 1rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid rgba(139,92,246,.07);
  transition: background var(--transition);
}
tbody tr:hover { background: var(--bg-hover); }
tbody td {
  padding: .7rem 1rem;
  color: var(--text-primary);
  vertical-align: middle;
}
tbody td.muted { color: var(--text-muted); }

.table-check { width: 32px; }
input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--purple);
  cursor: pointer;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .55rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
}
.badge-hot      { background: rgba(239,68,68,.15);   color: #f87171; }
.badge-warm     { background: rgba(245,158,11,.15);  color: #fbbf24; }
.badge-cold     { background: rgba(99,102,241,.15);  color: #818cf8; }
.badge-won      { background: rgba(16,185,129,.15);  color: #34d399; }
.badge-lost     { background: rgba(239,68,68,.15);   color: #f87171; }
.badge-active   { background: rgba(59,130,246,.15);  color: #60a5fa; }
.badge-paused   { background: rgba(245,158,11,.15);  color: #fbbf24; }
.badge-draft    { background: rgba(107,114,128,.15); color: #9ca3af; }
.badge-purple   { background: rgba(139,92,246,.15);  color: #c4b5fd; }
.badge-green    { background: rgba(16,185,129,.15);  color: #34d399; }

/* Pipeline stage badges */
.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
}
.stage-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================================
   PIPELINE KANBAN
   ============================================================ */
.kanban-board {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  padding-bottom: 1.5rem;
  align-items: flex-start;
  min-height: calc(100vh - 160px);
}
.kanban-col {
  flex: 0 0 240px;
  min-width: 240px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 160px);
}
.kanban-col-header {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kanban-col-title {
  font-family: var(--font-head);
  font-size: .9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.kanban-col-count {
  font-size: .75rem;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: .1rem .45rem;
  border-radius: 99px;
}
.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}
.kanban-card:hover {
  border-color: var(--purple);
  transform: translateY(-1px);
}
.kanban-card.dragging {
  opacity: .5;
  transform: rotate(2deg);
}
.kanban-col.drag-over {
  border-color: var(--purple);
  background: rgba(139,92,246,.06);
}
.kanban-card-name { font-weight: 500; font-size: .9rem; margin-bottom: .3rem; }
.kanban-card-meta { font-size: .75rem; color: var(--text-muted); }
.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .5rem;
}
.kanban-add-btn {
  width: 100%;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .8rem;
  padding: .4rem;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: .3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
}
.kanban-add-btn:hover {
  border-color: var(--purple);
  color: var(--purple-light);
  background: rgba(139,92,246,.06);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(6,6,26,.8);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
}
.modal-close {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  padding: 4px; border-radius: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--red); }
.modal-body { padding: 1.4rem; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  padding: .9rem 1.4rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: .7rem 1rem;
  min-width: 240px;
  max-width: 380px;
  pointer-events: all;
  transform: translateX(120%);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  font-size: .875rem;
}
.toast.show { transform: translateX(0); }
.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }
.toast.warning { border-left: 3px solid var(--amber); }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tab-btn {
  background: none; border: none;
  padding: .6rem 1rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--purple-light); border-bottom-color: var(--purple); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .4rem .75rem;
  transition: border var(--transition);
}
.search-bar:focus-within { border-color: var(--purple); }
.search-bar svg { color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: .875rem;
  width: 220px;
}
.search-bar input::placeholder { color: var(--text-muted); }

/* ============================================================
   FILTER ROW
   ============================================================ */
.filter-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.pagination-btns { display: flex; gap: .3rem; }
.pagination-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: .35rem .65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .8rem;
  transition: all var(--transition);
}
.pagination-btn:hover { border-color: var(--purple); color: var(--purple-light); }
.pagination-btn.active { background: var(--grad-primary); border-color: transparent; color: #fff; }
.pagination-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  color: var(--text-muted);
}
.empty-title { font-family: var(--font-head); font-size: 1rem; color: var(--text-secondary); margin-bottom: .5rem; }
.empty-desc  { font-size: .85rem; max-width: 280px; line-height: 1.5; }

/* ============================================================
   ACTIVITY TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 1.1rem;
}
.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 3px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--purple);
}
.timeline-title { font-size: .875rem; font-weight: 500; margin-bottom: .2rem; }
.timeline-time  { font-size: .75rem; color: var(--text-muted); }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress {
  height: 4px;
  background: var(--bg-hover);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 99px;
  transition: width .4s ease;
}

/* ============================================================
   UTILITY
   ============================================================ */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: .75rem; }
.gap-3 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: .75rem; }
.mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: .75rem; }
.mb-3 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .8rem; }
.text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.12) 0%, transparent 70%);
  top: -200px; left: -100px;
  pointer-events: none;
}
.login-wrap::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.1) 0%, transparent 70%);
  bottom: -200px; right: -100px;
  pointer-events: none;
}
.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2rem;
}
.login-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .06em;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-sub { font-size: .8rem; color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase; }
.login-heading { font-family: var(--font-head); font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 1.5rem; }

.alert {
  padding: .65rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  margin-bottom: 1rem;
}
.alert-error   { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.alert-info    { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    transition: transform var(--transition);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrap { margin-left: 0 !important; }
  .mobile-menu-btn { display: block; }
  .topbar { padding: 0 1rem; }
  .page-content { padding: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .kanban-board { flex-direction: column; }
  .kanban-col { flex: none; width: 100%; max-height: none; }
}

/* Collapsed sidebar re-open trigger */
.sidebar.collapsed { overflow: visible; }
.sidebar.collapsed .sidebar-footer { display: none; }
.sidebar-collapsed-handle {
  display: none;
  position: fixed;
  left: var(--sidebar-collapsed);
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 48px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 100;
  color: var(--text-muted);
  transition: background .15s;
}
.sidebar-collapsed-handle:hover { background: var(--purple); color: white; }
