:root {
  --brand: #4338ca;
  --brand-dark: #312e81;
  --sidebar-w: 250px;
}

body {
  background: #f4f6fb;
  font-family: 'Segoe UI', Arial, sans-serif;
}

.wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--brand-dark), var(--brand));
  color: #fff;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 1000;
  transition: transform .2s ease;
}
.sidebar-brand {
  padding: 16px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-logo {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  background: #fff;
  flex-shrink: 0;
}
.company-logo-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.theme-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e5e7eb;
}
.sidebar .nav-link {
  color: rgba(255,255,255,.85);
  padding: 10px 18px;
  font-size: .93rem;
  border-left: 3px solid transparent;
}
.sidebar .nav-link i { margin-right: 8px; width: 18px; display: inline-block; }
.sidebar .nav-link:hover, .sidebar .nav-link.active {
  background: rgba(255,255,255,.12);
  border-left-color: #fff;
  color: #fff;
}
.sidebar .nav-heading {
  display: block;
  padding: 10px 18px 4px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255,255,255,.55);
}

/* Main content */
.main-content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.top-navbar { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 8px 16px; }
.page-body { padding: 22px; }

@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* Stat cards */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  border-left: 4px solid var(--brand);
  height: 100%;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-card .stat-label { color: #6b7280; font-size: .85rem; }
.stat-card .stat-icon { font-size: 1.8rem; opacity: .25; }

.card { border: none; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f4; font-weight: 600; border-radius: 12px 12px 0 0 !important; }

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}
.login-card { max-width: 400px; width: 100%; border-radius: 14px; }

/* Kanban board */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.kanban-column {
  background: #eef1f8;
  border-radius: 10px;
  min-width: 270px;
  max-width: 270px;
  flex-shrink: 0;
  padding: 10px;
}
.kanban-column-header {
  font-weight: 600;
  padding: 6px 8px 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.kanban-cards { min-height: 60px; }
.kanban-card {
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  cursor: grab;
  border-left: 4px solid #6c757d;
}
.kanban-card.dragging { opacity: .4; }
.kanban-card small { color: #6b7280; }
.kanban-column.drag-over { background: #dde3f5; }

.badge-status-open { background: #0d6efd; }
.badge-status-won { background: #198754; }
.badge-status-lost { background: #dc3545; }

table.dt th { white-space: nowrap; }
