:root {
  color-scheme: dark;
  --bg:        #0f1117;
  --bg2:       #161b27;
  --bg3:       #1e2535;
  --border:    #2a3245;
  --text:      #e2e8f0;
  --text-muted:#8892a4;
  --accent:    #6366f1;
  --accent-h:  #818cf8;
  --danger:    #ef4444;
  --success:   #22c55e;
  --warning:   #f59e0b;
  --radius:    10px;
  --sidebar-w: 240px;
}

/* ── Light theme ── */
.theme-light {
  color-scheme: light;
  --bg:        #f8fafc;
  --bg2:       #ffffff;
  --bg3:       #f1f5f9;
  --border:    #e2e8f0;
  --text:      #0f172a;
  --text-muted:#334155;
  --accent:    #6366f1;
  --accent-h:  #4f46e5;
  --danger:    #dc2626;
  --success:   #16a34a;
  --warning:   #b45309;
  /* Coupe l'héritage du body (dark) pour tous les enfants */
  color: #0f172a;
  background: #f8fafc;
}
.theme-light .sidebar { box-shadow: 1px 0 0 var(--border); }
.theme-light .task-table thead tr { background: var(--bg3); }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

/* ── Auth ── */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo h1 { font-size: 26px; font-weight: 700; color: var(--accent-h); letter-spacing: -0.5px; }
.auth-logo p  { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
}
.auth-tab.active { background: var(--accent); color: #fff; }

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

/* ── Nav Rail ── */
.nav-rail {
  width: 52px;
  min-width: 52px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 8px;
  flex-shrink: 0;
  z-index: 10;
}
.nav-rail-logo {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; cursor: pointer; border: none;
  background: transparent; transition: background .15s; margin-bottom: 10px;
}
.nav-rail-logo:hover,
.nav-rail-logo.active { background: rgba(99,102,241,.15); }
.nav-rail-user {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding-bottom: 10px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border); width: 100%;
}
.nav-rail-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; cursor: default; user-select: none;
}
.nav-rail-plan {
  font-size: 8px; font-weight: 700; letter-spacing: .06em;
  border-radius: 3px; padding: 1px 4px; text-transform: uppercase;
}
.nav-rail-plan.plan-pro  { background: #4f46e5; color: #fff; }
.nav-rail-plan.plan-free { background: var(--border); color: var(--text-muted); }
.nav-rail-items {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; flex: 1; width: 100%; padding: 0 6px;
}
.nav-rail-bottom {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; width: 100%; padding: 8px 6px 0;
  border-top: 1px solid var(--border); margin-top: 8px;
}
.nav-rail-item {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; cursor: pointer;
  color: var(--text-muted); transition: all .15s;
}
.nav-rail-item:hover { background: var(--bg3); color: var(--text); }
.nav-rail-item.active { background: rgba(99,102,241,.15); color: var(--accent-h); }

/* Rail labels (hidden by default, visible when expanded) */
.nav-rail-label { display: none; font-size: 13px; font-weight: 500; white-space: nowrap; }
.nav-rail-app-name { display: none; font-size: 14px; font-weight: 700; color: var(--accent-h); white-space: nowrap; }
.nav-rail-user-info { display: none; flex-direction: column; gap: 2px; min-width: 0; }
.nav-rail-user-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }

/* Expanded rail */
.nav-rail.rail-expanded { width: 210px; min-width: 210px; align-items: flex-start; }
.nav-rail.rail-expanded .nav-rail-logo {
  width: auto; justify-content: flex-start; gap: 10px; padding: 0 9px; width: 100%; box-sizing: border-box;
}
.nav-rail.rail-expanded .nav-rail-app-name { display: block; }
.nav-rail.rail-expanded .nav-rail-user { flex-direction: row; padding: 8px 12px 10px; gap: 8px; width: 100%; box-sizing: border-box; }
.nav-rail.rail-expanded .nav-rail-user-info { display: flex; }
.nav-rail.rail-expanded .nav-rail-items { align-items: flex-start; padding: 0 8px; }
.nav-rail.rail-expanded .nav-rail-bottom { align-items: flex-start; padding: 8px 8px 0; }
.nav-rail.rail-expanded .nav-rail-item { width: 100%; justify-content: flex-start; gap: 10px; padding: 0 10px; }
.nav-rail.rail-expanded .nav-rail-label { display: block; }

/* Sidebar toggle button in main header (desktop only) */
.sidebar-rail-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0;
  background: none; border: none; border-radius: 7px; cursor: pointer;
  color: var(--text-muted); transition: background .15s, color .15s;
}
.sidebar-rail-toggle:hover { background: var(--bg3); color: var(--text); }
@media (max-width: 768px) { .sidebar-rail-toggle { display: none; } }

/* ── Sidebar panel (boards) ── */
.sidebar {
  width: 0;
  min-width: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .2s ease, min-width .2s ease;
}
.sidebar.sidebar-open { width: var(--sidebar-w); min-width: var(--sidebar-w); }
.sidebar-mobile-nav { display: none; }
.sidebar-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-header-top { display: flex; align-items: center; gap: 9px; }
.sidebar-toggle {
  margin-left: auto; flex-shrink: 0;
  background: none; border: none; padding: 3px 4px; border-radius: 5px;
  cursor: pointer; color: var(--text-muted); display: flex; align-items: center;
  transition: background .15s, color .15s;
}
.sidebar-toggle:hover { background: var(--bg3); color: var(--text); }
.sidebar-section { padding: 10px 8px 4px; }
.sidebar-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--accent);
  padding: 0 8px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
  color: var(--text-muted); transition: all .15s;
  font-size: 13px; font-weight: 500; user-select: none;
}
.sidebar-item:hover { background: var(--bg3); color: var(--text); }
.sidebar-item.active { background: rgba(99,102,241,.15); color: var(--accent-h); }
.sidebar-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sidebar-item .count {
  margin-left: auto; font-size: 11px;
  background: var(--bg3); padding: 1px 7px;
  border-radius: 20px; color: var(--text-muted);
}
.sidebar-add-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  color: var(--text-muted); font-size: 12px; transition: all .15s;
  border: 1px dashed var(--border); margin: 4px 8px;
}
.sidebar-add-btn:hover { color: var(--accent-h); border-color: var(--accent); }
.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--border);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
}
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.user-chip .name { font-size: 13px; font-weight: 500; }
.user-chip .logout {
  margin-left: auto;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  transition: color .15s;
}
.user-chip .logout:hover { color: var(--danger); }

