:root {
  --brand: #165f49;
  --brand-dark: #0e4433;
  --bg: #f5f5f4;
  --sidebar: #0c0c0c;
}
body {
  background: var(--bg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.925rem;
}
.font-display { font-family: 'Space Grotesk', 'Inter', sans-serif; }
.text-brand { color: var(--brand) !important; }
.btn-brand {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-color: #fff;
}
.btn-outline-brand {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand-dark);
}
.border-white-10 { border-color: rgba(255,255,255,.1) !important; }

/* Sidebar */
.crm-sidebar {
  position: fixed; inset: 0 auto 0 0; width: 240px;
  background: var(--sidebar); color: #fff; z-index: 1040;
}
.crm-topbar { background: var(--sidebar); }
.sidebar-sub {
  font-size: .65rem; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.4);
}
.crm-nav-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .75rem; border-radius: .375rem; margin-bottom: .125rem;
  color: rgba(255,255,255,.6); text-decoration: none; font-size: .9rem;
  transition: background .15s, color .15s;
}
.crm-nav-link:hover { color: #fff; background: rgba(255,255,255,.1); }
.crm-nav-link.active { background: var(--brand); color: #fff; font-weight: 500; }
.avatar-circle {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
}
.icon-btn {
  border: 0; background: transparent; color: rgba(255,255,255,.5);
  padding: .4rem; border-radius: .375rem; line-height: 1;
}
.icon-btn:hover { color: #fff; background: rgba(255,255,255,.1); }

/* Main */
.crm-main { min-height: 100vh; }
@media (min-width: 992px) { .crm-main { padding-left: 240px; } }

/* Sections & stats */
.section-label {
  font-size: .72rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: #78716c;
}
.stat-label {
  font-size: .68rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: #78716c; margin-bottom: .25rem;
}
.card { border-color: #e7e5e1; border-radius: .5rem; }

/* KPI héro */
.kpi-hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; border-radius: .5rem;
}
.kpi-hero .stat-label { color: rgba(255,255,255,.75); }

/* Filtres période */
.period-switch .btn { font-size: .78rem; }
.period-switch .btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Barres pipeline / entonnoir */
.bar-track { height: 20px; background: #ececea; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; }

/* Tâches */
.task-check {
  width: 26px; height: 26px; border: 2px solid #c8c5c0; border-radius: 7px;
  background: #fff; color: transparent; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s; cursor: pointer; padding: 0;
}
.task-check:hover { border-color: var(--brand); background: #165f4915; color: var(--brand); }
.task-row-overdue { background: #fef2f2; }

/* Kanban */
.kanban-col { min-width: 250px; width: 250px; flex-shrink: 0; }
.kanban-drop { min-height: 80px; }
.kanban-drop.dragover { outline: 2px dashed var(--brand); outline-offset: -2px; background: #165f4908; }
.kanban-card { cursor: grab; }
.kanban-card:active { cursor: grabbing; }

/* Pastilles type d'action */
.type-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  border-radius: 999px; padding: .1rem .55rem;
  font-size: .68rem; font-weight: 500; color: #fff;
}

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 400px; }

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
.table { --bs-table-bg: transparent; }

/* Libellés de formulaire compacts (style CRM) */
.form-label-crm {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #57534e;
  margin-bottom: 0.25rem;
}
