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

:root {
  /* Layout */
  --sidebar-w: 285px;
  --topbar-h: 74px;
  --r:    14px;
  --r-sm: 10px;
  --r-xs: 6px;
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.09), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.07);

  /* Sidebar (dark) */
  --sb-bg:       #1a2236;
  --sb-border:   rgba(255,255,255,0.07);
  --sb-text:     #8b97b0;
  --sb-text-act: #e8edf5;
  --sb-hover:    rgba(255,255,255,0.05);
  --sb-active:   rgba(255,255,255,0.09);

  /* Main (light) */
  --bg:       #f0f2f5;
  --bg-2:     #ffffff;
  --bg-3:     #f7f8fa;
  --bg-card:  #ffffff;
  --bg-hover: rgba(0,0,0,0.03);
  --border:   #e4e7ec;
  --border-h: #c9d0db;

  /* Typography */
  --text:   #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;

  /* Brand accent */
  --accent:   #1d4ed8;
  --accent-2: #3b82f6;
  --accent-g: rgba(29,78,216,0.08);

  /* Status colors */
  --green:      #15803d;
  --green-bg:   rgba(21,128,61,0.08);
  --green-text: #166534;
  --orange:     #b45309;
  --orange-bg:  rgba(180,83,9,0.08);
  --red:        #b91c1c;
  --red-bg:     rgba(185,28,28,0.08);
  --blue:       #1d4ed8;
  --blue-bg:    rgba(29,78,216,0.08);
  --purple:     #6d28d9;
  --purple-bg:  rgba(109,40,217,0.08);
  --pink:       #be185d;
  --pink-bg:    rgba(190,24,93,0.08);

  /* Category colors */
  --c-vente:    #15803d;
  --c-demen:    #b45309;
  --c-colis:    #1d4ed8;
  --c-formal:   #6d28d9;
}

html { font-size: 16px; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; overflow: hidden; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── SIDEBAR ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}

.sidebar-logo {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 1.4rem 1.1rem 1.1rem;
  border-bottom: 1px solid var(--sb-border);
}
.logo-mark {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(59,130,246,0.4);
}
.logo-img {
  width: 128px; height: 128px;
  border-radius: 28px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.25);
}
.logo-text  { display: flex; flex-direction: column; align-items: center; text-align: center; }
.logo-title { font-weight: 700; font-size: 15.5px; color: var(--sb-text-act); line-height: 1.2; }
.logo-sub   { font-size: 12px; color: var(--sb-text); margin-top: 2px; }

.sidebar-nav {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0.6rem 0.7rem; flex: 1; overflow-y: auto;
}
.nav-section-label {
  font-size: 10.5px; font-weight: 700; color: #4b5a72;
  text-transform: uppercase; letter-spacing: 0.09em;
  padding: 1rem 0.6rem 0.3rem;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r);
  border: none; background: transparent;
  color: var(--sb-text); font-family: inherit; font-size: 14.5px; font-weight: 500;
  cursor: pointer; transition: all 0.13s; text-align: left; width: 100%;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { background: var(--sb-hover); color: var(--sb-text-act); }
.nav-item.active { background: var(--sb-active); color: #fff; }
.nav-item.active svg { stroke: #fff; }

.nav-badge {
  margin-left: auto; background: var(--accent-2); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 7px;
  border-radius: 20px; min-width: 20px; text-align: center; display: none;
}
.nav-badge.visible { display: block; }

.sidebar-footer {
  padding: 0.75rem 1rem; border-top: 1px solid var(--sb-border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sidebar-stats { font-size: 13.5px; color: var(--sb-text); flex: 1; line-height: 1.7; }
.btn-icon-sm {
  background: none; border: none; cursor: pointer;
  color: #5a6a84; padding: 6px; border-radius: 4px; transition: all 0.13s; display: flex;
}
.btn-icon-sm:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
.btn-icon-sm svg { width: 21px; height: 21px; }

/* ── MAIN ────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w); flex: 1;
  display: flex; flex-direction: column; min-height: 100vh; overflow: hidden;
}

/* ── TOPBAR ──────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.75rem; gap: 1rem;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-xs);
}
.topbar-left { display: flex; align-items: baseline; gap: 0.75rem; }
.page-title { font-size: 21px; font-weight: 700; color: var(--text); white-space: nowrap; }
.topbar-desc { font-size: 13.5px; color: var(--text-3); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.search-wrap {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 5px 11px;
  transition: border-color 0.15s;
  position: relative;
}
.search-wrap:focus-within { border-color: var(--accent); }
.search-wrap > svg { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.search-wrap input {
  background: none; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 14px; width: 200px;
}
.search-wrap input::placeholder { color: var(--text-3); }

.btn-new {
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, var(--accent), #2563eb); color: #fff; border: none;
  border-radius: 12px; padding: 9px 18px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(29,78,216,0.35);
}
.btn-new svg { width: 15px; height: 15px; }
.btn-new:hover { background: linear-gradient(135deg, #1e40af, #1d4ed8); box-shadow: 0 4px 14px rgba(29,78,216,0.45); transform: translateY(-1px); }

/* ── TAB CONTENT ─────────────────────────────────────────────────── */
.tab-content { display: none; overflow-y: auto; height: calc(100vh - var(--topbar-h)); }
.tab-content.active { display: flex; flex-direction: column; }

.tab-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.75rem 0.6rem; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.tab-desc { font-size: 13px; color: var(--text-3); }
.btn-new-sm {
  display: flex; align-items: center; gap: 5px;
  background: var(--accent-g); color: var(--accent);
  border: 1px solid rgba(29,78,216,0.2);
  border-radius: var(--r); padding: 7px 14px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.13s; white-space: nowrap;
}
.btn-new-sm:hover { background: rgba(29,78,216,0.13); }

/* ── KANBAN ──────────────────────────────────────────────────────── */
.kanban-board {
  display: flex; gap: 10px;
  padding: 1.25rem 1.75rem 2rem;
  overflow-x: auto; flex: 1; align-items: flex-start;
  background: var(--bg);
}

.kanban-col { flex-shrink: 0; width: 295px; display: flex; flex-direction: column; }

.kanban-col-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r) var(--r) 0 0;
  background: var(--bg-2);
  border: 1px solid var(--border); border-bottom: none;
}
.kanban-col-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.kanban-col-title { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; }
.kanban-col-count {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  background: var(--bg-3); border: 1px solid var(--border);
  padding: 1px 7px; border-radius: 2px;
}

.kanban-col-body {
  display: flex; flex-direction: column; gap: 6px; padding: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border); border-top: none; border-bottom: none;
  min-height: 80px;
}

.kanban-col-footer {
  padding: 5px; border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--r) var(--r); background: var(--bg-3);
}
.btn-add-in-col {
  width: 100%; background: none; border: 1px dashed var(--border);
  border-radius: var(--r-sm); padding: 5px;
  color: var(--text-3); font-family: inherit; font-size: 11.5px;
  cursor: pointer; transition: all 0.13s;
}
.btn-add-in-col:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-g); }