/* ── Main ── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.main-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.main-header h1 {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
}
.board-color-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.view-btn {
  padding: 5px 10px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
}
.view-btn.active { background: var(--bg3); color: var(--text); }
.main-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.search-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text);
  font-size: 13px;
  width: 200px;
  outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--accent); }
.filter-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}
.filter-select:focus { border-color: var(--accent); }

/* ── Table view ── */
.table-wrap {
  flex: 1;
  overflow: auto;
  padding: 16px 24px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  padding: 6px 10px;
  white-space: nowrap;
}
.task-table thead tr {
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
  cursor: pointer;
}
tbody tr:hover { background: var(--bg2); }
tbody td {
  padding: 5px 10px;
  font-size: 13px;
  vertical-align: middle;
}
/* ── Reorderable columns ── */
.task-table,
.task-table thead,
.task-table tbody {
  display: block;
  width: 100%;
}
.task-table thead tr,
.task-table tbody tr:not(.group-header-row):not(.subtask-table-row):not(.quick-add-row) {
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  min-height: 38px;
}
.task-table th,
.task-table td {
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}
.task-table .col-check    { width: 32px;  flex-shrink: 0; }
.task-table .col-title    { flex: 1; min-width: 120px; overflow: hidden; }
.task-table .col-status   { width: var(--col-status-w,   120px); flex-shrink: 0; padding-right: 6px; }
.task-table .col-priority { width: var(--col-priority-w,  90px); flex-shrink: 0; padding-right: 6px; }
.task-table .col-category { width: var(--col-category-w, 130px); flex-shrink: 0; padding-right: 6px; }
.task-table .col-board    { width: var(--col-board-w,    120px); flex-shrink: 0; padding-right: 6px; }
.task-table .col-due_date { width: var(--col-due_date-w, 100px); flex-shrink: 0; padding-right: 6px; }
.task-table .col-url      { width: var(--col-url-w,       50px); flex-shrink: 0; }
.task-table .col-comment  { width: var(--col-comment-w,  140px); flex-shrink: 0; padding-right: 6px; }
.task-table .col-recurrence   { width: var(--col-recurrence-w,   110px); flex-shrink: 0; padding-right: 6px; }
.task-table .col-completed_at { width: var(--col-completed_at-w, 120px); flex-shrink: 0; padding-right: 6px; }
.completed-at-badge { font-size: 11px; color: #22c55e; font-weight: 500; white-space: nowrap; }
.task-table .col-actions  { width: 110px; flex-shrink: 0; order: 999; overflow: visible; }
.task-table .group-header-row { display: block; width: 100%; }
.task-table .group-header-row td { display: block; width: 100%; box-sizing: border-box; }
.task-table .subtask-table-row { display: flex; align-items: center; width: 100%; box-sizing: border-box; }
.task-table thead th[draggable] { cursor: grab; }
.task-table thead th[draggable]:active { cursor: grabbing; }
.task-table thead th.col-drag-over { background: var(--bg3); outline: 1px dashed var(--accent); outline-offset: -2px; }
.task-title-cell {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-title-cell > * { vertical-align: middle; }
.task-title-cell a { color: var(--text); text-decoration: none; }
.task-title-cell a:hover { color: var(--accent-h); }

/* ── Kanban ── */
.kanban-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.kanban-col {
  min-width: 240px;
  max-width: 240px;
  background: var(--bg2);
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 160px);
}
.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.kanban-col-header .status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kanban-col-header .col-name {
  font-size: 12px;
  font-weight: 600;
  flex: 1;
}
.kanban-col-header .col-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg3);
  padding: 1px 7px;
  border-radius: 20px;
}
.kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kanban-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all .15s;
}
.kanban-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.kanban-card .card-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.kanban-card .card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.kanban-col-add {
  padding: 8px;
  border-top: 1px solid var(--border);
}
.kanban-col-add button {
  width: 100%;
  padding: 6px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: all .15s;
}
.kanban-col-add button:hover { color: var(--accent-h); border-color: var(--accent); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.priority-low      { background: rgba(100,116,139,.2); color: #94a3b8; }
.priority-medium   { background: rgba(59,130,246,.2);  color: #60a5fa; }
.priority-high     { background: rgba(245,158,11,.2);  color: #fbbf24; }
.priority-critical { background: rgba(239,68,68,.2);   color: #f87171; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg2); color: var(--text); }
.btn-danger { background: rgba(239,68,68,.15); color: var(--danger); border: 1px solid transparent; }
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-danger:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px; width: 30px; height: 30px; justify-content: center; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  opacity: .65;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .7px;
}
.form-control {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px 2px;
  margin-bottom: 12px;
}
.form-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--accent);
  margin-bottom: 12px;
}

/* ── Custom color select ── */
.csel-wrap { position:relative; }
.csel-btn {
  width:100%; display:flex; align-items:center; gap:8px;
  background:var(--bg); border:1px solid var(--border); border-radius:8px;
  padding:9px 12px; font-size:13px; color:var(--text); cursor:pointer;
  transition:border-color .15s, box-shadow .15s;
}
.csel-btn:hover { border-color:var(--accent); }
.csel-btn:focus { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); outline:none; }
.csel-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; box-shadow:0 0 0 1px rgba(0,0,0,.15); }
.csel-label { flex:1; text-align:left; }
.csel-chevron { flex-shrink:0; color:var(--text-muted); transition:transform .15s; }
.csel-list {
  position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:300;
  background:var(--bg2); border:1px solid var(--border); border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.3); overflow:hidden;
  animation:fadeInDown .12s ease;
}
.csel-item {
  display:flex; align-items:center; gap:8px;
  padding:8px 12px; font-size:13px; cursor:pointer; transition:background .1s;
}
.csel-item:hover { background:var(--bg3); }
.csel-item--active { background:var(--bg3); font-weight:600; }

/* Inline table variant — teleported to body */
.csel-backdrop { position:fixed; inset:0; z-index:299; }
.csel-list--fixed { position:fixed; width:max-content; min-width:120px; max-width:260px; z-index:300; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-lg { max-width: 700px; }
.modal-header {
  display: flex;
  align-items: center;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; flex: 1; }
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* ── Volet tâche : panneau latéral glissant depuis la droite ── */
.task-panel-overlay {
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(0,0,0,.5);
}
.task-panel {
  width: max(480px, 33vw);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-right: none;
  animation: task-panel-in .22s ease;
}
@keyframes task-panel-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ── Notes panel inside modal ── */
.notes-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 0 4px;
  user-select: none;
}
.notes-toggle:hover { color: var(--text); }

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 10px;
}
.empty-state svg { opacity: .3; }
.empty-state p { font-size: 14px; }

