/* ── Task21 — style.css ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w:      240px;
  --topbar-h:       62px;

  --sidebar-bg:     #16162A;
  --sidebar-hover:  #1E1E38;
  --sidebar-active: #26264A;
  --sidebar-border: rgba(255,255,255,.06);
  --sidebar-text:   #8892B0;
  --sidebar-bright: #CCD6F6;

  --accent:         #6366F1;
  --accent-hover:   #4F46E5;
  --accent-light:   rgba(99,102,241,.12);

  --bg:             #F1F5F9;
  --surface:        #FFFFFF;
  --border:         #E2E8F0;
  --text:           #1E293B;
  --text-muted:     #64748B;

  --todo:           #94A3B8;
  --inprogress:     #F59E0B;
  --done:           #10B981;
  --high:           #EF4444;
  --medium:         #F59E0B;
  --low:            #10B981;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:      0 4px 16px rgba(0,0,0,.1);
  --radius:         10px;
  --radius-sm:      6px;
}

html, body { height: 100%; font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Utilities ── */
.hidden { display: none !important; }
input, textarea, select, button { font-family: inherit; font-size: 14px; }

/* ── Init Loader ── */
.init-loader {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); z-index: 9999;
}
.init-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Auth Screen ── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0f23 0%, #16162A 100%);
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}

.auth-back {
  display: inline-block;
  font-size: 12px;
  color: #94A3B8;
  text-decoration: none;
  margin-bottom: 20px;
}
.auth-back:hover { color: #fff; }

.auth-logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -1px;
}
.auth-logo span { color: var(--accent); }

.auth-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.auth-switch {
  text-align: center;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 13px;
}
.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }

/* ── App Layout ── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 44px 16px 25px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -1px;
  text-align: center;
}
.sidebar-logo span { color: var(--accent); }

.sidebar-nav {
  padding: 8px 8px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s;
  user-select: none;
  position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-bright); }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: .7;
}
.nav-item.active .nav-icon { opacity: 1; }

.project-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-badge {
  background: rgba(255,255,255,.12);
  color: var(--sidebar-text);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}

.nav-item-actions {
  display: none;
  gap: 4px;
  margin-left: auto;
}
.nav-item:hover .nav-item-actions { display: flex; }

.nav-item-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 13px;
  line-height: 1;
  opacity: .7;
}
.nav-item-btn:hover { background: rgba(255,255,255,.1); opacity: 1; }

/* ── Sidebar Project Items ── */
.proj-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 32px 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
  margin: 1px 4px;
  position: relative;
  min-height: 36px;
  overflow: hidden;
}
.proj-item:hover { background: var(--sidebar-hover); }
.proj-item.active { background: var(--sidebar-active); }
.proj-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.proj-item-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s;
}
.proj-item:hover .proj-item-name,
.proj-item.active .proj-item-name { color: var(--sidebar-bright); }

.proj-item-badge {
  background: rgba(255,255,255,.12);
  color: var(--sidebar-text);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}

.proj-item-menu {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s, background .15s;
  z-index: 1;
}
.proj-item:hover .proj-item-menu,
.proj-item.active .proj-item-menu { opacity: 1; }
@media (max-width: 768px) { .proj-item-menu { opacity: 1; } }
.proj-item-menu:hover { background: rgba(255,255,255,.12); color: var(--sidebar-bright); }

/* ── Project context menu ── */
.proj-ctx-menu {
  position: fixed;
  z-index: 400;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px;
  min-width: 150px;
  animation: fadeIn .1s ease;
}
.proj-ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: background .1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.proj-ctx-item:hover { background: var(--bg); }
.proj-ctx-item svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); }
.proj-ctx-item--danger { color: var(--high); }
.proj-ctx-item--danger:hover { background: rgba(239,68,68,.08); }
.proj-ctx-item--danger svg { color: var(--high); }

.sidebar-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 4px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--sidebar-text);
  opacity: .6;
}

.btn-icon-sidebar {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  opacity: .6;
}
.btn-icon-sidebar:hover { background: var(--sidebar-hover); opacity: 1; }

.projects-nav { flex: 1; }

.sidebar-import-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  background: none;
  border: none;
  border-top: 1px solid var(--sidebar-border);
  border-radius: 0;
  color: var(--sidebar-text);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  opacity: .75;
  transition: opacity .15s, background .15s, color .15s;
}
.sidebar-import-btn:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-bright);
  opacity: 1;
}
.sidebar-import-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Lot 3 : actions multiples dans l'en-tête de section ─────────────────── */
.sidebar-section-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.sidebar-section-actions .btn-icon-sidebar svg { width: 13px; height: 13px; }