.kanban-empty { padding: 1rem 0.5rem; text-align: center; color: var(--text-3); font-size: 11px; }

/* ── PROJECT CARD ────────────────────────────────────────────────── */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 11px;
  cursor: pointer; transition: all 0.15s;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.project-card:hover { border-color: var(--border-h); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.project-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
}
.project-card.priority-high::before   { background: var(--red); }
.project-card.priority-normal::before { background: var(--orange); }
.project-card.priority-low::before    { background: var(--green); }

.card-title {
  font-size: 14.5px; font-weight: 600; color: var(--text);
  margin-bottom: 3px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-subtitle { font-size: 12px; color: var(--text-2); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.card-meta-item { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 3px; }
.card-meta-item svg { width: 11px; height: 11px; }
.card-meta-sep { color: var(--text-3); }

.card-due {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 600;
  padding: 2px 7px; border-radius: var(--r-sm);
  margin-bottom: 7px;
}
.card-due svg { width: 11px; height: 11px; }
.card-due.overdue { background: var(--red-bg);    color: var(--red); }
.card-due.soon    { background: var(--orange-bg); color: var(--orange); }
.card-due.ok      { background: var(--bg-3);      color: var(--text-3); border: 1px solid var(--border); }

.card-progress { margin-top: 5px; }
.card-prog-wrap { height: 3px; background: var(--bg-3); border-radius: 1px; overflow: hidden; margin-top: 3px; border: 1px solid var(--border); }
.card-prog-bar  { height: 100%; transition: width 0.3s; }
.card-prog-label { font-size: 11.5px; color: var(--text-3); display: flex; justify-content: space-between; }

/* Step tracker (colis) */
.card-steps { display: flex; align-items: center; gap: 0; margin: 6px 0; }
.step-dot {
  width: 20px; height: 20px; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; border: 1px solid var(--border);
  background: var(--bg-3); color: var(--text-3);
  transition: all 0.2s; flex-shrink: 0;
}
.step-dot.active { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 0 0 2px rgba(29,78,216,0.15); }
.step-dot.done   { border-color: var(--green); background: var(--green); color: #fff; }
.step-line       { flex: 1; height: 1px; background: var(--border); }
.step-line.done  { background: var(--green); }

/* ── DASHBOARD ───────────────────────────────────────────────────── */
.dashboard-layout {
  padding: 1.5rem 1.75rem; display: flex; flex-direction: column;
  gap: 1.25rem; overflow-y: auto; flex: 1; background: var(--bg);
}

/* ── DASHBOARD FILTERS ───────────────────────────────────────────── */
.dash-filters {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 14px;
  box-shadow: var(--shadow-xs);
}
.dash-filters-left { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-filter-select {
  height: 34px; padding: 0 10px; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); background: var(--bg-3); color: var(--text);
  font-size: 12.5px; cursor: pointer; transition: border-color 0.15s;
}
.dash-filter-select:focus { outline: none; border-color: var(--accent); }
.dash-filter-reset {
  height: 34px; padding: 0 12px; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); background: none; color: var(--text-3);
  font-size: 12px; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.dash-filter-reset:hover { border-color: var(--red); color: var(--red); background: var(--red-bg); }

/* ── STATS STRIP ─────────────────────────────────────────────────── */
.dash-stats-strip {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.stat-tile {
  flex: 1; min-width: 100px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 12px 16px; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 3px;
  position: relative; overflow: hidden;
}
.stat-tile::before {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--border);
}
.stat-blue::before   { background: #3b82f6; }
.stat-green::before  { background: #22c55e; }
.stat-red::before    { background: #ef4444; }
.stat-orange::before { background: #f59e0b; }
.stat-purple::before { background: #a78bfa; }
.stat-val { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-lbl { font-size: 11.5px; color: var(--text-3); font-weight: 500; }

/* ── KPI CARDS ───────────────────────────────────────────────────── */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.kpi-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1rem 1.15rem 0.6rem;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  cursor: pointer; transition: all 0.15s;
  box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
}
.kpi-card:hover { border-color: var(--border-h); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.kpi-card.kpi-active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59,130,246,0.2); }
.kpi-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.kpi-vente-export::after { background: var(--c-vente); }
.kpi-demenagement::after { background: var(--c-demen); }
.kpi-colis::after        { background: var(--c-colis); }
.kpi-formalites::after   { background: var(--c-formal); }

.kpi-icon {
  width: 48px; height: 48px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0; border: 1px solid var(--border);
  background: var(--bg-3);
}
.kpi-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.kpi-value { font-size: 30px; font-weight: 800; line-height: 1; color: var(--text); }
.kpi-label { font-size: 13px; color: var(--text-2); margin-top: 3px; font-weight: 500; }
.kpi-sub   { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.kpi-prog-wrap { width: 100%; height: 4px; background: var(--bg-3); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.kpi-prog-bar  { height: 100%; border-radius: 2px; transition: width 0.5s ease; }

.dash-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash-col    { display: flex; flex-direction: column; }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-xs);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.card-header h3 { font-size: 14.5px; font-weight: 600; color: var(--text); }

.chip {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px;
  border-radius: var(--r-sm);
}
.chip-red    { background: var(--red-bg);    color: var(--red); }
.chip-green  { background: var(--green-bg);  color: var(--green); }
.chip-orange { background: var(--orange-bg); color: var(--orange); }

.dash-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 1rem; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.12s;
}
.dash-list-item:last-child { border-bottom: none; }
.dash-list-item:hover { background: var(--bg-hover); }
.dash-item-dot   { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }
.dash-item-info  { flex: 1; min-width: 0; }
.dash-item-title { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-item-sub   { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.dash-item-badge { font-size: 11px; padding: 2px 7px; border-radius: var(--r-sm); font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.dash-empty { padding: 1.5rem 1rem; color: var(--text-3); font-size: 13px; text-align: center; }

.overview-grid { padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 14px; }
.ov-row { display: flex; flex-direction: column; gap: 5px; }
.ov-row-top { display: flex; align-items: center; justify-content: space-between; }
.ov-label { font-size: 13px; color: var(--text); font-weight: 600; }
.ov-meta  { font-size: 11.5px; color: var(--text-3); }
.ov-bar-wrap { height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; display: flex; }
.ov-seg { height: 100%; transition: width 0.5s ease; }
.ov-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 2px; }
.ov-legend span { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); }
.ov-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* ── DRAWER ──────────────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,0.35);
  backdrop-filter: blur(2px); z-index: 150; display: none;
}
.drawer-overlay.open { display: block; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px;
  background: var(--bg-2); border-left: 1px solid var(--border);
  z-index: 160; display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
  border-radius: 20px 0 0 20px;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 0.9rem 1.25rem 0.6rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
  border-radius: 20px 0 0 0;
}
.drawer-chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.drawer-cat-chip, .drawer-stage-chip, .drawer-priority-chip {
  font-size: 10.5px; font-weight: 600; padding: 2px 7px;
  border-radius: var(--r-sm); border: 1px solid transparent;
}
.drawer-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 4px; border-radius: var(--r-sm);
  transition: all 0.13s; flex-shrink: 0;
}
.drawer-close:hover { background: var(--border); color: var(--text); }
.drawer-close svg { width: 14px; height: 14px; }

.drawer-title-row {
  display: flex; align-items: center; gap: 10px;
  padding: 0.75rem 1.25rem 0.25rem;
}
.drawer-priority-bar { width: 3px; height: 26px; border-radius: 1px; flex-shrink: 0; }
.drawer-title-input {
  flex: 1; background: none; border: none; outline: none;
  font-family: inherit; font-size: 17px; font-weight: 700; color: var(--text); padding: 2px 0;
  border-bottom: 2px solid transparent; transition: border-color 0.15s;
}
.drawer-title-input:focus { border-bottom-color: var(--accent); }

.drawer-meta-row {
  display: flex; align-items: center; gap: 8px;
  padding: 0.5rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.drawer-meta-item { display: flex; flex-direction: column; gap: 3px; }
.drawer-meta-item label {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.drawer-meta-item select,
.drawer-meta-item input[type="date"] {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 5px 10px;
  color: var(--text); font-family: inherit; font-size: 13px;
  outline: none; cursor: pointer; transition: border-color 0.13s;
}
.drawer-meta-item select:focus,
.drawer-meta-item input:focus { border-color: var(--accent); }

.drawer-scroll {
  flex: 1; overflow-y: auto; padding: 0.85rem 1.25rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.drawer-section { display: flex; flex-direction: column; gap: 7px; }
.drawer-section-title {
  font-size: 11.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.07em;
  padding-bottom: 5px; border-bottom: 1px solid var(--border);
}
.drawer-section-header { display: flex; align-items: center; justify-content: space-between; }
.task-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: var(--r-sm); background: var(--accent-g); color: var(--accent);
  border: 1px solid rgba(29,78,216,0.15);
}

.drawer-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.drawer-field { display: flex; flex-direction: column; gap: 3px; }
.drawer-field label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.drawer-field input {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 7px 10px;
  color: var(--text); font-family: inherit; font-size: 13px;
  outline: none; transition: border-color 0.13s;
}
.drawer-field input:focus { border-color: var(--accent); }

.drawer-task-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--border);
}
.drawer-task-item:last-child { border-bottom: none; }
.task-cb {
  appearance: none; -webkit-appearance: none;
  width: 15px; height: 15px; border: 1.5px solid var(--border-h);
  border-radius: 2px; cursor: pointer; position: relative; flex-shrink: 0;
  transition: all 0.13s; background: var(--bg-3);
}
.task-cb:checked { background: var(--green); border-color: var(--green); }
.task-cb:checked::after {
  content: ''; position: absolute; top: 2px; left: 4px;
  width: 4px; height: 7px; border: 1.5px solid #fff;
  border-top: none; border-left: none; transform: rotate(45deg);
}
.task-cb:hover:not(:checked) { border-color: var(--accent); }
.task-label-text { flex: 1; font-size: 13px; color: var(--text); }
.drawer-task-item.done .task-label-text { text-decoration: line-through; color: var(--text-3); }
.btn-del-task {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 2px; border-radius: 2px;
  opacity: 0; transition: all 0.13s; flex-shrink: 0;
}
.btn-del-task svg { width: 11px; height: 11px; }
.drawer-task-item:hover .btn-del-task { opacity: 1; }
.btn-del-task:hover { color: var(--red); background: var(--red-bg); }

.add-task-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.add-task-row input {
  flex: 1; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 6px 9px;
  color: var(--text); font-family: inherit; font-size: 12px;
  outline: none; transition: border-color 0.13s;
}
.add-task-row input:focus { border-color: var(--accent); }
#btn-drawer-add-task {
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--r-sm); width: 26px; height: 26px;
  font-size: 15px; cursor: pointer; transition: background 0.13s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
#btn-drawer-add-task:hover { background: #1e40af; }

#drawer-notes {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 9px 11px;
  color: var(--text); font-family: inherit; font-size: 12px;
  outline: none; resize: vertical; width: 100; transition: border-color 0.13s;
  width: 100%;
}
#drawer-notes:focus { border-color: var(--accent); }

.drawer-footer {
  padding: 0.75rem 1.25rem; border-top: 1px solid var(--border);
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.drawer-stage-nav { display: flex; align-items: center; gap: 5px; }
.btn-stage-prev, .btn-stage-next {
  display: flex; align-items: center; gap: 3px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 5px 10px;
  color: var(--text-2); font-family: inherit; font-size: 11.5px; font-weight: 500;
  cursor: pointer; transition: all 0.13s;
}
.btn-stage-prev svg, .btn-stage-next svg { width: 12px; height: 12px; }
.btn-stage-prev:hover, .btn-stage-next:hover { border-color: var(--accent); color: var(--accent); }
.btn-stage-prev:disabled, .btn-stage-next:disabled { opacity: 0.35; cursor: not-allowed; }

.drawer-footer-actions { display: flex; align-items: center; gap: 6px; }
.btn-save-drawer {
  display: flex; align-items: center; gap: 5px;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--r-sm); padding: 6px 13px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background 0.13s;
}
.btn-save-drawer svg { width: 12px; height: 12px; }
.btn-save-drawer:hover { background: #1e40af; }
.btn-delete-sm {
  background: none; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 5px 8px;
  color: var(--text-3); cursor: pointer; transition: all 0.13s; display: flex;
}
.btn-delete-sm svg { width: 13px; height: 13px; }
.btn-delete-sm:hover { border-color: var(--red); color: var(--red); background: var(--red-bg); }

/* ── MODAL ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,0.4);
  backdrop-filter: blur(3px); z-index: 200;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 20px; width: 520px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18), 0 8px 20px rgba(0,0,0,0.10);
}
.modal-sm     { width: 380px; }
.modal-create { width: 540px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--bg-3);
  border-radius: 20px 20px 0 0;
}
.modal-header h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 4px; border-radius: var(--r-sm); transition: all 0.13s;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-close svg { width: 14px; height: 14px; }

.modal-body   { padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0.85rem; }
.modal-footer {
  padding: 0.75rem 1.25rem; border-top: 1px solid var(--border);
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: flex-end; gap: 7px;
  border-radius: 0 0 20px 20px;
}

/* ── FORMS ───────────────────────────────────────────────────────── */
.form-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 4px; }
.form-group { display: flex; flex-direction: column; }
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 11px;
  color: var(--text); font-family: inherit; font-size: 13.5px;
  outline: none; transition: border-color 0.13s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.create-specific-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.create-specific-fields .form-group.full { grid-column: 1 / -1; }

.cat-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 2px; }
.cat-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text-2);
  font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.13s;
}
.cat-btn:hover { border-color: var(--border-h); color: var(--text); background: var(--bg-2); }
.cat-btn.selected { border-color: var(--accent); background: var(--accent-g); color: var(--accent); }
.cat-btn-icon { font-size: 17px; }
.form-check { display: flex; align-items: center; gap: 7px; }
.form-check input[type="checkbox"] { accent-color: var(--accent); width: 13px; height: 13px; cursor: pointer; }
.form-check label { font-size: 12px; color: var(--text-2); cursor: pointer; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2563eb); color: #fff; border: none;
  border-radius: var(--r-sm); padding: 9px 20px;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(29,78,216,0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, #1e40af, #1d4ed8); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(29,78,216,0.4); }
.btn-secondary {
  background: var(--bg-3); color: var(--text-2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 8px 16px; font-family: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: all 0.13s;
}
.btn-secondary:hover { border-color: var(--border-h); background: var(--bg-hover); }
.btn-danger {
  background: var(--red-bg); color: var(--red);
  border: 1px solid rgba(185,28,28,0.2); border-radius: var(--r-sm);
  padding: 8px 16px; font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background 0.13s;
}
.btn-danger:hover { background: rgba(185,28,28,0.15); }

/* ── TOAST ───────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--text); color: #fff;
  font-size: 13.5px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--r-sm);
  box-shadow: var(--shadow-md); z-index: 300;
  transform: translateY(12px); opacity: 0;
  transition: all 0.2s ease; pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

/* ── SEARCH RESULTS ──────────────────────────────────────────────── */
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-md);
  z-index: 60; max-height: 300px; overflow-y: auto; display: none;
}
.search-results.open { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer; transition: background 0.1s;
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-hover); }
.search-result-icon  { font-size: 15px; flex-shrink: 0; }
.search-result-info  { flex: 1; min-width: 0; }
.search-result-title { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-sub   { font-size: 10.5px; color: var(--text-3); }

/* confetti */
@keyframes confetti-pop { 0%{transform:translateY(-8px) rotate(0);opacity:1}100%{transform:translateY(50px) rotate(360deg);opacity:0} }
.confetti-dot { position:fixed;width:6px;height:6px;border-radius:1px;pointer-events:none;z-index:999;animation:confetti-pop .7s ease forwards; }

/* ── THEME PICKER ────────────────────────────────────────────────── */
.sidebar-footer { position: relative; flex-direction: column; gap: 8px; }

.sync-indicator {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: #4b5a72; transition: background 0.3s;
  align-self: flex-start; margin-bottom: -4px;
}
.sync-indicator.ok      { background: #22c55e; }
.sync-indicator.syncing { background: #f59e0b; animation: pulse-sync 1s ease-in-out infinite; }
.sync-indicator.offline { background: #ef4444; }
.sync-indicator.local   { background: #4b5a72; }
@keyframes pulse-sync {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.footer-btns { display: flex; align-items: center; gap: 3px; }

.theme-picker {
  position: absolute; bottom: calc(100% + 6px); left: 10px; right: 10px;
  background: #1e2a3f;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r);
  padding: 8px;
  box-shadow: 0 -8px 28px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.3);
  display: none; z-index: 110;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.theme-picker.open { display: block; animation: slideUp 0.16s ease; }

.theme-picker-title {
  font-size: 9.5px; font-weight: 700; color: #4b5a72;
  text-transform: uppercase; letter-spacing: 0.09em;
  padding: 0 4px 7px; margin-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.theme-options { display: flex; flex-direction: column; gap: 2px; }
.theme-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid transparent;
  color: #8b97b0; font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.13s; text-align: left; width: 100%;
}
.theme-opt svg { width: 13px; height: 13px; flex-shrink: 0; }
.theme-opt:hover  { background: rgba(255,255,255,0.06); color: #e8edf5; }
.theme-opt.active { background: rgba(59,130,246,0.18); color: #93c5fd; border-color: rgba(59,130,246,0.3); }

/* ── DARK THEME ──────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:       #0d1117;
  --bg-2:     #161c2c;
  --bg-3:     #111827;
  --bg-card:  #161c2c;
  --bg-hover: rgba(255,255,255,0.04);
  --border:   #1e2a3d;
  --border-h: #2d3d57;

  --text:   #e2e8f0;
  --text-2: #8b97b0;
  --text-3: #4b5a72;

  --accent:   #3b82f6;
  --accent-2: #60a5fa;
  --accent-g: rgba(59,130,246,0.12);

  --green:      #22c55e;
  --green-bg:   rgba(34,197,94,0.12);
  --green-text: #86efac;
  --orange:     #f59e0b;
  --orange-bg:  rgba(245,158,11,0.12);
  --red:        #ef4444;
  --red-bg:     rgba(239,68,68,0.12);
  --blue:       #3b82f6;
  --blue-bg:    rgba(59,130,246,0.12);
  --purple:     #a78bfa;
  --purple-bg:  rgba(167,139,250,0.12);
  --pink:       #f472b6;
  --pink-bg:    rgba(244,114,182,0.12);

  --shadow-xs: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.6), 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.7), 0 2px 6px rgba(0,0,0,0.4);
}

/* Sidebar stays dark in both themes — only adjust slightly in dark mode */
[data-theme="dark"] .sidebar {
  --sb-bg:     #111827;
  --sb-border: rgba(255,255,255,0.06);
}
[data-theme="dark"] .theme-picker { background: #1a2335; }

/* ── PIPELINE GLOBAL ─────────────────────────────────────────────── */
.pipeline-filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pipeline-filter-bar select {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 6px 10px;
  color: var(--text); font-family: inherit; font-size: 13px;
  outline: none; cursor: pointer; transition: border-color 0.13s;
}
.pipeline-filter-bar select:focus { border-color: var(--accent); }

.pipeline-content {
  flex: 1; overflow-y: auto; padding: 1.25rem 1.75rem;
}
.pipeline-header-row {
  display: grid;
  grid-template-columns: 4px 1fr 180px 140px 110px 90px;
  gap: 12px; align-items: center;
  padding: 6px 14px 6px 10px;
  font-size: 11.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.07em;
  border-bottom: 2px solid var(--border);
  margin-bottom: 6px;
}
.pipeline-list { display: flex; flex-direction: column; gap: 4px; }
.pipeline-row {
  display: grid;
  grid-template-columns: 4px 1fr 180px 140px 110px 90px;
  gap: 12px; align-items: center;
  padding: 10px 14px 10px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer; transition: all 0.15s;
  box-shadow: var(--shadow-xs);
}
.pipeline-row:hover { border-color: var(--border-h); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.pipeline-prio {
  width: 4px; height: 38px; border-radius: 2px; flex-shrink: 0;
}
.pipeline-prio.prio-high   { background: var(--red); }
.pipeline-prio.prio-normal { background: var(--orange); }
.pipeline-prio.prio-low    { background: var(--green); }
.pipeline-name { min-width: 0; }
.pipeline-title { font-size: 14px; font-weight: 600; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipeline-sub   { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipeline-cat-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pipeline-stage-badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pl-prog-wrap { height: 5px; background: var(--bg-3); border-radius: 2px; overflow: hidden; border: 1px solid var(--border); flex: 1; }
.pl-prog-bar  { height: 100%; transition: width 0.3s; }
.pipeline-progress { display: flex; align-items: center; gap: 6px; }
.pl-prog-pct { font-size: 11.5px; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.pl-no-tasks { font-size: 12px; color: var(--text-3); }
.pl-due { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pl-due.overdue { color: var(--red); }
.pl-due.soon    { color: var(--orange); }
.pl-due.ok      { color: var(--text-3); }
.pipeline-empty { padding: 4rem; text-align: center; color: var(--text-3); font-size: 14px; }

/* ── AGENDA ──────────────────────────────────────────────────────── */
.agenda-view {
  padding: 1.25rem 1.75rem; display: flex; flex-direction: column; gap: 1.5rem;
  overflow-y: auto; flex: 1;
}
.agenda-section { display: flex; flex-direction: column; gap: 8px; }
.agenda-section-header {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 6px; border-bottom: 2px solid var(--border);
}
.agenda-section-icon  { font-size: 16px; }
.agenda-section-title { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }
.agenda-section-count {
  font-size: 11.5px; font-weight: 700; padding: 2px 8px;
  border-radius: var(--r-sm); background: var(--bg-3);
  border: 1px solid var(--border); color: var(--text-3);
}
.agenda-items { display: flex; flex-direction: column; gap: 4px; }
.agenda-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  cursor: pointer; transition: all 0.15s; box-shadow: var(--shadow-xs);
}
.agenda-item:hover { border-color: var(--border-h); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.agenda-item-date {
  width: 44px; text-align: center; flex-shrink: 0;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 4px 6px;
}
.agenda-item-date.overdue { background: var(--red-bg); border-color: rgba(185,28,28,0.2); }
.agenda-item-date.soon    { background: var(--orange-bg); border-color: rgba(180,83,9,0.2); }
.agenda-day   { display: block; font-size: 18px; font-weight: 800; line-height: 1; color: var(--text); }
.agenda-month { display: block; font-size: 10.5px; text-transform: uppercase; color: var(--text-3); font-weight: 600; letter-spacing: 0.05em; }
.agenda-item-date.overdue .agenda-day,
.agenda-item-date.overdue .agenda-month { color: var(--red); }
.agenda-item-date.soon .agenda-day,
.agenda-item-date.soon .agenda-month { color: var(--orange); }
.agenda-item-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.agenda-item-info { flex: 1; min-width: 0; }
.agenda-item-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-item-sub   { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.agenda-item-meta  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.agenda-day-badge {
  font-size: 12px; font-weight: 700; padding: 3px 9px;
  border-radius: var(--r-sm); white-space: nowrap;
}
.agenda-day-badge.overdue { background: var(--red-bg); color: var(--red); }
.agenda-day-badge.soon    { background: var(--orange-bg); color: var(--orange); }
.agenda-day-badge.ok      { background: var(--bg-3); color: var(--text-3); border: 1px solid var(--border); }
.agenda-prio { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.agenda-prio.prio-high   { background: var(--red); }
.agenda-prio.prio-normal { background: var(--orange); }
.agenda-prio.prio-low    { background: var(--green); }
.agenda-empty { padding: 1rem 0; color: var(--text-3); font-size: 13.5px; text-align: left; }
.agenda-no-date { padding: 3rem; text-align: center; color: var(--text-3); font-size: 14px; }

/* ── RAPPORTS ────────────────────────────────────────────────────── */
.rapports-view {
  padding: 1.25rem 1.75rem; display: flex; flex-direction: column;
  gap: 1.25rem; overflow-y: auto; flex: 1;
}
.rapport-kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.rapport-kpi {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1rem 1.15rem;
  box-shadow: var(--shadow-xs); text-align: center;
}
.rk-value { font-size: 32px; font-weight: 800; color: var(--text); line-height: 1; }
.rk-value.rk-blue  { color: var(--accent-2); }
.rk-value.rk-green { color: var(--green); }
.rk-value.rk-red   { color: var(--red); }
.rk-value.rk-orange { color: var(--orange); }
.rk-label { font-size: 12.5px; color: var(--text-3); margin-top: 5px; font-weight: 500; }

.rapports-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.rapport-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1rem; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 10px;
}
.rapport-card-header { display: flex; align-items: center; gap: 8px; }
.rapport-cat-icon { font-size: 20px; }
.rapport-cat-name { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.rapport-cat-total {
  font-size: 22px; font-weight: 800; color: var(--text); line-height: 1;
}
.rapport-completion { display: flex; align-items: center; gap: 8px; }
.rp-bar-wrap { flex: 1; height: 6px; background: var(--bg-3); border-radius: 2px; overflow: hidden; border: 1px solid var(--border); }
.rp-bar { height: 100%; transition: width 0.4s; border-radius: 2px; }
.rp-pct { font-size: 13px; font-weight: 700; width: 36px; text-align: right; flex-shrink: 0; }
.rapport-stages { display: flex; flex-direction: column; gap: 5px; }
.rs-row { display: flex; align-items: center; gap: 7px; }
.rs-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.rs-label { font-size: 12px; color: var(--text-2); width: 100px; flex-shrink: 0; }
.rs-bar-wrap { flex: 1; height: 4px; background: var(--bg-3); border-radius: 1px; overflow: hidden; border: 1px solid var(--border); }
.rs-bar { height: 100%; transition: width 0.4s; border-radius: 1px; opacity: 0.7; }
.rs-count { font-size: 11.5px; font-weight: 700; color: var(--text-3); width: 20px; text-align: right; }
.rapport-priority-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1rem; box-shadow: var(--shadow-xs);
}
.rs-section-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.priority-bars { display: flex; flex-direction: column; gap: 8px; }
.pb-row { display: flex; align-items: center; gap: 10px; }
.pb-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.prio-dot-high   { background: var(--red); }
.prio-dot-normal { background: var(--orange); }
.prio-dot-low    { background: var(--green); }
.pb-label { font-size: 13px; color: var(--text-2); width: 105px; flex-shrink: 0; font-weight: 500; }
.pb-bar-wrap { flex: 1; height: 8px; background: var(--bg-3); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.pb-bar { height: 100%; border-radius: 3px; transition: width 0.4s; }
.prio-bar-high   { background: var(--red); }
.prio-bar-normal { background: var(--orange); }
.prio-bar-low    { background: var(--green); }
.pb-count { font-size: 13px; font-weight: 700; color: var(--text-3); width: 24px; text-align: right; }

/* ── CONTACTS ────────────────────────────────────────────────────── */
.contacts-content {
  flex: 1; overflow-y: auto; padding: 1.25rem 1.75rem;
}
.contacts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px;
}
.contact-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1rem; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 10px;
  transition: all 0.15s; cursor: default;
}
.contact-card:hover { border-color: var(--border-h); box-shadow: var(--shadow-sm); }
.contact-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; flex-shrink: 0;
}
.contact-info { display: flex; flex-direction: column; gap: 3px; }
.contact-name    { font-size: 15px; font-weight: 700; color: var(--text); }
.contact-company { font-size: 12.5px; color: var(--text-2); }
.contact-detail  { font-size: 12px; color: var(--text-3); }
.contact-cat     { font-size: 12px; font-weight: 600; margin-top: 3px; }
.contact-type-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; margin-top: 4px;
}
.contact-footer  { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--border); }
.contact-projects-count { font-size: 12px; color: var(--text-3); }
.contact-actions { display: flex; align-items: center; gap: 4px; }
.btn-edit-contact, .btn-del-contact {
  background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: var(--r-sm); transition: all 0.13s;
  color: var(--text-3); display: flex;
}
.btn-edit-contact svg, .btn-del-contact svg { width: 14px; height: 14px; }
.btn-edit-contact:hover { color: var(--accent); background: var(--accent-g); }
.btn-del-contact:hover  { color: var(--red); background: var(--red-bg); }
.contacts-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 5rem 2rem; gap: 10px; color: var(--text-3);
}
.contacts-empty-icon { font-size: 48px; opacity: 0.5; }
.contacts-empty-sub { font-size: 13px; }
.contacts-search-bar {
  display: flex; align-items: center; gap: 8px;
}
.contacts-search-bar input {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 6px 11px;
  color: var(--text); font-family: inherit; font-size: 13px;
  outline: none; transition: border-color 0.13s; width: 220px;
}
.contacts-search-bar input:focus { border-color: var(--accent); }

/* ── CONTACT PICKER (in create modal) ───────────────────────────── */
.contact-picker-row {
  display: flex; align-items: center; gap: 6px;
}
.contact-picker-row select {
  flex: 1; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 11px;
  color: var(--text); font-family: inherit; font-size: 13.5px;
  outline: none; transition: border-color 0.13s; cursor: pointer;
}
.contact-picker-row select:focus { border-color: var(--accent); }
.btn-contact-new-inline {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--accent-g); border: 1px solid rgba(29,78,216,0.25);
  border-radius: var(--r-sm); color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.13s;
}
.btn-contact-new-inline:hover { background: rgba(29,78,216,0.15); border-color: var(--accent); }
.btn-contact-new-inline svg { width: 16px; height: 16px; }

/* ── DRAG & DROP ─────────────────────────────────────────────────── */
.project-card[draggable="true"] { cursor: grab; user-select: none; }
.project-card[draggable="true"]:active { cursor: grabbing; }
.project-card.dragging { opacity: 0.35; transform: rotate(1.5deg) scale(0.98); box-shadow: var(--shadow-md) !important; }
.kanban-col-body.drag-over {
  background: var(--accent-g) !important;
  border-color: var(--accent) !important;
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

/* ── SETTINGS ────────────────────────────────────────────────────── */
.settings-view {
  padding: 1.25rem 1.75rem; display: flex; flex-direction: column;
  gap: 1.5rem; overflow-y: auto; flex: 1;
}
.settings-section { display: flex; flex-direction: column; gap: 1rem; }
.settings-section-title { font-size: 17px; font-weight: 700; color: var(--text); }
.settings-section-desc { font-size: 13px; color: var(--text-3); line-height: 1.6; }
.settings-templates {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.settings-template-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1rem; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 10px;
}
.stc-header { display: flex; align-items: center; gap: 8px; }
.stc-icon { font-size: 20px; }
.stc-name { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.stc-count { font-size: 11.5px; color: var(--text-3); padding: 2px 7px; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r-sm); }
.stc-custom { color: var(--accent); background: var(--accent-g); border-color: rgba(29,78,216,0.2); }
.stc-textarea {
  width: 100%; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 9px 11px;
  color: var(--text); font-family: inherit; font-size: 12.5px;
  outline: none; resize: vertical; transition: border-color 0.13s; line-height: 1.7;
}
.stc-textarea:focus { border-color: var(--accent); }
.stc-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 2px; }

/* ── HAMBURGER (hidden by default, shown on mobile) ──────────────── */
.hamburger-btn {
  display: none; background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--text-2); border-radius: var(--r-sm);
  transition: all 0.13s; flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--bg-hover); color: var(--text); }
.hamburger-btn svg { width: 22px; height: 22px; }

#mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 150;
  backdrop-filter: blur(2px);
}
#mobile-overlay.open { display: block; }

/* ── MOBILE RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  html { font-size: 15px; }

  .sidebar {
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    z-index: 200;
  }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,0.4); }

  .main { margin-left: 0 !important; }
  .hamburger-btn { display: flex !important; }

  /* Topbar */
  .topbar { padding: 0 0.85rem !important; gap: 6px; overflow: hidden; }
  .topbar-left { flex: 1; min-width: 0; align-items: center; gap: 8px; overflow: hidden; }
  .page-title { font-size: 16px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
  .topbar-desc { display: none; }
  .topbar-right { flex-shrink: 0; gap: 6px; }
  .search-wrap { display: none; }
  .btn-new span { display: none; }
  .btn-new { padding: 9px 12px !important; }

  /* Dashboard KPIs */
  .kpi-row { grid-template-columns: 1fr 1fr !important; }
  .kpi-value { font-size: 24px !important; }
  .dashboard-layout { padding: 1rem !important; gap: 1rem !important; }
  .dash-bottom { grid-template-columns: 1fr !important; }

  /* Kanban */
  .kanban-board { padding: 1rem !important; }
  .kanban-col { width: 260px !important; }

  /* Drawer */
  .drawer { width: 100% !important; }
  .drawer-fields-grid { grid-template-columns: 1fr !important; }

  /* Pipeline */
  .pipeline-header-row { display: none !important; }
  .pipeline-row {
    grid-template-columns: 4px 1fr !important;
    gap: 0 10px !important;
  }
  .pipeline-row > div:nth-child(3),
  .pipeline-row > div:nth-child(4),
  .pipeline-row > div:nth-child(5),
  .pipeline-row > div:nth-child(6) { display: none !important; }
  .pipeline-content { padding: 1rem !important; }

  /* Rapports */
  .rapports-grid { grid-template-columns: 1fr !important; }
  .rapport-kpi-grid { grid-template-columns: 1fr 1fr !important; }
  .rapports-view { padding: 1rem !important; }

  /* Contacts */
  .contacts-grid { grid-template-columns: 1fr !important; }
  .contacts-content { padding: 1rem !important; }

  /* Agenda */
  .agenda-view { padding: 1rem !important; }

  /* Settings */
  .settings-templates { grid-template-columns: 1fr !important; }
  .settings-view { padding: 1rem !important; }

  /* Modal */
  .modal { width: 96vw !important; }
  .form-row-2 { grid-template-columns: 1fr !important; }
  .create-specific-fields { grid-template-columns: 1fr !important; }
  .cat-selector { grid-template-columns: 1fr 1fr !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════════════ */

.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a2236 0%, #2d3748 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.login-box {
  background: var(--bg-2);
  border-radius: var(--r);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  padding: 3rem;
  width: 90%;
  max-width: 420px;
  animation: loginSlideIn 0.4s ease-out;
}

@keyframes loginSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-logo-img {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
}

.login-logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.login-logo p {
  font-size: 0.95rem;
  color: var(--text-3);
  font-weight: 500;
}

.login-form {
  margin-bottom: 1.5rem;
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.5rem;
}

.login-form input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s;
  background: var(--bg);
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-2);
}

.login-error {
  display: none;
  padding: 0.75rem;
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--r-xs);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.btn-login {
  width: 100%;
  padding: 0.95rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-login:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29,78,216,0.3);
}

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

.login-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-3);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Dark mode login adjustments */
[data-theme="dark"] .login-box {
  background: #1e293b;
}

[data-theme="dark"] .login-form input {
  background: #0f172a;
  color: #e2e8f0;
  border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .login-form input:focus {
  border-color: var(--accent-2);
  background: #1e293b;
}