/* ── Settings panel ── */
.settings-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.settings-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
}
.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
}
.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.settings-item:last-child { border-bottom: none; }
.settings-item[draggable] { cursor: default; }
.settings-item.dragging { opacity: .35; }
.settings-item.drag-over { background: var(--bg3); outline: 1px dashed var(--accent); outline-offset: -2px; }
.drag-handle { color: var(--text-muted); cursor: grab; font-size: 16px; flex-shrink: 0; line-height: 1; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.color-dot-edit {
  width: 16px; height: 16px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,.2);
  flex-shrink: 0;
}

/* ── Misc ── */
.due-date-today { color: var(--warning); }
.due-date-overdue { color: var(--danger); }
.link-icon { font-size: 16px; }
input[type=color] { cursor: pointer; width: 32px; height: 32px; border: none; background: none; padding: 0; border-radius: 4px; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

[v-cloak] { display: none !important; }

/* ── Status type selector ── */
.status-type-selector {
  display: flex; gap: 4px;
  background: var(--bg3); border-radius: 8px; padding: 4px;
}
.stype-option {
  flex: 1; padding: 7px 10px; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-weight: 500; text-align: center;
  transition: all .15s; color: var(--text-muted); user-select: none;
  opacity: .5;
}
.stype-option:hover { opacity: .8; }
.stype-active { opacity: 1; outline: 2px solid currentColor; outline-offset: -1px; }
.stype-not_started { background: rgba(239,68,68,.15);  color: #f87171; }
.stype-in_progress { background: rgba(245,158,11,.15); color: #fbbf24; }
.stype-completed   { background: rgba(34,197,94,.2);   color: #22c55e; }
.status-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px;
}

/* ── Subtasks ── */
.subtask-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 6px; margin-bottom: 2px;
  transition: background .1s;
}
.subtask-item:hover { background: var(--bg3); }
.subtask-title { flex: 1; font-size: 13px; transition: opacity .15s; }
.subtask-title.done { text-decoration: line-through; opacity: .45; }
.subtask-progress { height: 3px; background: var(--border); border-radius: 2px; margin: 6px 0 10px; }
.subtask-progress-bar { height: 100%; background: var(--success); border-radius: 2px; transition: width .3s; }
.subtask-count {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--text-muted);
  background: var(--bg3); padding: 1px 6px; border-radius: 20px;
}
.subtask-count.some-done { color: var(--success); }

/* ── Emoji ── */
.emoji-display { font-size: 16px; line-height: 1; margin-right: 6px; display: inline-block; vertical-align: middle; }
.emoji-quick-pick {
  display: flex; flex-wrap: wrap; gap: 4px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px; margin-top: 6px; max-width: 300px;
}
.emoji-pick {
  font-size: 18px; cursor: pointer; padding: 3px 4px;
  border-radius: 4px; transition: background .1s; line-height: 1;
}
.emoji-pick:hover { background: var(--border); }
.emoji-clear {
  font-size: 11px; color: var(--danger); cursor: pointer; padding: 3px 6px;
  border-radius: 4px; align-self: center;
}
.emoji-clear:hover { background: rgba(239,68,68,.1); }

/* ── Color picker ── */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.color-picker-input {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  padding: 1px;
  flex-shrink: 0;
}
.color-picker-input:hover { border-color: var(--text-muted); }

/* ── Completion ── */
.task-done .task-title-cell { text-decoration: line-through; opacity: .5; }
.check-btn {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.check-btn:hover { border-color: var(--success); background: rgba(34,197,94,.1); }
.check-btn.checked { border-color: var(--success); background: var(--success); }
.check-btn.checked::after { content: '✓'; font-size: 11px; color: #fff; font-weight: 700; }
.kanban-card.done { opacity: .5; }
.kanban-card.done .card-title { text-decoration: line-through; }
.recurrence-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--text-muted);
  background: var(--bg3); border-radius: 20px; padding: 2px 6px;
}

/* ── Agenda ── */
.agenda-nav {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.agenda-title { font-size: 15px; font-weight: 600; flex: 1; text-align: center; }
.agenda-btn { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); cursor: pointer; font-size: 12px; transition: all .15s; }
.agenda-btn:hover { background: var(--bg3); }
.agenda-view-toggle { display: flex; gap: 2px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.agenda-view-btn { padding: 5px 12px; border-radius: 5px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 12px; font-weight: 500; transition: all .15s; }
.agenda-view-btn.active { background: var(--bg3); color: var(--text); }

/* Day view */
.agenda-day-wrap { flex: 1; overflow-y: auto; padding: 20px 24px; }
.agenda-day-empty { color: var(--text-muted); font-size: 13px; padding: 20px 0; }
.agenda-task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 6px;
  background: var(--bg2); border: 1px solid var(--border); cursor: pointer;
  transition: border-color .15s;
}
.agenda-task-row:hover { border-color: var(--accent); }
.agenda-task-row.done { opacity: .5; }
.agenda-task-row.done .agenda-task-title { text-decoration: line-through; }
.agenda-task-title { flex: 1; font-size: 13px; font-weight: 500; }

/* Week view */
.agenda-week-wrap { flex: 1; overflow-y: auto; overflow-x: hidden; }
.agenda-week-grid { display: grid; grid-template-columns: repeat(7,1fr); overflow: hidden; }
.agenda-week-head-cell {
  position: sticky; top: 0; z-index: 1; background: var(--bg2);
  padding: 10px 8px; text-align: center; font-size: 11px; font-weight: 600;
  color: var(--text-muted); border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border); text-transform: uppercase;
}
.agenda-week-head-cell.today { color: var(--accent-h); }
.agenda-week-cell {
  padding: 8px; border-right: 1px solid var(--border); min-height: 120px;
  display: flex; flex-direction: column; gap: 4px;
  overflow: hidden; min-width: 0;
}
.agenda-week-cell.today { background: rgba(99,102,241,.04); }
.agenda-task-chip {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg3); border-radius: 5px; padding: 4px 7px; cursor: pointer;
  font-size: 11px; font-weight: 500; border-left: 3px solid var(--accent);
  transition: opacity .15s; line-height: 1.3;
  overflow: hidden; min-width: 0;
}
.agenda-chip-title {
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; flex: 1;
}
.agenda-task-chip:hover { opacity: .8; }
.agenda-task-chip.done { text-decoration: line-through; opacity: .45; }
.agenda-chip-more { font-size: 10px; color: var(--text-muted); padding: 2px 4px; cursor: pointer; }
.agenda-chip-more:hover { color: var(--accent-h); }