/* ── Lot 3 : accordéons d'équipe dans la sidebar ─────────────────────────── */
.teams-nav { flex: 0 0 auto; max-height: 38vh; overflow-y: auto; padding: 0 8px; }

.team-accordion {
  margin-bottom: 2px;
}

.team-accordion-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  color: var(--sidebar-text);
}
.team-accordion-header:hover {
  background: var(--sidebar-hover, #1E1E38);
  color: var(--sidebar-bright);
}

.accordion-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  flex-shrink: 0;
  opacity: .65;
  transform: rotate(-90deg);
  transition: transform .15s ease;
}
.accordion-chevron svg { width: 12px; height: 12px; }
.team-accordion.expanded > .team-accordion-header > .accordion-chevron {
  transform: rotate(0deg);
}

.team-accordion-header .proj-item-name {
  flex: 1;
  min-width: 0;
}

.team-accordion-body {
  display: none;
  padding: 2px 0 4px 22px;
}
.team-accordion.expanded > .team-accordion-body {
  display: block;
}

.team-accordion-body .proj-item {
  padding: 4px 8px;
  font-size: 13px;
}

.team-add-project {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px dashed var(--sidebar-border, rgba(255,255,255,.1));
  color: var(--sidebar-text);
  padding: 4px 8px;
  width: 100%;
  text-align: left;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  opacity: .7;
  margin-top: 2px;
}
.team-add-project:hover {
  opacity: 1;
  border-style: solid;
  background: var(--sidebar-hover, #1E1E38);
  color: var(--sidebar-bright);
}

.team-empty {
  padding: 4px 8px;
  font-size: 12px;
  color: var(--sidebar-text);
  opacity: .5;
  font-style: italic;
}

/* Bouton ⋮ dans l'en-tête d'accordéon d'équipe */
.team-accordion-menu {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  font-size: 16px;
  opacity: 0;
  transition: opacity .15s;
  flex-shrink: 0;
}
.team-accordion-header:hover .team-accordion-menu { opacity: .8; }
.team-accordion-menu:hover { background: rgba(255,255,255,.12); opacity: 1; }

/* ── Lot 3 : modale unifiée de gestion (onglets) ─────────────────────────── */
.manage-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,.08));
  margin: 0 -4px 12px;
  padding: 0 4px;
}
.manage-tab {
  background: none;
  border: none;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, #64748B);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.manage-tab:hover { color: var(--text, #0F172A); }
.manage-tab.active {
  color: var(--accent, #6366F1);
  border-bottom-color: var(--accent, #6366F1);
}

.manage-body { min-height: 200px; }
.manage-pane { display: none; }
.manage-pane.active { display: block; }

.manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,.06));
}
.manage-row:last-child { border-bottom: none; }
.manage-row-name {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.manage-row-meta {
  font-size: 11px;
  color: var(--text-secondary, #64748B);
  font-weight: normal;
  margin-left: 4px;
}
.manage-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.manage-row-actions .btn-secondary,
.manage-row-actions .btn-danger {
  padding: 4px 10px;
  font-size: 12px;
}

.manage-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-secondary, #64748B);
  font-size: 13px;
}

.modal--md { max-width: 520px; width: 92vw; }

/* Petit visuel pour les combinaisons clavier ⌘E etc. */
.kbd-combo { font-size: 10px !important; letter-spacing: .04em; }

/* ── Lot 1 : équipes (legacy) ─────────────────────────────────────────────── */
.team-manage-body { padding: 4px 4px 8px; }
.team-manage-section { margin-top: 14px; }
.team-manage-section:first-child { margin-top: 4px; }
.btn-danger {
  background: var(--high, #EF4444);
  color: #fff;
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover { filter: brightness(1.08); }
.btn-block { width: 100%; margin-top: 8px; }
.team-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 6px 8px; border-radius: 6px;
}
.team-row:hover { background: var(--sidebar-hover, #1E1E38); }
.team-row .team-row-meta { font-size: 12px; opacity: .6; }
.team-role-badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; padding: 2px 6px; border-radius: 4px;
  background: rgba(99,102,241,.15); color: #818CF8;
}
.team-role-badge.owner { background: rgba(245,158,11,.15); color: #F59E0B; }
.team-role-badge.admin { background: rgba(16,185,129,.15); color: #10B981; }

/* Lot 3 : variante compacte du badge (utilisée dans la sidebar) — pastille
   ronde, une lettre, sans uppercase forcé. La version normale reste utilisée
   dans les modales où la place ne pose pas de problème. */
.team-role-badge--abbr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}

.sidebar-user { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-settings-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: .75;
  text-align: left;
}
.sidebar-settings-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.sidebar-settings-btn:hover { background: var(--sidebar-hover); opacity: 1; }

.btn-logout {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  opacity: .6;
  flex-shrink: 0;
}
.btn-logout svg { width: 16px; height: 16px; }
.btn-logout:hover { background: var(--sidebar-hover); opacity: 1; }

/* ── List column hiding ── */
.list-hide-projet   .task-row-meta     { display: none !important; }
.list-hide-date     .task-row-due      { display: none !important; }
.list-hide-priorite .task-row-prio     { display: none !important; }
.list-hide-statut   .task-row-status   { display: none !important; }
.list-hide-assigne  .task-row-assigned { display: none !important; }

/* ── Settings modal ── */
.settings-body { padding: 16px 20px 8px; display: flex; flex-direction: column; gap: 4px; }
.settings-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 10px 0 4px; }
.settings-label:first-child { margin-top: 0; }
.settings-views { display: flex; flex-direction: column; }
.settings-view-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .1s;
  font-size: 14px;
  font-weight: 500;
}
.settings-view-row:hover { background: var(--bg); }
.settings-view-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.settings-2col { display: grid; grid-template-columns: 1fr 1fr; }
.settings-col-row { font-weight: 400; font-size: 13px; }
.settings-col-rows { display: grid; grid-template-columns: 1fr 1fr; padding: 0 8px 8px; }
.settings-details { border: 1px solid var(--border); border-radius: 6px; margin-bottom: 4px; overflow: hidden; }
.settings-summary {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.settings-summary::-webkit-details-marker { display: none; }
.settings-summary::before { content: '›'; font-size: 16px; transition: transform .15s; display: inline-block; color: var(--text-muted); }
details[open] .settings-summary::before { transform: rotate(90deg); }

.settings-mode-row { display: flex; gap: 8px; padding: 4px 0; }
.settings-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.settings-mode-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.settings-mode-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(99,102,241,.07); }
.settings-mode-btn:not(.active):hover { border-color: var(--text-muted); color: var(--text); }

/* ── Main Area ── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── View Toggle ── */
.view-toggle {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
}
.view-btn svg { width: 14px; height: 14px; }
.view-btn:hover { color: var(--text); background: rgba(0,0,0,.04); }
.view-btn.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }

/* ── Buttons ── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background .15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary.btn-block { width: 100%; justify-content: center; padding: 10px; }

.btn-secondary {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}
.btn-icon:hover { color: var(--high); background: rgba(239,68,68,.08); }

/* ── Content Area ── */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10% 36px;
}