/* Month view */
.agenda-month-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.agenda-month-dow { display: grid; grid-template-columns: repeat(7,1fr); border-bottom: 1px solid var(--border); flex-shrink: 0; overflow: hidden; }
.agenda-month-dow span { padding: 8px; text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; border-right: 1px solid var(--border); }
.agenda-month-grid { flex: 1; display: grid; grid-template-columns: repeat(7,1fr); grid-auto-rows: 1fr; overflow-y: auto; overflow-x: hidden; }
.agenda-month-cell {
  padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  min-height: 90px; display: flex; flex-direction: column; gap: 3px;
  overflow: hidden; min-width: 0;
}
.agenda-month-cell.other-month { opacity: .35; }
.agenda-month-cell.has-tasks { box-shadow: inset 0 0 0 2px var(--accent); }
.agenda-month-cell.has-tasks.other-month { opacity: 1; }
.agenda-month-cell.today .agenda-day-num {
  background: var(--accent); color: #fff; border-radius: 50%;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
}
.agenda-day-num { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 3px; width: 22px; min-height: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.agenda-recap-dots { display: flex; gap: 2px; align-items: center; }
.agenda-recap-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.agenda-recap-dot--done   { background: var(--success, #22c55e); }
.agenda-recap-dot--missed { background: var(--danger,  #ef4444); }
.agenda-month-chip {
  font-size: 10px; padding: 1px 5px; border-radius: 3px; cursor: pointer;
  border-left: 2px solid var(--accent); background: var(--bg3); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; line-height: 1.5;
  transition: opacity .15s; flex-shrink: 0;
}
.agenda-month-chip:hover { opacity: .75; }
.agenda-month-chip.done { text-decoration: line-through; opacity: .4; }
.agenda-month-more { font-size: 10px; color: var(--accent-h); cursor: pointer; padding: 0 2px; }
.agenda-wrap-text .agenda-chip-title { white-space: normal; text-overflow: unset; }
.agenda-wrap-text .agenda-task-chip { align-items: flex-start; }
.agenda-wrap-text .agenda-month-chip { white-space: normal; overflow: visible; text-overflow: unset; }

/* ── Dashboard ── */
.dash-wrap { flex: 1; overflow-y: auto; padding: 24px; }
.dash-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
.dash-stat {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 6px;
}
.dash-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); }
.dash-stat-value { font-size: 32px; font-weight: 700; line-height: 1; }
.dash-stat-sub   { font-size: 11px; color: var(--text-muted); }
.dash-stat.green .dash-stat-value { color: var(--success); }
.dash-stat.red   .dash-stat-value { color: var(--danger); }
.dash-stat.orange .dash-stat-value { color: var(--warning); }
.dash-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.dash-chart-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 20px;
}
.dash-chart-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 16px; }
.dash-chart-full { grid-column: 1 / -1; }
.chart-container { position: relative; }

/* ── Views ── */
.sidebar-view-item {
  padding-left: 28px !important;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
}
.sidebar-view-item .view-del-btn {
  display: none;
  position: absolute;
  right: 10px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1;
  padding: 2px 3px;
}
.sidebar-view-item:hover .view-del-btn { display: inline; }
.sidebar-view-item .view-del-btn:hover { color: var(--danger); }

.active-view-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.3);
  color: #818cf8;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  margin: 0 24px 8px;
}
.active-view-chip button {
  background: none;
  border: none;
  color: #818cf8;
  cursor: pointer;
  font-size: 13px;
  padding: 0 3px;
  line-height: 1;
  opacity: .7;
  transition: opacity .15s;
}
.active-view-chip button:hover { opacity: 1; color: var(--danger); }

/* ── Filter row 2 ── */
.main-filters-row2 {
  padding-top: 6px;
  margin-top: 0;
}
.sort-dir-btn {
  padding: 5px 8px !important;
  flex-shrink: 0;
}

/* ── Group headers in table ── */
.group-header-row td {
  background: var(--bg2);
  padding: 0 !important;
}
.group-header-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-left: 3px solid var(--border);
}
.group-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.group-count {
  background: var(--bg3);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Notion-style toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}
.toolbar-item {
  position: relative;
}
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.toolbar-btn:hover { background: var(--bg2); color: var(--text); border-color: var(--border); }
.toolbar-btn.active { background: rgba(99,102,241,.12); color: var(--accent-h); border-color: rgba(99,102,241,.25); }
.toolbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 2px;
}
.toolbar-badge-text {
  font-size: 11px;
  color: var(--accent-h);
  margin-left: 2px;
}
.toolbar-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 200;
  overflow: hidden;
}
.panel-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.panel-row:last-child { border-bottom: none; }
.panel-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
}

/* ── Inline editing ── */
.inline-editable {
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 3px;
  margin: -1px -3px;
  transition: background .1s;
}
.inline-editable:hover { background: var(--bg3); }
.inline-edit-placeholder {
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 4px;
}
.inline-edit-placeholder:hover { background: var(--bg3); }
.inline-edit-input {
  background: var(--bg3);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  width: 100%;
  font-family: inherit;
}
.inline-edit-select {
  background: var(--bg3);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  max-width: 140px;
}
tbody tr { cursor: default; }

/* ── Inline category form ── */
.inline-cat-form {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

/* ── Emoji modal ── */
.emoji-modal {
  max-width: 480px;
  height: 500px;
}
.emoji-cat-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}
.emoji-cat-tab {
  padding: 5px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  transition: background .1s;
  flex-shrink: 0;
  line-height: 1;
}
.emoji-cat-tab:hover { background: var(--bg3); }
.emoji-cat-tab.active { background: rgba(99,102,241,.2); }
.emoji-grid-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}
.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.emoji-pick-lg {
  font-size: 22px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .1s;
  line-height: 1;
}
.emoji-pick-lg:hover { background: var(--bg3); }
.emoji-pick-lg.selected { background: rgba(99,102,241,.25); outline: 2px solid var(--accent); }

/* ── Subtask table rows ── */
.subtask-table-row td {
  background: rgba(255,255,255,.015);
  border-bottom: 1px solid var(--border);
}
.subtask-table-row .task-title-cell { padding-left: 20px; }
.subtask-table-row .col-check { width: 48px; overflow: visible; }
.subtask-table-row.task-done td { opacity: .55; }

/* ── Expand button ── */
.expand-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 11px; padding: 0 4px 0 0;
  line-height: 1; transition: color .1s; vertical-align: middle;
  display: inline-block;
}
.expand-btn:hover { color: var(--text); }

/* ── Filter checkbox list ── */
.filter-section { border-bottom: 1px solid var(--border); }
.filter-section:last-child { border-bottom: none; }
.filter-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--text-muted); user-select: none; transition: color .1s;
}
.filter-section-header:hover { color: var(--text); }
.filter-section-toggle { font-size: 10px; transition: transform .15s; }
.filter-section-body { padding: 4px 12px 10px; }
.filter-check-list {
  display: flex; flex-direction: column; gap: 4px; max-height: 130px; overflow-y: auto;
}
.filter-check-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; cursor: pointer; padding: 2px 0;
}
.filter-check-item:hover .badge { opacity: .85; }

/* ── Timer button ── */
.timer-btn { font-family: inherit; font-variant-numeric: tabular-nums; }
.timer-btn.running { color: #f87171; width: auto; padding: 4px 7px; font-size: 11px; white-space: nowrap; }
.timer-btn.running:hover { background: rgba(239,68,68,.1); color: #f87171; }

/* ── Agenda tabs ── */
.agenda-tab-bar {
  display: flex; gap: 4px; background: var(--bg3);
  border-radius: 8px; padding: 3px; width: fit-content; margin-bottom: 14px;
}
.agenda-tab {
  padding: 5px 14px; border: none; border-radius: 6px;
  background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 12px; font-weight: 500; transition: all .15s;
}
.agenda-tab.active { background: var(--bg2); color: var(--text); }

/* ── Log view ── */
.log-day-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.log-day-total { font-weight: 600; color: var(--accent-h); }
.log-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px; cursor: pointer;
  transition: background .1s; margin-bottom: 2px;
}
.log-row:hover { background: var(--bg3); }
.log-task-name { flex: 1; font-size: 13px; font-weight: 500; }
.log-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.log-duration { font-size: 12px; font-weight: 600; color: var(--accent-h); white-space: nowrap; min-width: 40px; text-align: right; }
.log-running { font-size: 11px; color: #f87171; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.log-note { font-size: 11px; color: var(--text-muted); font-style: italic; }
.log-week-day { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.log-week-day-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; display: flex; justify-content: space-between; }

/* ── Task modal time log section ── */
.time-log-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 6px; font-size: 12px;
  transition: background .1s; margin-bottom: 2px;
}
.time-log-item:hover { background: var(--bg3); }
.time-log-time-str { color: var(--text-muted); flex: 1; }
.time-log-dur { font-weight: 600; color: var(--accent-h); min-width: 42px; text-align: right; }
.time-log-form { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }

/* ── Timer bar ── */
.timer-bar {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(90deg,#1a1040,#2d1060);
  border-bottom: 1px solid #6366f155;
  padding: 0 20px; height: 44px; cursor: pointer;
  animation: timerBarIn .25s ease;
}
@keyframes timerBarIn { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }
.timer-bar-left  { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.timer-bar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.timer-bar-dot   { width: 8px; height: 8px; border-radius: 50%; background: #f87171; flex-shrink: 0; animation: pulse 1.2s ease-in-out infinite; }
.timer-bar-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: #a78bfa; flex-shrink: 0; }
.timer-bar-task  { font-size: 13px; font-weight: 500; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-bar-time  { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: #f8fafc; letter-spacing: 1px; }
.timer-bar-stop  { background: rgba(239,68,68,.2); border: 1px solid rgba(239,68,68,.4); color: #f87171; border-radius: 6px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s; white-space: nowrap; }
.timer-bar-stop:hover { background: rgba(239,68,68,.35); }

/* ── Row action menu ── */
.row-menu-wrap { position: relative; }
.row-menu {
  position: absolute; right: 0; top: calc(100% + 2px); z-index: 300;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px; min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: fadeInDown .12s ease;
}
@keyframes fadeInDown { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:translateY(0)} }
.row-menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text); background: none; border: none;
  cursor: pointer; text-align: left; transition: background .1s;
}
.row-menu-item:hover { background: var(--bg3); }
.row-menu-danger { color: var(--danger); }
.row-menu-danger:hover { background: rgba(239,68,68,.08); }

/* ── Quick-add row ── */
.quick-add-row { display: block !important; width: 100%; }
.quick-add-row td { display: block; width: 100%; padding: 0 !important; border-bottom: none !important; box-sizing: border-box; }
.quick-add-link {
  display: block; padding: 6px 14px 6px 42px;
  font-size: 12px; color: var(--text-muted);
  cursor: pointer; transition: color .15s, background .15s;
}
.quick-add-link:hover { color: var(--accent-h); background: var(--bg3); }

/* ── Column resizer ── */
.task-table th { position: relative; }
.col-resizer {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 5px; cursor: col-resize;
  background: transparent; transition: background .15s;
}
.col-resizer:hover, .col-resizer:active { background: var(--accent-h); opacity: .5; }

/* ══════════════ LANDING PAGE ══════════════ */
.lp-wrap {
  height: 100vh; overflow-y: auto;
  background: #fff; color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Nav */
.lp-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 16px;
  padding: 0 48px; height: 64px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
}
.lp-nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.lp-nav-logo h2 { font-size: 18px; font-weight: 700; color: #4f46e5; }
.lp-nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lp-nav-lang { display: flex; gap: 4px; margin-right: 8px; }
.lp-nav-lang button { background: none; border: 1px solid #e2e8f0; border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: #64748b; transition: all .15s; }
.lp-nav-lang button.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.lp-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all .15s; text-decoration: none; }
.lp-btn-ghost { background: transparent; color: #4f46e5; border: 1px solid #e2e8f0; }
.lp-btn-ghost:hover { background: #f1f5f9; border-color: #c7d2fe; }
.lp-btn-primary { background: #4f46e5; color: #fff; }
.lp-btn-primary:hover { background: #4338ca; }

/* Hero */
.lp-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 100px 24px 80px;
  background: linear-gradient(160deg, #f8f7ff 0%, #eef2ff 50%, #f0fdf4 100%);
}
.lp-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe;
  border-radius: 999px; padding: 4px 14px; font-size: 12px; font-weight: 600;
  margin-bottom: 28px;
}
.lp-hero h1 {
  font-size: clamp(36px, 6vw, 64px); font-weight: 800; line-height: 1.1;
  letter-spacing: -1.5px; color: #0f172a; white-space: pre-line; margin-bottom: 24px;
}
.lp-hero h1 span { color: #4f46e5; }
.lp-hero p { font-size: 18px; color: #475569; max-width: 560px; line-height: 1.6; margin-bottom: 40px; }
.lp-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.lp-hero-login { font-size: 13px; color: #94a3b8; }
.lp-hero-login a { color: #4f46e5; cursor: pointer; font-weight: 500; }
.lp-hero-login a:hover { text-decoration: underline; }
.lp-hero-img {
  margin-top: 60px; width: 100%; max-width: 860px;
  background: #1e2535; border-radius: 16px; overflow: hidden;
  box-shadow: 0 32px 80px rgba(79,70,229,.18), 0 4px 16px rgba(0,0,0,.12);
  border: 1px solid #2a3245;
}
.lp-hero-img-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px; background: #161b27; border-bottom: 1px solid #2a3245;
}
.lp-hero-img-dot { width: 10px; height: 10px; border-radius: 50%; }
.lp-hero-img-inner { padding: 24px; display: flex; gap: 16px; }
.lp-mock-sidebar { width: 160px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.lp-mock-sidebar-item { height: 28px; border-radius: 6px; background: #2a3245; }
.lp-mock-sidebar-item.active { background: rgba(99,102,241,.3); }
.lp-mock-main { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.lp-mock-row { height: 36px; border-radius: 6px; background: #2a3245; }
.lp-mock-row.header { background: #1e2535; border: 1px solid #2a3245; height: 28px; }

/* Features */
.lp-features { padding: 96px 48px; background: #fff; }
.lp-section-header { text-align: center; margin-bottom: 56px; }
.lp-section-header h2 { font-size: 36px; font-weight: 800; letter-spacing: -.5px; color: #0f172a; margin-bottom: 12px; }
.lp-section-header p { font-size: 17px; color: #64748b; }
.lp-feat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; max-width: 1100px; margin: 0 auto;
}
.lp-feat-card {
  padding: 28px; border-radius: 14px;
  border: 1px solid #e2e8f0; background: #fafafa;
  transition: box-shadow .2s, transform .2s;
}
.lp-feat-card:hover { box-shadow: 0 8px 32px rgba(79,70,229,.1); transform: translateY(-2px); }
.lp-feat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: #eef2ff; display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: #4f46e5;
}
.lp-feat-card h3 { font-size: 16px; font-weight: 700; color: #0f172a; margin-bottom: 8px; }
.lp-feat-card p { font-size: 14px; color: #64748b; line-height: 1.6; }

/* Pricing */
.lp-pricing { padding: 96px 48px; background: #f8fafc; }
.lp-price-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px; max-width: 900px; margin: 0 auto;
}
.lp-price-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
  padding: 32px; display: flex; flex-direction: column; gap: 24px;
  transition: box-shadow .2s;
}
.lp-price-card.featured {
  border-color: #6366f1; border-width: 2px;
  box-shadow: 0 8px 40px rgba(99,102,241,.15);
}
.lp-price-badge {
  display: inline-block; background: #eef2ff; color: #4f46e5;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; padding: 3px 10px; border-radius: 999px; margin-bottom: 8px;
}
.lp-price-card h3 { font-size: 20px; font-weight: 700; color: #0f172a; }
.lp-price-amount { display: flex; align-items: baseline; gap: 4px; }
.lp-price-amount .price { font-size: 48px; font-weight: 800; color: #0f172a; letter-spacing: -1px; }
.lp-price-amount .per { font-size: 14px; color: #94a3b8; }
.lp-price-features { list-style: none; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.lp-price-features li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #475569; }
.lp-price-features li svg { color: #22c55e; flex-shrink: 0; }
.lp-price-features li.muted { color: #94a3b8; }
.lp-price-features li.muted svg { color: #cbd5e1; }

/* Footer */
.lp-footer {
  padding: 32px 48px; background: #0f172a; color: #94a3b8;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; flex-wrap: wrap; gap: 12px;
}
.lp-footer-logo { display: flex; align-items: center; gap: 8px; color: #e2e8f0; font-weight: 600; }

/* ── Tri manuel (drag-and-drop) ── */
.task-row-dragging { opacity: .3; }
.task-row-drag-over-before { border-top: 2px solid var(--accent) !important; }
.task-row-drag-over-after  { border-bottom: 2px solid var(--accent) !important; }
.group-header-drag-over td { background: color-mix(in srgb, var(--accent) 8%, transparent) !important; }

/* ── Undo toast ── */
.undo-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 2000;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  pointer-events: none;
  white-space: nowrap;
}
.undo-toast-enter-active,
.undo-toast-leave-active { transition: opacity .18s, transform .18s; }
.undo-toast-enter-from,
.undo-toast-leave-to { opacity: 0; transform: translateX(-50%) translateY(8px); }

/* ══════════════ OPTIMIZE ══════════════ */

/* Toolbar button */
.opt-toolbar-btn { font-weight: 600; color: #f59e0b !important; border-color: #f59e0b33 !important; }
.opt-toolbar-btn:hover { background: #f59e0b18 !important; }

/* Full-screen overlay */
.opt-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}

/* Modal shell */
.opt-modal {
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  width: 100%; max-width: 980px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}

/* Header */
.opt-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border); gap: 16px;
}
.opt-header-text h2 { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.opt-header-text p  { font-size: 13px; color: var(--text-muted); margin: 0; }

/* Progress bar */
.opt-progress-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; background: var(--bg2); border-bottom: 1px solid var(--border);
}
.opt-progress-track {
  flex: 1; height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden;
}
.opt-progress-fill {
  height: 100%; background: linear-gradient(90deg, #22c55e, #6366f1);
  border-radius: 3px; transition: width .35s ease;
}
.opt-progress-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.opt-progress-label b { color: var(--text); }

/* Two-column body */
.opt-body { display: grid; grid-template-columns: 1fr 340px; flex: 1; min-height: 0; }

/* Left column */
.opt-tasks-col {
  display: flex; flex-direction: column; border-right: 1px solid var(--border); min-height: 0;
}
.opt-col-title {
  padding: 10px 16px; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); border-bottom: 1px solid var(--border);
  background: var(--bg2); flex-shrink: 0;
}
.opt-tasks-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }

/* Task card */
.opt-task-card {
  display: flex; border-radius: 10px; border: 2px solid transparent;
  background: var(--bg2); cursor: pointer; transition: border-color .15s, background .15s;
  overflow: hidden;
}
.opt-task-card:hover { background: var(--bg3); }
.opt-card-focused { border-color: var(--accent) !important; background: var(--bg3) !important; }
.opt-card-tagged  { border-color: var(--tag-color, #64748b) !important; background: var(--bg2); }
.opt-card-tagged .opt-card-inner { opacity: .85; }

/* Colored left bar */
.opt-card-bar { width: 4px; flex-shrink: 0; transition: opacity .2s; border-radius: 0; }
.opt-card-inner { flex: 1; padding: 10px 12px; min-width: 0; }

/* Card title row */
.opt-card-title-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.opt-card-emoji  { font-size: 15px; flex-shrink: 0; }
.opt-card-title  { font-size: 13px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-card-check  { font-size: 14px; font-weight: 700; flex-shrink: 0; }

/* Card meta */
.opt-card-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.opt-due   { font-size: 11px; color: var(--text-muted); }
.opt-board { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; }

/* Tag buttons */
.opt-tag-btns { display: flex; gap: 6px; }
.opt-tag-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 6px; border-radius: 8px; font-size: 12px; font-weight: 600;
  border: none; cursor: pointer;
  transition: filter .12s, transform .08s, box-shadow .12s;
  user-select: none; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.opt-tag-btn:hover { filter: brightness(1.12); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.opt-tag-btn--active { transform: none !important; box-shadow: inset 0 2px 6px rgba(0,0,0,.25) !important; filter: brightness(.92); }
.opt-btn-icon  { font-size: 14px; }
.opt-btn-label { letter-spacing: .01em; }
.opt-btn-key   {
  font-size: 9px; font-family: monospace; background: rgba(0,0,0,.2);
  border-radius: 3px; padding: 1px 4px; font-style: normal; opacity: .8; margin-left: 2px;
}

/* Right column — result */
.opt-result-col {
  display: flex; flex-direction: column; min-height: 0; background: var(--bg2);
}
.opt-result-col .opt-col-title { background: var(--bg3); }
.opt-result-col > * { flex-shrink: 0; }
.opt-result-col > .opt-result-empty,
.opt-result-col > template + div { flex: 1; }

/* Result groups */
.opt-result-group { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.opt-result-group--empty { opacity: .4; }
.opt-result-group-title {
  display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700;
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em;
}
.opt-result-count {
  margin-left: auto; font-size: 11px; font-weight: 600;
  border-radius: 10px; padding: 1px 7px;
}
.opt-result-task {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 3px 0; color: var(--text);
}
.opt-result-task-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-priority-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.opt-result-skip {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; font-size: 12px; color: var(--text-muted);
  border-top: 1px dashed var(--border);
}
.opt-result-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 32px 20px; text-align: center; color: var(--text-muted);
}
.opt-result-empty p { font-size: 13px; margin: 0; }

/* Keyboard hint */
.opt-kbd-hint {
  margin-top: auto; padding: 10px 14px; font-size: 10px; color: var(--text-muted);
  border-top: 1px solid var(--border); text-align: center; flex-shrink: 0;
}

/* Footer */
.opt-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 24px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.opt-apply-btn { display: flex; align-items: center; gap: 7px; font-weight: 600; }

/* Animate tasks entering result panel */
.opt-task-anim-enter-active { transition: all .2s ease; }
.opt-task-anim-enter-from   { opacity: 0; transform: translateX(-10px); }
.opt-task-anim-leave-active { transition: all .15s ease; position: absolute; }
.opt-task-anim-leave-to     { opacity: 0; transform: translateX(10px); }

/* Mobile adapt */
@media (max-width: 768px) {
  .opt-body { grid-template-columns: 1fr; }
  .opt-result-col { border-top: 1px solid var(--border); max-height: 240px; }
  .opt-modal { max-height: 95vh; }
  .opt-tag-btns { gap: 4px; }
  .opt-tag-btn { padding: 5px 4px; font-size: 10px; }
  .opt-btn-label { display: none; }
  .opt-btn-key { display: none; }
}

/* ══════════════ RECAP ══════════════ */
.recap-wrap { padding: 0 24px 40px; }
.recap-controls { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-top: 20px; margin-bottom: 28px; }

/* Bouton date picker */
.recap-date-btn {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 12px; font-size: 13px; font-weight: 500; color: var(--text);
  cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s;
}
.recap-date-btn:hover { background: var(--bg3); border-color: var(--accent); }

/* Backdrop transparent pour fermer le calendrier */
.recap-cal-backdrop { position: fixed; inset: 0; z-index: 199; }

/* Popup calendrier (dropdown) */
.recap-cal-popup {
  position: absolute; top: calc(100% + 6px); left: 0;
  z-index: 200; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; width: 232px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  animation: fadeInDown .15s ease;
}
@keyframes fadeInDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
.recap-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.recap-cal-title { font-size: 13px; font-weight: 600; }
.recap-cal-nav { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 16px; padding: 2px 6px; border-radius: 4px; line-height: 1; }
.recap-cal-nav:hover { background: var(--bg3); color: var(--text); }
.recap-cal-dow { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 2px; }
.recap-cal-dow span { font-size: 10px; color: var(--text-muted); text-align: center; padding: 2px 0; font-weight: 500; }
.recap-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; }
.recap-cal-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3px 1px; border-radius: 6px; cursor: pointer; min-height: 28px;
  transition: background .1s;
}
.recap-cal-day:hover { background: var(--bg3); }
.recap-cal-num { font-size: 11px; font-weight: 500; line-height: 1; }
.recap-cal-other .recap-cal-num { color: var(--text-muted); opacity: .4; }
.recap-cal-today { background: var(--bg3); }
.recap-cal-today .recap-cal-num { color: var(--accent); font-weight: 700; }
.recap-cal-selected { background: var(--accent) !important; }
.recap-cal-selected .recap-cal-num { color: #fff !important; font-weight: 700; }
.recap-cal-dots { display: flex; gap: 2px; margin-top: 2px; }
.recap-cal-dot { width: 4px; height: 4px; border-radius: 50%; flex-shrink: 0; }
.recap-cal-dot--done   { background: #22c55e; }
.recap-cal-dot--missed { background: #ef4444; }
.recap-cal-selected .recap-cal-dot--done   { background: rgba(255,255,255,.9); }
.recap-cal-selected .recap-cal-dot--missed { background: rgba(255,200,200,.9); }
.recap-cal-legend { display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.recap-cal-legend span { display: flex; align-items: center; gap: 4px; }
.recap-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.recap-col { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.recap-col-title {
  display: flex; align-items: center; gap: 7px; padding: 12px 14px; font-size: 13px; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.recap-col-title--success { color: var(--success); }
.recap-col-title--danger  { color: var(--danger); }
.recap-count { margin-left: auto; background: var(--bg3); border-radius: 10px; padding: 1px 7px; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.recap-empty { padding: 20px 14px; font-size: 13px; color: var(--text-muted); text-align: center; }
.recap-board-label { display: flex; align-items: center; gap: 6px; padding: 8px 14px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.recap-task-item { padding: 7px 14px; border-bottom: 1px solid var(--border); }
.recap-task-item:last-child { border-bottom: none; }
.recap-task-row { display: flex; align-items: center; gap: 7px; }
.recap-priority-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.recap-task-title { flex: 1; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-completed-time { font-size: 11px; color: #22c55e; font-weight: 500; flex-shrink: 0; white-space: nowrap; }
.recap-log-row { display: flex; align-items: center; gap: 6px; padding: 2px 0 0 14px; font-size: 11px; color: var(--text-muted); }
.recap-log-range { font-variant-numeric: tabular-nums; flex-shrink: 0; }
.recap-log-note { flex: 1; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-log-dur { margin-left: auto; background: var(--bg3); border-radius: 4px; padding: 1px 6px; flex-shrink: 0; white-space: nowrap; }
.recap-log-total { padding-top: 4px; border-top: 1px solid var(--border); margin-top: 2px; }
.recap-log-total-label { flex: 1; font-style: italic; }
.recap-log-dur--total { font-weight: 500; }

/* Modale recap auto */
.recap-modal { max-width: 480px; }
.recap-modal-header { margin-bottom: 16px; }
.recap-modal-header h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.recap-modal-date { font-size: 13px; color: var(--text-muted); }
.recap-modal-body { display: flex; flex-direction: column; gap: 0; }
.recap-modal-stat { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.recap-modal-stat:last-of-type { border-bottom: none; }
.recap-modal-stat--success { color: var(--success); }
.recap-modal-stat--danger  { color: var(--danger); }
.recap-modal-stat-count { font-size: 22px; font-weight: 700; min-width: 28px; }
.recap-modal-tasks { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.recap-modal-list-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.recap-modal-task { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 0; }

/* ══════════════ MOBILE ══════════════ */

/* ── Hamburger (hidden on desktop) ── */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.mobile-menu-btn:hover { background: var(--bg3); color: var(--text); }

/* ── Mobile overlay ── */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 499;
}

/* ── Mobile task cards ── */
.task-cards-mobile { display: flex; flex-direction: column; gap: 8px; }
.task-card-mobile {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: border-color .15s;
}
.task-card-mobile:hover { border-color: var(--accent); }
.task-card-mobile.task-done { opacity: .6; }
.task-card-mobile.task-done .task-card-mobile-title { text-decoration: line-through; }
.task-card-mobile-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.task-card-mobile-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.task-card-mobile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.group-header-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-left: 3px solid var(--border);
  padding-left: 10px;
  margin-top: 8px;
}
.quick-add-mobile {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  transition: all .15s;
  margin-top: 4px;
}
.quick-add-mobile:hover { color: var(--accent-h); border-color: var(--accent); }

/* ── Breakpoint 768px ── */
@media (max-width: 768px) {
  /* Nav rail caché sur mobile */
  .nav-rail { display: none; }

  /* Sidebar : overlay drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 500;
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
  }
  .mobile-menu-open .sidebar { transform: translateX(0); }

  /* Nav mobile visible dans le drawer */
  .sidebar-mobile-nav { display: block; }

  /* Main prend toute la largeur */
  .main { width: 100%; min-width: 0; }

  /* Hamburger visible */
  .mobile-menu-btn { display: flex; }

  /* Header */
  .main-header { padding: 10px 14px; gap: 8px; }
  .main-header h1 { font-size: 15px; }

  /* Toolbar plus compact */
  .toolbar { padding: 6px 12px; gap: 5px; }
  .search-input { width: 120px; font-size: 12px; }
  .toolbar-btn { padding: 4px 8px; font-size: 11px; }

  /* Table → cartouches déjà gérées par isMobile dans Vue */
  .table-wrap { padding: 10px 12px; }

  /* Kanban : colonnes plus étroites */
  .kanban-wrap { padding: 10px 12px; gap: 8px; }
  .kanban-col { min-width: 200px; max-width: 200px; }

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

  /* Volet tâche : plein écran sur mobile, reste navigable (header sticky + fermeture) */
  .task-panel-overlay { align-items: stretch; padding: 0; }
  .task-panel {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  /* Dashboard : 2 colonnes */
  .dash-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-charts { grid-template-columns: 1fr; }
  .dash-wrap { padding: 14px; }

  /* Agenda */
  .agenda-nav { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
  .agenda-day-wrap { padding: 14px 12px; }
  .agenda-week-head-cell { font-size: 9px; padding: 6px 3px; }
  .agenda-week-cell { padding: 4px 3px; min-height: 80px; }
  .agenda-task-chip { font-size: 10px; padding: 3px 5px; }

  /* Settings */
  .settings-wrap { padding: 14px; }
  .form-row { grid-template-columns: 1fr; }

  /* Recap */
  .recap-columns { grid-template-columns: 1fr; }
  .recap-wrap { padding: 0 12px 32px; }
  .recap-cal-popup { width: calc(100vw - 48px); }
  .recap-controls { gap: 12px; }

  /* Landing */
  .lp-nav { padding: 0 16px; }
  .lp-nav-right { gap: 6px; }
  .lp-nav-lang { margin-right: 4px; }
  .lp-hero { padding: 60px 16px 40px; }
  .lp-hero h1 { letter-spacing: -.5px; }
  .lp-features { padding: 60px 16px; }
  .lp-pricing { padding: 60px 16px; }
  .lp-footer { padding: 20px 16px; flex-direction: column; gap: 8px; text-align: center; }

  /* Timer bar */
  .timer-bar { padding: 0 12px; }
  .timer-bar-label { display: none; }
  .timer-bar-task { font-size: 12px; }
  .timer-bar-time { font-size: 16px; }

  /* Sidebar toggle caché sur mobile (on utilise le hamburger) */
  .sidebar-toggle { display: none; }

  /* Nav labels toujours visibles dans la sidebar overlay */
  .sidebar .nav-label { display: inline !important; }
  .sidebar .sidebar-section-title { display: block !important; }
  .sidebar .sidebar-section { display: block !important; }
  .sidebar .sidebar-footer { display: block !important; }
  .sidebar .count { display: inline !important; }
}