.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 10% 16px;
  background: var(--bg);
}

.btn-new-task-toolbar {
  flex-shrink: 0;
  font-size: 13px;
  padding: 6px 14px;
}

.toolbar-btn-group {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.btn-trash { padding: 6px 10px; }
.btn-trash svg { width: 15px; height: 15px; }
.btn-trash--active { background: #4F46E5; }
.task-deleted { opacity: 0.6; }
.task-deleted .task-row-title span:last-child { text-decoration: line-through; }

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}
.empty-icon {
  width: 56px; height: 56px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.empty-state p { font-size: 15px; }
.empty-state a { color: var(--accent); text-decoration: none; font-weight: 500; }
.empty-state a:hover { text-decoration: underline; }

/* ── List View ── */
.list-view {
  background: transparent;
}

.task-row {
  display: grid;
  grid-template-columns: var(--list-cols, 20px 36px 1fr auto auto auto auto auto 36px);
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: none;
  transition: background .1s;
  cursor: pointer;
  border-radius: 4px;
}
.task-row:hover { background: rgba(0,0,0,.04); }
.task-row.task-done { opacity: .55; }

.task-row-check { display: flex; align-items: center; justify-content: center; }

.task-check {
  width: 16px; height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.task-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  overflow: hidden;
}
.task-row-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-done .task-row-title span:last-child { text-decoration: line-through; }

.priority-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-row-meta { display: flex; align-items: center; gap: 4px; }

.task-project-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid;
  color: var(--text-muted);
  white-space: nowrap;
}

.status-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.status-planned     { background: rgba(99,102,241,.15);  color: #4338CA; }
.status-todo        { background: rgba(148,163,184,.15); color: #475569; }
.status-in_progress { background: rgba(245,158,11,.15);  color: #92400E; }
.status-done        { background: rgba(16,185,129,.15);  color: #065F46; }

.task-row-due {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.task-row-due.overdue { color: var(--high); font-weight: 500; }

.task-row-assigned { display: flex; align-items: center; justify-content: center; }

.task-row-actions { display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.task-row:hover .task-row-actions { opacity: 1; }

/* ── Avatar ── */
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-sm { width: 22px; height: 22px; font-size: 10px; }

/* ── Kanban ── */
.kanban-board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  min-height: calc(100vh - var(--topbar-h) - 40px);
}

.kanban-col {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--border);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.kanban-col-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-col-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.kanban-col-count {
  background: var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
  transition: background .15s;
  border-radius: var(--radius-sm);
  padding: 4px;
}
.kanban-cards.drag-over {
  background: var(--accent-light);
  outline: 2px dashed var(--accent);
}

.kanban-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  display: flex;
  border: 1px solid var(--border);
  -webkit-user-select: none;
  user-select: none;
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card.dragging { opacity: .35; transform: rotate(1deg); }
.kanban-card.drag-over { box-shadow: inset 0 -3px 0 var(--accent); }

.kanban-sentinel {
  height: 32px;
  border-radius: var(--radius-sm);
  margin: 4px;
  transition: background .1s, box-shadow .1s;
}
.kanban-sentinel.drag-over {
  background: var(--accent-light);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.kanban-card-priority { width: 4px; flex-shrink: 0; }

.kanban-card-body {
  padding: 10px 12px;
  flex: 1;
  min-width: 0;
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.kanban-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.kanban-card-due {
  font-size: 11px;
  color: var(--text-muted);
}
.kanban-card-due.overdue { color: var(--high); font-weight: 500; }

/* ── Forms ── */
.form-row {
  margin-bottom: 14px;
}

.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="date"],
.form-row input[type="datetime-local"],
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.password-field {
  position: relative;
  width: 100%;
}

.form-row .password-field input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--bg);
  color: var(--accent);
  outline: none;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.form-row textarea { resize: vertical; min-height: 72px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.form-error {
  color: var(--high);
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 8px;
}

/* ── Color Picker ── */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--text); transform: scale(1.1); }

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(2px);
  animation: fadeIn .15s ease;
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-md);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
}
.modal--sm { max-width: 420px; }

@keyframes slideUp { from { transform: translateY(12px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title { font-size: 17px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: var(--bg); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* ── Members ── */
.members-list {
  margin-bottom: 8px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }
.member-row--nonmember { opacity: 0.55; }
.member-row--nonmember:hover { opacity: 1; }

.member-name { flex: 1; font-weight: 500; font-size: 13px; }

.member-role {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.role-owner  { background: var(--accent-light); color: var(--accent); }
.role-member { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Lot 1 : actions inline dans une ligne membre ── */
.member-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.member-actions button {
  font-size: 11px; padding: 4px 8px; border-radius: 5px;
}

/* ── Lot 2 : bandeau d'invitation sur l'écran d'auth ── */
.auth-invite-banner {
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.25);
  color: #4338CA;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  line-height: 1.4;
}
.auth-invite-banner strong { color: #312E81; }

.member-btn {
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  transition: background 0.15s;
}
.member-btn--remove {
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  padding: 0 6px;
  line-height: 1;
}
.member-btn--remove:hover { color: var(--high); }
.member-btn--add {
  background: var(--accent-light);
  color: var(--accent);
}
.member-btn--add:hover { background: var(--accent); color: #fff; }

.member-btn--promote {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(99,102,241,.35);
  padding: 3px 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}
.member-btn--promote:hover { background: var(--accent-light); }
.member-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Done separator (list + table) ── */
.done-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #F8FAFC;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.done-separator span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.done-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.tr-done-separator td {
  padding: 8px 16px;
  background: #F8FAFC;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-top: 2px solid var(--border);
}

/* ── Table View ── */
.table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead { background: #F8FAFC; }

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);
}
.data-table th:last-child { border-right: none; }

.th-sort { cursor: pointer; user-select: none; transition: color .15s, background .15s; }
.th-sort:hover { color: var(--text); background: #F1F5F9; }
.th-active { color: var(--accent) !important; }

.th-check { width: 40px; text-align: center; }
.data-table th.th-icon { text-align: center; padding: 8px 10px; width: 40px; }
.th-icon svg { width: 14px; height: 14px; display: inline-block; vertical-align: middle; opacity: .6; }

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table td:last-child { border-right: none; }
.data-table tr:last-child td { border-bottom: none; }

.tr-task { transition: background .1s; cursor: default; }
.tr-task:hover { background: #F8FAFC; }
.tr-done { opacity: .5; }

.td-check { width: 40px; text-align: center; }

.td-title {
  font-weight: 500;
  cursor: pointer;
  width: 99%;
  max-width: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-title:hover { color: var(--accent); }
.td-title-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.td-title-inner span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tr-done .td-title-inner span:last-child { text-decoration: line-through; }

.td-project { white-space: nowrap; }
.td-priority { white-space: nowrap; }

.prio-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.prio-high   { background: rgba(239,68,68,.12);  color: #B91C1C; }
.prio-medium { background: rgba(245,158,11,.12); color: #92400E; }
.prio-low    { background: rgba(16,185,129,.12); color: #065F46; }

.td-due { white-space: nowrap; font-size: 12px; color: var(--text-muted); }
.td-due.overdue { color: var(--high); font-weight: 600; }

.td-assigned {
  width: 56px;
  text-align: center;
  vertical-align: middle;
  vertical-align: middle;
  padding: 0;
}
.td-assigned .avatar-sm {
  margin: 0 auto;
  display: flex;
}

.td-assigned { text-align: center; padding: 0 8px; width: 40px; }
.td-assigned .avatar-sm { margin: 0 auto; display: flex; }
.td-actions { text-align: center; padding: 0 8px; width: 40px; }
.td-actions .btn-icon { opacity: 0; transition: opacity .15s; font-size: 14px; padding: 2px 6px; }
.tr-task:hover .td-actions .btn-icon { opacity: 1; }

.td-muted { color: #CBD5E1; }

/* ── Projects toolbar ── */
.proj-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.btn-collapse-all {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.btn-collapse-all:hover { border-color: var(--accent); color: var(--accent); }

/* ── Projects View ── */
.projects-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.projects-2col {
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
}

.proj-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.proj-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.proj-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .1s;
}
.proj-section-header:hover { background: #F8FAFC; }

.proj-section-chevron {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: transform .2s;
  flex-shrink: 0;
}
.chevron-icon { width: 16px; height: 16px; }
.proj-section.collapsed .proj-section-chevron { transform: rotate(-90deg); }

.proj-section-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.proj-section-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.proj-section-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 8px;
  border-radius: 10px;
}

.proj-section-pct {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.proj-section-progress {
  height: 3px;
  background: var(--border);
}
.proj-section-progress-fill {
  height: 100%;
  background: var(--done);
  transition: width .3s ease;
}
.proj-section.collapsed .proj-section-progress { display: none; }

.proj-section-body {
  border-top: 1px solid var(--border);
}
.proj-section.collapsed .proj-section-body { display: none; }

.proj-section-body .task-row {
  border-radius: 0;
  box-shadow: none;
}

.proj-empty {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.proj-section-footer {
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border);
}

.proj-add-task {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.proj-add-task:hover { color: var(--accent); background: var(--accent-light); }

/* ── Priority popover ── */
.prio-clickable { cursor: pointer; transition: opacity .15s; }
.prio-clickable:hover { opacity: .75; }

.prio-popover {
  position: absolute;
  z-index: 150;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px;
  min-width: 110px;
  animation: fadeIn .1s ease;
}

.prio-pop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: background .1s;
}
.prio-pop-item:hover  { background: var(--bg); }
.prio-pop-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.prio-pop-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Status popover ── */
.status-clickable { cursor: pointer; transition: opacity .15s; }
.status-clickable:hover { opacity: .75; }

.status-popover, .proj-popover {
  position: absolute;
  z-index: 150;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px;
  min-width: 130px;
  animation: fadeIn .1s ease;
}

.status-pop-item, .proj-pop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: background .1s;
}
.status-pop-item:hover, .proj-pop-item:hover { background: var(--bg); }
.status-pop-item.active, .proj-pop-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.status-pop-dot, .proj-pop-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Project clickable ── */
.proj-clickable { cursor: pointer; }
.proj-clickable:hover .task-project-tag { opacity: .75; }
.proj-clickable .td-muted { cursor: pointer; }

/* ── Assignee popover ── */
.assign-clickable { cursor: pointer; }
.assign-clickable:hover .avatar, .assign-clickable:hover .assign-empty { opacity: .7; }

.assign-popover {
  position: absolute;
  z-index: 150;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px;
  min-width: 130px;
  animation: fadeIn .1s ease;
}

.assign-pop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: background .1s;
}
.assign-pop-item:hover  { background: var(--bg); }
.assign-pop-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.assign-pop-none { color: var(--text-muted); font-size: 15px; width: 22px; text-align: center; }

/* ── Toasts ── */
.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast--success { background: var(--done); }
.toast--error   { background: var(--high); }

/* ── Due date popover ── */
.due-popover {
  position: absolute;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.due-pop-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}

.due-pop-input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  width: 100%;
}
.due-pop-input:focus { border-color: var(--accent); }

.due-pop-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.due-pop-clear {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.due-pop-clear:hover { border-color: var(--high); color: var(--high); }

.due-pop-ok {
  padding: 4px 12px;
  font-size: 12px;
}

.due-clickable { cursor: pointer; }
.due-clickable:hover { text-decoration: underline; text-decoration-style: dotted; }

/* ── Calendar View ── */
.calendar-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.calendar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}

.cal-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 10px;
  font-size: 15px;
  line-height: 1;
  transition: all .15s;
}
.cal-nav-btn:hover { background: var(--bg); color: var(--text); border-color: var(--text-muted); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day-header {
  padding: 8px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.cal-day {
  min-height: 96px;
  min-width: 0;
  overflow: hidden;
  padding: 6px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  cursor: pointer;
  transition: background .1s;
  position: relative;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day:hover { background: #F8FAFC; }
.cal-day.cal-other-month { background: var(--bg); }
.cal-day.cal-other-month .cal-day-num { color: #CBD5E1; }
.cal-day.cal-today .cal-day-num {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}

.cal-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}

.cal-tasks { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }

.cal-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  color: #fff;
  cursor: pointer;
  opacity: .9;
  transition: opacity .1s;
}
.cal-chip:hover { opacity: 1; }
.cal-chip.cal-chip-done { opacity: .45; text-decoration: line-through; }
.cal-chip[draggable] { cursor: grab; }
.cal-chip-dragging { opacity: .3 !important; cursor: grabbing; }
.cal-drop-target { background: rgba(99,102,241,.1) !important; outline: 2px dashed #6366F1; outline-offset: -2px; border-radius: 6px; }

.cal-more {
  font-size: 10px;
  color: var(--text-muted);
  padding: 1px 2px;
  cursor: pointer;
}
.cal-more:hover { color: var(--accent); }

/* ── Calendar header center ── */
.cal-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cal-subview-toggle {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}
.cal-sv-btn {
  background: none;
  border: none;
  border-radius: 4px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.cal-sv-btn.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.cal-sv-btn:hover:not(.active) { color: var(--text); }

/* ── Shared day/week header ── */
.cal-week-day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.cal-today-header { background: rgba(99,102,241,.06); }
.cal-week-dow {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.cal-week-num {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.cal-today-num { background: var(--accent); color: #fff; }

/* ── Time Grid (Semaine & Jour) ── */
.cal-time-grid-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--border);
  flex: 1;
}
.cal-time-grid-header {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.cal-time-gutter {
  width: 52px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}
.cal-time-col-header {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-right: 1px solid var(--border);
}
.cal-time-col-header:last-child { border-right: none; }
.cal-time-allday {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  min-height: 32px;
}
.cal-allday-label {
  width: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: 3px 6px;
  border-right: 1px solid var(--border);
  line-height: 1.1;
  text-align: right;
}
.cal-allday-slot {
  flex: 1;
  padding: 2px 3px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: flex-start;
  cursor: pointer;
  transition: background .1s;
}
.cal-allday-slot:last-child { border-right: none; }
.cal-allday-slot:hover { background: #F8FAFC; }
.cal-allday-slot .cal-chip { font-size: 11px; }

.cal-time-grid-body {
  overflow-y: auto;
  flex: 1;
  max-height: calc(100vh - 300px);
}
.cal-time-row {
  display: flex;
  height: 56px;
  border-bottom: 1px solid var(--border);
}
.cal-time-row:last-child { border-bottom: none; }
.cal-time-label {
  width: 52px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 6px 0;
  text-align: right;
  border-right: 1px solid var(--border);
  margin-top: -8px;
}
.cal-time-slot {
  flex: 1;
  overflow: hidden;
  border-right: 1px solid var(--border);
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: background .1s;
}
.cal-time-slot:last-child { border-right: none; }
.cal-time-slot:hover { background: #F8FAFC; }
.cal-time-slot .cal-chip { font-size: 11px; }

.btn-dashed {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  margin-top: 4px;
}
.btn-dashed:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.cal-today-title { color: var(--accent); }

/* ── Mobile Header ── */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.btn-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}
.btn-hamburger svg { width: 26px; height: 26px; }
.btn-hamburger:hover { background: var(--bg); }

.mobile-logo {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  flex: 1;
  text-align: center;
}
.mobile-logo span { color: var(--accent); }

.btn-new-task-mobile {
  padding: 8px 14px;
  font-size: 20px;
  line-height: 1;
  border-radius: var(--radius-sm);
}

/* ── Sidebar Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 299;
}
.sidebar-overlay.show { display: block; }

/* ── Responsive Mobile ── */
@media (max-width: 768px) {

  /* Sidebar : masquée, slide depuis la gauche */
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    z-index: 300;
    transition: left .25s ease;
    box-shadow: none;
    padding-bottom: calc(env(safe-area-inset-bottom) + 32px);
  }
  .sidebar.open {
    left: 0;
    box-shadow: var(--shadow-md);
  }

  /* Header mobile visible */
  .mobile-header { display: flex; }
  .btn-new-task-toolbar { display: none; }

  /* Toolbar : compact, 2 lignes max 4 boutons */
  .view-toolbar {
    padding: 8px 10px;
    gap: 0;
  }
  .view-toggle {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    width: 100%;
  }
  .view-btn {
    font-size: 12px;
    padding: 6px 4px;
    white-space: nowrap;
    justify-content: center;
    min-width: 0;
  }
  .toolbar-btn-group { display: none; }

  /* Contenu : marges réduites */
  .content { padding: 16px 4% 36px; }

  /* Table : scroll horizontal */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Kanban : scroll horizontal */
  .kanban-board { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .kanban-col { min-width: 260px; }

  /* Projets 2 colonnes → 1 colonne */
  .projects-2col { flex-direction: column; }
  .proj-col { width: 100%; }

  /* Modal : plein écran */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 90vh;
  }

  /* Calendar : cellules plus petites */
  .cal-day { min-height: 64px; padding: 4px; }
  .cal-day-header { font-size: 9px; padding: 6px 0; }
  .cal-chip { font-size: 10px; }

  /* ── Drag & Drop : désactivé sur mobile ── */
  .drag-handle { display: none !important; }
  .task-row > :first-child { display: none !important; }  /* drag-handle ou div vide placeholder */
  .td-drag { display: none !important; }
  .drop-sentinel { display: none !important; }

  /* ── Vue Liste : checkbox + point couleur + titre uniquement ── */
  .task-row {
    grid-template-columns: 36px 1fr;
  }
  .task-row-meta,
  .task-row-due,
  .task-row-prio,
  .task-row-status,
  .task-row-assigned,
  .task-row-actions { display: none; }

  /* ── Vue Tableau : transformation flex sur mobile ── */
  .table-wrap { border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
  .data-table, .data-table tbody { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table tr:last-child td { border-bottom: 1px solid var(--border); }
  .tr-task { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); border-right: none; }
  .tr-task td { border: none !important; padding: 0; white-space: nowrap; }
  .td-check { flex: 0 0 28px; text-align: center; width: 28px; }
  .td-title { flex: 1; min-width: 0; max-width: none; overflow: hidden; cursor: pointer; }
  .td-priority, .td-project, .td-due, .td-assigned, .td-actions { display: none !important; }
  .td-status { flex: 0 0 auto; display: table-cell !important; }
  .tr-done-separator { display: block; padding: 8px 12px; border-bottom: 1px solid var(--border); }
  .tr-done-separator td { display: block; }

  /* ── Vue Liste : retour à la ligne sur mobile ── */
  .task-row-title span:last-child { white-space: normal; overflow: visible; text-overflow: unset; }

  /* ── Vue Kanban : colonnes empilées verticalement ── */
  .kanban-board {
    flex-direction: column;
    overflow-x: visible;
    flex-wrap: wrap;
    gap: 12px;
  }
  .kanban-col {
    min-width: 0;
    width: 100%;
    flex: none;
  }

  /* Settings: colonnes par vue cachées sur mobile */
  .settings-cols-wrap { display: none; }
}

/* ── Kanban touch drag ── */
.kanban-touch-float {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  opacity: .88;
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
  transform: rotate(2deg) scale(1.04);
}

.kanban-board.kanban-drag-mode .kanban-cards { display: none; }

.kanban-board.kanban-drag-mode .kanban-col {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
.kanban-board.kanban-drag-mode .kanban-col.drag-target {
  border-color: var(--accent);
  background: rgba(99,102,241,.08);
}
.kanban-board.kanban-drag-mode .kanban-col-header {
  padding: 24px 16px;
  justify-content: center;
}

/* ── Carte View ── */
.carte-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.task-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  display: flex;
  overflow: hidden;
}
.task-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.task-card--done { opacity: .55; }
.task-card--done .task-card-title { text-decoration: line-through; }

.task-card-stripe { width: 4px; flex-shrink: 0; }

.task-card-inner {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.task-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.task-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.task-card-tags { display: flex; gap: 4px; flex-wrap: wrap; }

.task-card-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.task-card-due {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.task-card-due.overdue { color: var(--high); font-weight: 500; }

.task-card-proj { margin-top: 2px; }

/* ── Task Modal ── */
.modal--task { max-width: 480px; }

.task-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0 8px;
}
.task-title-field {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--border);
  outline: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  padding: 6px 0;
  background: transparent;
  transition: border-color .15s;
}
.task-title-field:focus { border-bottom-color: var(--accent); }
.task-title-field::placeholder { color: var(--text-muted); font-weight: 400; }

.task-props-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
}
.task-prop {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.task-prop-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.task-prop-select,
.task-prop-input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.task-prop-select:focus,
.task-prop-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.task-desc-field {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.task-desc-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.task-desc-field::placeholder { color: var(--text-muted); }

/* ── Task Import Modal ── */
.modal--task-import { max-width: 520px; }

.task-import-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.task-import-text {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.task-import-text:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.task-import-text::placeholder { color: var(--text-muted); }

.task-import-help {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 6px;
}

.task-import-preview {
  color: var(--text-muted);
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 4px;
}

/* ── Drag handle ── */
.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  opacity: 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .12s;
  user-select: none;
}
.task-row:hover .drag-handle,
.tr-task:hover .td-drag .drag-handle { opacity: 0; }
.drag-handle:hover { opacity: 1 !important; color: var(--accent); }
.drag-handle:active { cursor: grabbing; }
.task-row.dragging { opacity: 0.3; background: var(--accent-light); }
.tr-task.dragging { opacity: 0.3; }
.task-row.drag-over { box-shadow: inset 0 2px 0 var(--accent); }
.tr-task.drag-over td { box-shadow: inset 0 2px 0 var(--accent); }
.th-drag, .td-drag { width: 24px; padding: 0 2px !important; text-align: center; overflow: visible; }

/* ── Drop sentinel (zone de dépôt en fin de groupe) ── */
.drop-sentinel {
  height: 24px;
  border-radius: 4px;
  margin: 2px 4px;
  transition: background .1s, box-shadow .1s;
}
.drop-sentinel.drag-over {
  background: var(--accent-light);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.drop-sentinel-td { height: 20px; padding: 0 !important; border: none !important; background: none !important; }
tr.drop-sentinel td { border: none !important; }
tr.drop-sentinel.drag-over td { background: var(--accent-light) !important; border: 2px solid var(--accent) !important; }

/* ── Raccourcis (Lot 3) : bouton dans la sidebar + modale dédiée ─────────── */
.sidebar-shortcuts-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  border-top: 1px solid var(--sidebar-border);
  border-radius: 0;
  color: var(--sidebar-text);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  margin-top: auto;
  opacity: .75;
  transition: opacity .15s;
}
.sidebar-shortcuts-btn:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-bright);
  opacity: 1;
}
.sidebar-shortcuts-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Grille dans la modale Raccourcis */
.shortcuts-modal-body { padding: 4px 4px 8px; }
.shortcuts-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  align-items: center;
}
.shortcuts-grid kbd {
  background: var(--bg-elev, rgba(15,23,42,.06));
  color: var(--text, #0F172A);
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Mono', monospace;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border, rgba(0,0,0,.08));
  text-align: center;
  white-space: nowrap;
  min-width: 28px;
  display: inline-block;
}
.shortcuts-grid span {
  font-size: 13px;
  color: var(--text, #0F172A);
}
.shortcuts-hint {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(0,0,0,.06));
  font-size: 12px;
  color: var(--text-secondary, #64748B);
}
.shortcuts-hint kbd {
  font-size: 11px;
  padding: 1px 5px;
  background: var(--bg-elev, rgba(15,23,42,.06));
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 3px;
  font-family: 'SF Mono', 'Fira Mono', monospace;
}
