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

/* ===== LOGIN SCREEN ===== */
.login-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}
.login-box {
  background: var(--surface, #1e293b); border-radius: 16px; padding: 40px;
  width: 100%; max-width: 400px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.08);
}
.login-logo { font-size: 3rem; margin-bottom: 8px; }
.login-title { font-size: 1.8rem; font-weight: 800; color: #fff; margin-bottom: 4px; }
.login-subtitle { font-size: .85rem; color: #94a3b8; margin-bottom: 24px; }
.login-input {
  display: block; width: 100%; padding: 12px 16px; margin-bottom: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; color: #fff; font-size: .9rem; outline: none;
  transition: border-color .15s;
}
.login-input:focus { border-color: #5b9cf6; }
.login-input::placeholder { color: #64748b; }
.login-btn {
  display: block; width: 100%; padding: 12px; margin-top: 8px;
  background: linear-gradient(135deg, #5b9cf6, #7c5cf6); color: #fff;
  border: none; border-radius: 10px; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
}
.login-btn:hover { opacity: .9; }
.login-btn:disabled { opacity: .5; cursor: not-allowed; }
.login-switch { margin-top: 16px; font-size: .8rem; color: #94a3b8; }
.login-switch a { color: #5b9cf6; text-decoration: none; font-weight: 600; }
.login-switch a:hover { text-decoration: underline; }
.login-error {
  background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3);
  color: #ef4444; padding: 10px; border-radius: 8px; font-size: .82rem;
  margin-bottom: 16px;
}

/* ===== Celebrations ===== */
/* Ambiance sounds */
.ambiance-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 8px; opacity: .7; transition: opacity .15s;
}
.ambiance-bar:hover { opacity: 1; }
.ambiance-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface2); cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.ambiance-btn:hover { background: var(--surface3); transform: scale(1.1); }
.ambiance-btn.active { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px rgba(91,156,246,.4); }
.ambiance-volume {
  width: 60px; accent-color: var(--accent); height: 3px;
}

/* Morning ritual */
.morning-modal {
  width: 92vw; max-width: 550px; max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.morning-header {
  padding: 20px 24px 12px; display: flex; align-items: center; justify-content: space-between;
}
.morning-greeting {
  font-size: 1.3rem; font-weight: 800;
}
.morning-close {
  background: none; border: none; font-size: 1.2rem; color: var(--text-muted);
  cursor: pointer; padding: 4px 8px;
}
.morning-close:hover { color: var(--text); }
.morning-body {
  flex: 1; overflow-y: auto; padding: 0 24px 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.morning-section { }
.morning-section-title {
  font-size: .82rem; font-weight: 700; margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.morning-task {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 6px; font-size: .82rem; background: var(--surface2);
  margin-bottom: 4px; cursor: pointer; transition: background .12s;
}
.morning-task:hover { background: var(--surface3); }
.morning-task-bar { width: 3px; align-self: stretch; border-radius: 2px; }
.morning-tip-card {
  background: var(--accent2); border: 1px solid var(--accent); border-radius: 8px;
  padding: 10px 14px; font-size: .82rem; line-height: 1.4;
}
.morning-footer {
  padding: 12px 24px 20px; text-align: center;
}
.morning-footer .btn-primary {
  padding: 10px 32px; font-size: .95rem;
}

/* Highlight next task */
.highlight-next {
  animation: highlightPulse 1s ease-in-out 3;
  box-shadow: 0 0 0 3px var(--accent), 0 0 20px rgba(91,156,246,.3);
  border-radius: 8px;
}
@keyframes highlightPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent), 0 0 20px rgba(91,156,246,.3); }
  50% { box-shadow: 0 0 0 5px var(--accent), 0 0 30px rgba(91,156,246,.5); }
}

.floating-plus {
  position: fixed; z-index: 99999; pointer-events: none;
  font-size: 1.4rem; font-weight: 800; color: #22c55e;
  text-shadow: 0 0 10px rgba(34,197,94,.5);
  opacity: 1; transform: translateY(0);
  transition: all 1s ease-out;
}
.floating-plus.animate {
  opacity: 0; transform: translateY(-80px) scale(1.3);
}
.streak-pulse {
  animation: streakPulse 0.6s ease-out;
}
@keyframes streakPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.2); color: #f59e0b; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Tour guide */
.tour-overlay {
  position: fixed; inset: 0; z-index: 9000;
  pointer-events: none;
}
.tour-cursor {
  position: fixed; z-index: 9002;
  width: 24px; height: 24px;
  pointer-events: none;
  transition: left 0.8s cubic-bezier(.4,0,.2,1), top 0.8s cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
}
.tour-highlight {
  position: fixed; z-index: 9001;
  border: 2px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 0 0 4000px rgba(0,0,0,.45), 0 0 20px rgba(91,156,246,.5);
  transition: all 0.6s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.tour-bubble {
  position: fixed; z-index: 9003;
  max-width: 340px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  font-size: .85rem; line-height: 1.5; color: var(--text);
  animation: bubbleIn .3s ease-out;
  pointer-events: auto;
}
.tour-bubble-title {
  font-weight: 700; font-size: .9rem; margin-bottom: 6px; color: var(--accent);
}
.tour-bubble-text { margin-bottom: 10px; }
.tour-bubble-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.tour-dots { display: flex; gap: 4px; }
.tour-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--surface3);
}
.tour-dot.active { background: var(--accent); }
.tour-btn {
  padding: 6px 16px; border: none; border-radius: 8px;
  font-size: .78rem; font-weight: 700; cursor: pointer;
}
.tour-btn-next { background: var(--accent); color: #fff; }
.tour-btn-next:hover { opacity: .85; }
.tour-btn-skip { background: none; color: var(--text-muted); border: 1px solid var(--border); }

/* Coach bubble */
.coach-bubble {
  position: fixed; bottom: 80px; right: 24px; z-index: 350;
  max-width: 280px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
  font-size: .82rem; line-height: 1.4; color: var(--text);
  animation: bubbleIn .3s ease-out;
  pointer-events: none;
}
.coach-bubble::after {
  content: ''; position: absolute; bottom: -8px; right: 20px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--surface);
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes bubbleOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(10px) scale(0.9); }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,.5); }
* { scrollbar-width: thin; scrollbar-color: rgba(128,128,128,.3) transparent; }

/* ===== DARK THEME ===== */
:root {
  --bg:         #0d1b34;
  --surface:    #132240;
  --surface2:   #1a2d52;
  --surface3:   #223868;
  --border:     #2c4278;
  --border2:    #3a5898;
  --accent:     #5b9cf6;
  --accent2:    rgba(91,156,246,.15);
  --text:       #dce8ff;
  --text-muted: #7a9acc;
  --text-dim:   #3a507a;
  --success:    #34d9c3;
  --radius:     14px;
  --shadow:     0 12px 40px rgba(5,15,40,.7);
  --shadow-sm:  0 2px 12px rgba(5,15,40,.4);
  --work-bg:    linear-gradient(150deg, #0a1628 0%, #0d2a5a 40%, #1648a8 70%, #2d6de0 100%);
  --short-bg:   linear-gradient(150deg, #081824 0%, #094a58 40%, #0d808a 70%, #34d9c3 100%);
  --long-bg:    linear-gradient(150deg, #0d0a28 0%, #261060 40%, #4822a8 70%, #8b5cf6 100%);
  --priority-high: #f87171;
  --priority-low:  #34d9c3;
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg:         #dce8ff;
  --surface:    #eef4ff;
  --surface2:   #e2edff;
  --surface3:   #d4e4ff;
  --border:     #b8ccf0;
  --border2:    #9ab4e8;
  --text:       #0a1428;
  --text-muted: #3a5080;
  --text-dim:   #8aA0c8;
  --shadow:     0 4px 24px rgba(10,30,80,.15);
  --shadow-sm:  0 2px 8px rgba(10,30,80,.1);
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.5;
  transition: background .2s, color .2s;
}

/* ===== APP LAYOUT ===== */
.app { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 230px; min-height: 100vh; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: 18px 12px 16px; gap: 16px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; flex-shrink: 0;
}

/* Logo */
.sidebar-logo {
  display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon {
  width: 36px; height: 36px; background: var(--accent); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.sidebar-logo-text { display: flex; flex-direction: column; gap: 1px; }
.sidebar-logo-name { font-size: 1rem; font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.sidebar-logo-tag { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }

/* Nav groupes */
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group-label {
  font-size: .65rem; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .8px;
  padding: 10px 8px 4px; margin-top: 4px;
}
.nav-group-label:first-child { margin-top: 0; padding-top: 2px; }
.nav-btn {
  width: 100%; text-align: left; padding: 9px 10px; border: none;
  background: transparent; color: var(--text-muted); border-radius: 8px;
  cursor: pointer; font-size: .875rem; font-weight: 500; transition: all .15s;
  display: flex; align-items: center; gap: 10px;
  position: relative;
}
.nav-icon { font-size: .95rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-btn:hover { background: var(--surface2); color: var(--text); }
.nav-btn.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); font-weight: 600;
}
.nav-btn.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}

/* Footer */
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.sidebar-streak {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem; color: var(--text-muted); padding: 6px 8px;
  background: var(--surface2); border-radius: 8px;
}
.sidebar-streak-icon { font-size: 1rem; }

/* Status block */
/* Floating status block */
.status-floating {
  position: fixed; bottom: 80px; right: 24px; z-index: 300;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 0;
  font-size: .78rem; color: var(--text-muted);
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  min-width: 180px;
  overflow: hidden;
}
.status-floating-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer; background: none; border: none;
  color: var(--text); font-size: .82rem; font-weight: 600; width: 100%;
  transition: background .15s;
}
.status-floating-toggle:hover { background: var(--surface2); }
.status-floating-body {
  display: none; padding: 6px 14px 10px;
  flex-direction: column; gap: 4px;
  border-top: 1px solid var(--border);
}
.status-floating.open .status-floating-body { display: flex; }
.status-row {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 0;
}
.status-icon { font-size: .85rem; width: 18px; text-align: center; flex-shrink: 0; }
.status-row span:last-child { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-row strong { color: var(--text); }
.status-next { border-top: 1px solid var(--border); padding-top: 4px; margin-top: 2px; }
.status-overdue { color: #ef4444; font-weight: 600; }
.status-q1 { color: #f59e0b; font-weight: 600; }

.sidebar-footer-actions { display: flex; flex-direction: column; gap: 6px; }
.btn-theme-toggle {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text-muted); border-radius: 8px;
  cursor: pointer; font-size: .84rem; text-align: left; transition: all .15s;
}
.btn-theme-toggle:hover { color: var(--text); border-color: var(--border2); }
.btn-backup {
  padding: 6px 10px; border: 1px solid var(--border); background: var(--surface2);
  color: var(--text-muted); border-radius: 8px; cursor: pointer; font-size: .75rem;
  transition: all .15s; text-align: center;
}
.btn-backup:hover { color: var(--text); border-color: var(--border2); }
.shortcuts-hint {
  font-size: .72rem; color: var(--text-dim); display: flex; flex-direction: column;
  gap: 4px; border-top: 1px solid var(--border); padding-top: 10px; padding-left: 4px;
}
kbd {
  background: var(--surface3); border: 1px solid var(--border2);
  border-radius: 4px; padding: 1px 5px; font-size: .66rem; font-family: monospace;
}

/* ===== MAIN ===== */
.main { flex: 1; overflow-y: auto; min-height: 100vh; }

/* ===== VIEWS ===== */
.view { display: none; }
.view.active { display: block; animation: viewFadeIn .15s ease-out; }
@keyframes viewFadeIn { from { opacity: 0; } to { opacity: 1; } }
.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 10px;
  padding: 28px 28px 0;
}
.view-header h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.5px; }

/* ===== TIMER VIEW LAYOUT ===== */
.timer-view-layout {
  display: flex; gap: 0; align-items: flex-start; min-height: 100vh;
}
.timer-panel {
  width: 360px; min-width: 320px; max-width: 400px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.tasklist-panel { flex: 1; min-width: 0; border-left: 1px solid var(--border); }

/* ===== TIMER BLOCK ===== */
.timer-block {
  min-height: 100vh; padding: 20px 20px 32px;
  background: var(--work-bg);
  display: flex; flex-direction: column; gap: 16px;
  color: #fff; transition: background .6s ease;
}
.timer-block[data-mode="short"] { background: var(--short-bg); }
.timer-block[data-mode="long"]  { background: var(--long-bg); }
/* Quadrant colors during work */
.timer-block[data-mode="work"][data-quad="1"] { background: linear-gradient(150deg,#1a0505 0%,#4a0f0f 40%,#a0231f 70%,#e53935 100%); }
.timer-block[data-mode="work"][data-quad="2"] { background: linear-gradient(150deg,#1a1000 0%,#4a2d00 40%,#a06000 70%,#f57c00 100%); }
.timer-block[data-mode="work"][data-quad="3"] { background: var(--work-bg); }
.timer-block[data-mode="work"][data-quad="4"] { background: linear-gradient(150deg,#101018 0%,#1e1e2e 40%,#35354a 70%,#505068 100%); }

/* Mode tabs */
.timer-block-header {
  display: flex; align-items: center; justify-content: space-between;
}
.mode-tabs {
  display: flex; gap: 2px; background: rgba(0,0,0,.2);
  border-radius: 10px; padding: 3px;
}
.mode-btn {
  padding: 6px 12px; border: none; border-radius: 7px;
  background: transparent; color: rgba(255,255,255,.65);
  cursor: pointer; font-size: .78rem; font-weight: 600; transition: all .15s;
}
.mode-btn.active {
  background: rgba(255,255,255,.2); color: #fff;
  backdrop-filter: blur(4px);
}
.btn-icon-sm {
  width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1); color: #fff; border-radius: 9px;
  cursor: pointer; font-size: .9rem; transition: all .15s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-icon-sm:hover { background: rgba(255,255,255,.22); }

/* Active task banner */
.timer-active-task {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.2); border-radius: 10px; padding: 9px 13px;
  backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.1);
}
.timer-active-task.hidden { display: none; }
.timer-active-color { width: 4px; height: 20px; border-radius: 3px; flex-shrink: 0; }
.timer-active-task span {
  font-size: .84rem; font-weight: 600; opacity: .95; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Ring */
.timer-center { display: flex; justify-content: center; padding: 4px 0; }
.timer-progress-wrap { position: relative; width: 190px; height: 190px; }
.progress-ring { width: 190px; height: 190px; transform: rotate(-90deg); }
.progress-bg { fill: none; stroke: rgba(0,0,0,.2); stroke-width: 11; }
.progress-bar {
  fill: none; stroke: rgba(255,255,255,.95); stroke-width: 11;
  stroke-linecap: round; transition: stroke-dashoffset .9s linear;
  filter: drop-shadow(0 0 10px rgba(180,210,255,.5));
}
.timer-display {
  font-size: 3rem; font-weight: 800; letter-spacing: 2px; color: #fff;
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  pointer-events: none; text-shadow: 0 2px 12px rgba(0,0,0,.3);
}

/* Controls */
.timer-controls { display: flex; align-items: center; justify-content: center; gap: 12px; }
.btn-start {
  padding: 13px 36px; border: 2px solid rgba(255,255,255,.6);
  border-radius: 50px; background: rgba(255,255,255,.18); color: #fff;
  font-size: 1rem; font-weight: 700; cursor: pointer; transition: all .15s;
  backdrop-filter: blur(4px); letter-spacing: .3px;
}
.btn-start:hover { background: rgba(255,255,255,.28); transform: translateY(-1px); }
.btn-start:active { transform: translateY(0); }
.btn-start.running { background: rgba(0,0,0,.25); border-color: rgba(255,255,255,.3); }
.btn-icon {
  width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1); color: #fff; border-radius: 50%;
  font-size: 1.05rem; cursor: pointer; transition: all .15s; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: rgba(255,255,255,.22); }

/* Pom count */
.pomodoro-count {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: .82rem; color: rgba(255,255,255,.8); flex-wrap: wrap;
}
.pomodoro-count input[type=number] {
  width: 40px; padding: 2px 4px; background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.2); border-radius: 6px;
  color: #fff; font-size: .78rem; text-align: center;
}
#pomodoro-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.pom-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.3); }
.pom-dot.done { background: rgba(255,255,255,.9); }

/* Goal bar */
.daily-goal-wrap { display: flex; flex-direction: column; gap: 3px; }
.daily-goal-bar-bg { background: rgba(0,0,0,.25); border-radius: 6px; height: 6px; overflow: hidden; }
.daily-goal-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.8); transition: width .5s; }
.daily-goal-label { font-size: .68rem; color: rgba(255,255,255,.55); text-align: right; }

/* Session assign */
.session-assign {
  display: flex; flex-direction: column; gap: 8px;
  background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 12px;
}
.session-assign.running-locked { opacity: .45; pointer-events: none; }
.session-assign .select-field,
.session-assign .input-field {
  background: rgba(0,0,0,.22); border-color: rgba(255,255,255,.18); color: #fff;
  font-size: .83rem; padding: 8px 11px;
}
.session-assign .select-field option { background: var(--surface2); color: var(--text); }
.session-assign .select-field::placeholder,
.session-assign .input-field::placeholder { color: rgba(255,255,255,.4); }

/* Settings */
.settings-inline {
  display: flex; gap: 6px; flex-wrap: wrap;
  font-size: .72rem; color: rgba(255,255,255,.55);
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px;
  justify-content: center;
}
.settings-inline label { display: flex; align-items: center; gap: 4px; }
.settings-inline input[type=number] {
  width: 38px; padding: 3px 4px; background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.18); border-radius: 5px;
  color: #fff; font-size: .72rem; text-align: center;
}

/* ===== FORMS (global) ===== */
.select-field, .input-field {
  width: 100%; padding: 9px 12px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 9px; color: var(--text);
  font-size: .875rem; outline: none; transition: border-color .15s;
  font-family: inherit;
}
.select-field:focus, .input-field:focus { border-color: var(--accent); }
.select-field:disabled { opacity: .38; cursor: not-allowed; }
option { background: var(--surface2); color: var(--text); }
.textarea-field { resize: vertical; min-height: 72px; font-family: inherit; }

/* ===== TASK LIST BLOCK ===== */
.tasklist-panel { background: var(--bg); overflow-y: auto; height: 100vh; position: sticky; top: 0; }
.tasklist-block { min-height: 100%; background: var(--bg); }

/* Summary bar */
.tl-summary {
  display: flex; align-items: center; gap: 8px; padding: 14px 20px;
  border-bottom: 1px solid var(--border); font-size: .82rem; color: var(--text-muted);
  background: var(--surface); position: sticky; top: 0; z-index: 10;
}
.tl-summary-label {
  font-weight: 800; color: var(--text); font-size: .72rem;
  text-transform: uppercase; letter-spacing: 1px;
}
.tl-summary-dot { color: var(--accent); font-weight: 700; }
.tl-summary-sep { color: var(--border2); }
.tl-summary-spacer { flex: 1; }
.btn-icon-sm.danger {
  border-color: transparent; background: transparent; color: var(--text-muted);
  font-size: .75rem; width: auto; padding: 5px 10px; border-radius: 7px;
}
.btn-icon-sm.danger:hover { color: #ff6b6b; background: rgba(255,107,107,.1); }
.btn-icon-sm.dark { border-color: var(--border); background: var(--surface2); color: var(--text-muted); }
.btn-icon-sm.dark:hover { color: var(--text); }

/* Bulk selection bar */
.tl-bulk-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  background: var(--accent2); border-bottom: 2px solid var(--accent);
  font-size: .8rem; color: var(--text);
}
.tl-bulk-bar.hidden { display: none; }
.tl-bulk-check-all { display: flex; align-items: center; gap: 5px; cursor: pointer; font-weight: 600; font-size: .78rem; }
.tl-bulk-check-all input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
#tl-bulk-count { color: var(--accent); font-weight: 700; }
.tl-bulk-spacer { flex: 1; }

/* Select mode checkboxes on rows */
.tl-row .tl-select-cb { display: none; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 0 6px; flex-shrink: 0; }
.tasklist-panel.select-mode .tl-row .tl-select-cb { display: block; }
.tasklist-panel.select-mode .tl-row .tl-drag { display: none; }
.tl-row.selected { background: var(--accent2) !important; }

/* Quick-add row */
.tl-add-row {
  display: flex; align-items: center; gap: 7px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface);
}
.tl-select {
  padding: 7px 9px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .8rem; outline: none;
  cursor: pointer; transition: border-color .15s; flex-shrink: 0; font-family: inherit;
}
.tl-select:focus { border-color: var(--accent); }
.tl-select:disabled { opacity: .38; }
.tl-select-sub { max-width: 120px; }
.tl-input {
  flex: 1; padding: 8px 12px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  font-size: .875rem; outline: none; transition: border-color .15s; min-width: 100px;
  font-family: inherit;
}
.tl-input:focus { border-color: var(--accent); }
.tl-input::placeholder { color: var(--text-muted); }

/* Pom picker (quick-add mini) */
.qa-pom-pick { display: flex; gap: 3px; }
.qa-pom-btn {
  width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface2); color: var(--text-muted); cursor: pointer;
  font-size: .74rem; font-weight: 700; transition: all .12s;
  display: flex; align-items: center; justify-content: center;
}
.qa-pom-btn:hover, .qa-pom-btn.selected { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Matrix picker (quick-add) */
.qa-matrix-pick { display: flex; gap: 3px; }
.qa-matrix-btn {
  height: 28px; padding: 0 9px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface2); cursor: pointer; font-size: .8rem; font-weight: 600;
  color: var(--text-muted); transition: all .12s; display: flex; align-items: center; gap: 3px;
  opacity: .5;
}
.qa-matrix-btn:hover { opacity: .8; border-color: var(--border2); }
.qa-matrix-btn.active { opacity: 1; border-color: var(--accent); color: var(--text); background: var(--surface3); }

/* Impact picker (quick-add) */
.qa-impact-pick { display: flex; gap: 3px; }
.qa-impact-btn {
  height: 26px; padding: 0 7px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface2); cursor: pointer; font-size: .72rem; font-weight: 800;
  color: var(--text-muted); transition: all .12s; display: flex; align-items: center;
}
.qa-impact-btn:hover { border-color: var(--border2); color: var(--text); }
.qa-impact-btn.selected { border-color: var(--accent); color: var(--accent); background: var(--accent2); }

/* Impact row (modal) */
.task-impact-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; flex-wrap: wrap; }
.task-impact-row label { font-size: .82rem; color: var(--text-muted); min-width: 80px; flex-shrink: 0; }
.indicator-btns { display: flex; gap: 3px; flex-wrap: nowrap; }
.indicator-btn {
  padding: 5px 0; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface2); cursor: pointer; font-size: .65rem; font-weight: 700;
  color: var(--text-muted); transition: all .15s; white-space: nowrap; flex: 1; text-align: center;
  overflow: hidden; text-overflow: ellipsis;
}
.indicator-btn:hover { border-color: var(--border2); color: var(--text); background: var(--surface3); transform: translateY(-1px); }
.indicator-btn.selected { border-color: var(--accent); color: #fff; background: var(--accent); box-shadow: 0 2px 8px rgba(91,156,246,.3); }
.impact-btns { display: flex; gap: 3px; flex-wrap: nowrap; }
.impact-btn {
  padding: 5px 0; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface2); cursor: pointer; font-size: .65rem; font-weight: 700;
  color: var(--text-muted); transition: all .15s; white-space: nowrap; flex: 1; text-align: center;
  overflow: hidden; text-overflow: ellipsis;
}
.impact-btn:hover { border-color: var(--border2); color: var(--text); background: var(--surface3); transform: translateY(-1px); }
.impact-btn.selected { border-color: var(--accent); color: #fff; background: var(--accent); box-shadow: 0 2px 8px rgba(91,156,246,.3); }
.impact-hint { font-size: .74rem; color: var(--accent); font-style: italic; }

/* Date toggle */
.qa-date-input {
  height: 30px; border: 1px solid var(--border); border-radius: 7px; padding: 0 6px;
  background: var(--surface2); color: var(--text); font-size: .78rem; flex-shrink: 0;
  cursor: pointer; transition: border-color .12s; width: 130px;
}
.qa-date-input:focus { outline: none; border-color: var(--accent); }
.tl-overdue-header { color: #ef4444 !important; }
.tl-date-group { border-radius: 8px; transition: background .15s; }
.tl-date-group.date-drag-over { background: var(--surface2); outline: 2px dashed var(--accent); }

.tl-btn-add {
  width: 34px; height: 34px; border: none; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 1.3rem; font-weight: 700;
  cursor: pointer; flex-shrink: 0; transition: all .15s; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.tl-btn-add:hover { opacity: .85; transform: scale(1.06); }

/* Task list */
.tl-list { display: flex; flex-direction: column; }

/* Section headers */
.tl-section-header {
  display: flex; align-items: center; gap: 8px; padding: 9px 18px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  background: var(--surface2); cursor: pointer; user-select: none;
}
.tl-section-header:hover { color: var(--text); }
.tl-section-header .section-count {
  font-weight: 800; color: var(--text); background: var(--border);
  border-radius: 20px; padding: 1px 8px; font-size: .68rem;
}
.tl-section-header .section-time { flex: 1; color: var(--text-dim); font-size: .68rem; }
.tl-section-header .section-arrow { font-size: .72rem; }

/* Task row */
.tl-row {
  display: flex; align-items: center; gap: 0;
  border-bottom: 1px solid var(--border); position: relative; overflow: hidden;
  transition: background .15s, transform .15s, box-shadow .15s; cursor: pointer;
}
.tl-row:hover {
  background: rgba(255,255,255,.06);
  transform: translateX(3px);
  box-shadow: inset 3px 0 0 var(--accent);
}
[data-theme="light"] .tl-row:hover { background: rgba(0,0,0,.024); }
.tl-row.is-active { background: rgba(232,93,74,.07); }
.tl-row.is-done { opacity: .4; }
.tl-row.dragging { opacity: .25; }
.tl-row.drag-over::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--accent); z-index: 2;
}

@keyframes pulse-left {
  0%,100% { border-left-color: var(--accent); }
  50%      { border-left-color: transparent; }
}
.tl-row.is-active { border-left: 3px solid var(--accent); animation: pulse-left 2.5s ease-in-out infinite; }

/* Active progress bar */
.tl-row-progress {
  position: absolute; bottom: 0; left: 0; height: 2px;
  background: var(--accent); opacity: .55; transition: width .9s linear;
  pointer-events: none; z-index: 1;
}

/* Quadrant bar (remplace priority bar) */
.tl-quad-bar { width: 4px; align-self: stretch; flex-shrink: 0; border-radius: 0 2px 2px 0; }
.tl-quad-bar.q1 { background: #ef4444; }
.tl-quad-bar.q2 { background: #f59e0b; }
.tl-quad-bar.q3 { background: var(--accent); }
.tl-quad-bar.q4 { background: transparent; }

/* Quadrant badge inline sur la ligne */
.tl-quad-badge {
  font-size: .64rem; font-weight: 800; padding: 2px 5px; border-radius: 4px;
  flex-shrink: 0; letter-spacing: .3px; margin-right: 4px;
}
.tl-quad-badge.q1 { background: rgba(239,68,68,.18); color: #ef4444; }
.tl-quad-badge.q2 { background: rgba(245,158,11,.18); color: #f59e0b; }
.tl-quad-badge.q3 { background: var(--accent2); color: var(--accent); }
.tl-quad-badge.q4 { background: var(--surface3); color: var(--text-dim); }

.tl-drag { padding: 0 8px 0 13px; color: var(--text-dim); font-size: .95rem; cursor: grab; opacity: .5; }
.tl-drag:hover { opacity: 1; }

.tl-check {
  width: 18px; height: 18px; border: 2px solid var(--border2); border-radius: 50%;
  flex-shrink: 0; cursor: pointer; margin-right: 10px; transition: all .15s;
  display: flex; align-items: center; justify-content: center; font-size: .6rem;
}
.tl-check:hover { border-color: var(--success); }
.tl-check.checked { background: var(--success); border-color: var(--success); color: #fff; }

.tl-cat-col {
  max-width: 240px; flex-shrink: 0; padding: 13px 10px 13px 0;
  font-size: .76rem; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.tl-cat-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px; flex-shrink: 0;
}

.tl-name-col { flex: 1; padding: 8px 10px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-name {
  font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; min-width: 0;
}
.tl-task-meta {
  display: flex; align-items: center; gap: 6px; font-size: .72rem;
}
.tl-cat-inline {
  color: var(--text-muted); font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.tl-subtask-progress { flex-shrink: 0; }
.tl-indicator { font-size: .7rem; flex-shrink: 0; }
.tl-name.done-text { text-decoration: line-through; color: var(--text-muted); }
.tl-sub { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }
.tl-subtask-progress { font-size: .7rem; color: var(--accent); font-weight: 600; white-space: nowrap; }
/* Timer subtasks */
.timer-subtasks { display: flex; flex-direction: column; gap: 6px; padding: 10px 16px; background: rgba(0,0,0,.15); border-radius: 10px; margin: 8px 0; }
.timer-subtask-row { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .84rem; color: rgba(255,255,255,.85); }
.timer-subtask-row input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.timer-subtask-row.done span { text-decoration: line-through; opacity: .5; }
.timer-subtask-row:hover span { color: #fff; }
.tl-note-icon { font-size: .72rem; opacity: .55; cursor: help; }

.tl-date-tag {
  font-size: .68rem; font-weight: 700; padding: 1px 6px;
  border-radius: 5px; background: var(--surface3); color: var(--text-muted);
  border: 1px solid var(--border); white-space: nowrap; flex-shrink: 0;
}
.tl-date-tag.overdue {
  background: rgba(248,113,113,.15); color: #f87171; border-color: rgba(248,113,113,.3);
}

.tl-time-col { padding: 13px 8px; font-size: .74rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.tl-time-col.is-next { color: var(--accent); font-weight: 700; }

.tl-pom-badge {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center; font-size: .7rem;
  font-weight: 800; color: var(--text-muted); flex-shrink: 0; margin-right: 8px;
  cursor: pointer; transition: all .15s; user-select: none;
}
.tl-pom-badge:hover { border-color: var(--accent); color: var(--accent); }
.tl-pom-badge.active-badge { border-color: var(--accent); background: var(--accent); color: #fff; }

/* ── ROI Badge ── */
.tl-roi-badge {
  font-size: .68rem; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; white-space: nowrap; flex-shrink: 0; margin-right: 6px;
  cursor: help; position: relative;
}
.tl-roi-badge.roi-hot  { background: rgba(34,197,94,.15);  color: #22c55e; }
.tl-roi-badge.roi-mid  { background: rgba(245,158,11,.15); color: #f59e0b; }
.tl-roi-badge.roi-cold { background: rgba(239,68,68,.15);  color: #ef4444; }

/* ── Tooltip system ─────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #0f1629; color: #e2e8f0;
  padding: 8px 12px; border-radius: 10px;
  font-size: .74rem; font-weight: 400; line-height: 1.55;
  white-space: pre-line; width: max-content; max-width: 260px;
  border: 1px solid rgba(255,255,255,.1); box-shadow: 0 6px 20px rgba(0,0,0,.4);
  pointer-events: none; opacity: 0; transition: opacity .18s; z-index: 600;
}
[data-tooltip]:hover::after { opacity: 1; }
[data-tooltip].tip-right::after { left: 0; transform: none; }
[data-tooltip].tip-left::after  { left: auto; right: 0; transform: none; }
[data-tooltip].tip-down::after  { bottom: auto; top: calc(100% + 8px); }

/* ? help icon */
.help-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--surface3); color: var(--text-muted);
  font-size: .62rem; font-weight: 800; cursor: help;
  border: 1px solid var(--border); flex-shrink: 0; vertical-align: middle;
  margin-left: 4px; transition: background .15s;
}
.help-icon:hover { background: var(--accent2); color: var(--accent); }

/* Inline pom picker */
.pom-inline-picker {
  position: fixed; z-index: 200; background: var(--surface);
  border: 1px solid var(--border2); border-radius: 12px;
  box-shadow: var(--shadow); padding: 8px; display: flex; gap: 4px; flex-wrap: wrap; width: 182px;
}
.pom-inline-btn {
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface2); color: var(--text-muted); cursor: pointer;
  font-size: .82rem; font-weight: 700; transition: all .12s;
  display: flex; align-items: center; justify-content: center;
}
.pom-inline-btn:hover, .pom-inline-btn.selected {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

.tl-menu-btn {
  width: 30px; height: 30px; border: none; background: transparent;
  color: var(--text-muted); cursor: pointer; border-radius: 7px;
  font-size: .9rem; margin-right: 8px; transition: background .12s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tl-menu-btn:hover { background: var(--surface3); color: var(--text); }

/* Context menu */
.tl-menu {
  position: fixed; z-index: 500; background: var(--surface);
  border: 1px solid var(--border2); border-radius: 10px;
  box-shadow: var(--shadow); overflow: hidden; min-width: 155px;
}
.tl-menu-item {
  padding: 10px 15px; font-size: .84rem; cursor: pointer; transition: background .1s;
  display: flex; align-items: center; gap: 9px; color: var(--text);
}
.tl-menu-item:hover { background: var(--surface2); }
.tl-menu-item.danger { color: #ff6b6b; }
.tl-menu-item.danger:hover { background: rgba(255,107,107,.08); }

/* Arrival time */
.tl-arrival {
  display: flex; align-items: center; gap: 8px; padding: 10px 18px;
  font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px;
}
.tl-arrival.hidden { display: none; }
.tl-arrival-line { flex: 1; height: 1px; background: var(--border); }
.tl-arrival-icon { color: var(--accent); font-size: .75rem; }
.tl-arrival-time { color: var(--text); font-weight: 800; font-size: .78rem; }
.tl-arrival-label { font-size: .65rem; }

/* Category tags */
.tl-cat-tags {
  display: flex; gap: 7px; flex-wrap: wrap; padding: 10px 18px;
  border-top: 1px solid var(--border);
}
.tl-cat-tag {
  display: flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 20px; border: 1px solid var(--border); font-size: .72rem;
  color: var(--text-muted); background: var(--surface2);
}
.tl-cat-tag-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* Done / Archive */
.tl-done-section { border-top: 1px solid var(--border); }
.tl-done-toggle {
  display: flex; align-items: center; gap: 9px; padding: 11px 18px;
  font-size: .7rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); cursor: pointer; user-select: none; transition: color .13s;
}
.tl-done-toggle:hover { color: var(--text); }
.tl-done-toggle span:nth-child(2) { font-weight: 800; color: var(--text); }
.tl-done-toggle span:last-child { margin-left: auto; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface); border-radius: 18px; padding: 26px;
  width: 400px; max-width: 95vw; display: flex; flex-direction: column;
  gap: 13px; box-shadow: var(--shadow); max-height: 90vh; overflow-y: auto;
  border: 1px solid var(--border2);
}
.modal h3 { font-size: 1.05rem; font-weight: 800; letter-spacing: -.3px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

.color-picker-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .82rem; color: var(--text-muted);
}
.color-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.color-swatch {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform .12s;
}
.color-swatch:hover, .color-swatch.selected { transform: scale(1.3); border-color: #fff; }
input[type=color] { width: 26px; height: 26px; border: none; background: none; cursor: pointer; padding: 0; }

.task-est-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .83rem; color: var(--text-muted);
}
.pom-est-picker { display: flex; gap: 5px; flex-wrap: wrap; }
.pom-est-btn {
  width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface2); color: var(--text-muted); cursor: pointer;
  font-size: .8rem; font-weight: 700; transition: all .12s;
  display: flex; align-items: center; justify-content: center;
}
.pom-est-btn:hover, .pom-est-btn.selected { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Matrix toggles dans le modal */
.task-matrix-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .83rem; color: var(--text-muted);
}
.task-matrix-row label { white-space: nowrap; }
.matrix-toggles { display: flex; gap: 4px; }
.matrix-toggle-btn {
  padding: 5px 0; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface2); color: var(--text-muted); cursor: pointer;
  font-size: .65rem; font-weight: 700; transition: all .15s; white-space: nowrap; flex: 1; text-align: center;
}
.matrix-toggle-btn:hover { border-color: var(--border2); color: var(--text); background: var(--surface3); transform: translateY(-1px); }
.matrix-toggle-btn.active { border-color: var(--accent); color: #fff; background: var(--accent); box-shadow: 0 2px 8px rgba(91,156,246,.3); }
.quadrant-display {
  font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 6px;
  white-space: nowrap;
}
.quadrant-display.q1 { background: rgba(239,68,68,.15); color: #ef4444; }
.quadrant-display.q2 { background: rgba(245,158,11,.15); color: #f59e0b; }
.quadrant-display.q3 { background: var(--accent2); color: var(--accent); }
.quadrant-display.q4 { background: var(--surface3); color: var(--text-muted); }

.task-recurring-row {
  display: flex; align-items: center; gap: 10px;
  font-size: .83rem; color: var(--text-muted);
}
.task-recurring-row label { white-space: nowrap; }
.task-recurring-row .select-field { flex: 1; }
.task-note-row { display: flex; flex-direction: column; gap: 5px; font-size: .83rem; color: var(--text-muted); }
/* Comments */
.task-comments-row { display: flex; flex-direction: column; gap: 8px; font-size: .83rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.comment-add-row { display: flex; flex-direction: column; gap: 6px; }
.comment-add-row textarea { resize: none; font-family: inherit; font-size: .82rem; }
.comment-item { display: flex; flex-direction: column; gap: 3px; background: var(--surface2); border-radius: 8px; padding: 8px 10px; position: relative; }
.comment-item-header { display: flex; justify-content: space-between; align-items: center; }
.comment-item-time { font-size: .7rem; color: var(--text-muted); }
.comment-item-text { font-size: .82rem; color: var(--text); line-height: 1.4; white-space: pre-wrap; }
.comment-item-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .8rem; padding: 0 2px; opacity: 0; transition: opacity .15s; }
.comment-item:hover .comment-item-del { opacity: 1; }
.comment-item-del:hover { color: #ef4444; }
.kanban-card-comments { font-size: .72rem; color: var(--text-muted); margin-top: 3px; }
/* Subtasks */
.task-subtasks-row { display: flex; flex-direction: column; gap: 6px; font-size: .83rem; color: var(--text-muted); }
.subtask-add-row { display: flex; gap: 6px; }
.subtask-add-row .input-field { flex: 1; padding: 5px 10px; font-size: .82rem; }
.subtask-item { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 6px; background: var(--surface2); }
.subtask-item input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.subtask-item .subtask-text { flex: 1; font-size: .82rem; }
.subtask-item .subtask-text.done { text-decoration: line-through; opacity: .5; }
.subtask-item .subtask-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .9rem; padding: 0 2px; }
.subtask-item .subtask-del:hover { color: #ef4444; }
.subtask-progress { font-size: .75rem; color: var(--text-muted); margin-left: 4px; }
/* Flow label */
.flow-label { display: flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.flow-label input { accent-color: var(--accent); width: 14px; height: 14px; }

/* ===== BUTTONS ===== */
.btn-primary {
  padding: 9px 18px; border: none; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: .875rem;
  font-weight: 700; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-primary:hover { opacity: .88; transform: translateY(-1px); }
.btn-secondary {
  padding: 9px 16px; border: 1px solid var(--border2); border-radius: 9px;
  background: transparent; color: var(--text-muted); font-size: .875rem;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }

/* ===== CATEGORIES VIEW ===== */
#view-categories { padding: 0 28px 28px; }
.cat-list { display: flex; flex-direction: column; gap: 12px; }
.cat-item {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
}
.cat-header { display: flex; align-items: center; gap: 10px; padding: 13px 16px; }
.cat-color-bar { width: 4px; border-radius: 4px; height: 26px; flex-shrink: 0; }
.cat-icon { font-size: 1.1rem; }
.cat-name { font-weight: 700; font-size: .95rem; flex: 1; }
.cat-count { font-size: .78rem; color: var(--text-muted); }
.cat-actions { display: flex; gap: 4px; }
.btn-sm {
  padding: 4px 9px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface2); color: var(--text-muted); font-size: .73rem;
  cursor: pointer; transition: all .12s; white-space: nowrap;
}
.btn-sm:hover { color: var(--text); border-color: var(--border2); }
.btn-sm.danger:hover { color: #ff6b6b; border-color: #ff6b6b; }
.btn-sm.success { color: var(--success); border-color: var(--success); }
.subcat-list { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 5px; }
.subcat-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 12px;
  background: var(--surface2); border-radius: 9px; border: 1px solid var(--border);
}
.subcat-icon { font-size: .9rem; }
.subcat-name { flex: 1; font-size: .86rem; }
.subcat-count { font-size: .74rem; color: var(--text-muted); }
.subcat-actions { display: flex; gap: 3px; }

/* ===== STATS VIEW ===== */
#view-stats { padding: 0 28px 28px; }
.period-tabs {
  display: flex; gap: 3px; background: var(--surface2);
  border-radius: 10px; padding: 3px;
}
.period-btn {
  padding: 6px 14px; border: none; border-radius: 7px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  font-size: .82rem; font-weight: 600; transition: all .13s;
}
.period-btn.active { background: var(--accent); color: #fff; }
.stats-date-range {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
  padding: 8px 12px; background: var(--surface2); border-radius: 8px;
  font-size: .82rem;
}
.stats-date-range.hidden { display: none; }
.stats-date-range input[type="date"] {
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); font-size: .8rem;
}
.stats-date-range label { display: flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: .8rem; }
/* Category pills filter */
.stats-cat-pills {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.stats-cat-pill {
  padding: 4px 12px; border-radius: 20px; font-size: .75rem; font-weight: 700;
  cursor: pointer; border: 2px solid transparent; transition: all .12s;
  color: #fff;
}
.stats-cat-pill:hover { opacity: .85; transform: scale(1.03); }
.stats-cat-pill.active { border-color: var(--text); box-shadow: 0 0 0 2px rgba(255,255,255,.2); }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr));
  gap: 12px; margin-bottom: 28px;
}

/* Activity chart */
.stats-chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 20px;
}
.stats-chart-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.stats-chart-header h3 { margin: 0; font-size: .95rem; }
.stats-chart-median { font-size: .78rem; color: var(--accent); font-weight: 600; }
.stats-chart {
  display: flex; align-items: flex-end; gap: 3px; height: 160px;
  border-bottom: 1px solid var(--border); padding-bottom: 4px;
  overflow-x: auto;
}
.stats-bar-wrap {
  display: flex; flex-direction: column; align-items: center; flex: 1;
  min-width: 20px; max-width: 50px; gap: 2px;
}
.stats-bar {
  width: 100%; border-radius: 4px 4px 0 0; transition: height .5s cubic-bezier(.4,0,.2,1);
  min-height: 2px; position: relative; cursor: default;
}
.stats-bar:hover { opacity: .8; }
.stats-bar-label {
  font-size: .58rem; color: var(--text-muted); font-weight: 600;
  writing-mode: horizontal-tb; white-space: nowrap;
}
.stats-bar-value {
  font-size: .55rem; color: var(--text); font-weight: 700;
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
}

/* Heatmap */
.heatmap-wrap {
  display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px;
}
.heatmap-days-labels {
  display: flex; flex-direction: column; gap: 2px; padding-top: 0;
  font-size: .58rem; color: var(--text-muted); width: 24px; flex-shrink: 0;
}
.heatmap-days-labels span { height: 12px; line-height: 12px; }
.heatmap-grid {
  display: flex; gap: 2px; flex: 1;
}
.heatmap-week {
  display: flex; flex-direction: column; gap: 2px;
}
.heatmap-cell {
  width: 12px; height: 12px; border-radius: 2px;
  background: var(--surface3); transition: background .15s;
}
.heatmap-cell[data-tooltip]:hover { outline: 1px solid var(--text-muted); }
.heatmap-cell.lvl-0 { background: var(--surface3); }
.heatmap-cell.lvl-1 { background: #166534; }
.heatmap-cell.lvl-2 { background: #22c55e; }
.heatmap-cell.lvl-3 { background: #4ade80; }
.heatmap-cell.lvl-4 { background: #86efac; }
.heatmap-months {
  display: flex; gap: 0; margin-left: 28px; margin-bottom: 4px;
  font-size: .62rem; color: var(--text-muted);
}
.heatmap-month-label {
  text-align: left; white-space: nowrap;
}
.heatmap-legend {
  display: flex; align-items: center; gap: 3px;
}
.heatmap-legend .heatmap-cell { width: 10px; height: 10px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 18px 14px; text-align: center; display: flex; flex-direction: column;
  gap: 5px; align-items: center;
}
.stat-icon { font-size: 1.4rem; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--accent); letter-spacing: -.5px; }
.stat-label { font-size: .74rem; color: var(--text-muted); }
#view-stats h3 { font-size: .95rem; font-weight: 700; margin-bottom: 12px; color: var(--text-muted); }

.stats-by-cat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.stat-cat-row { display: flex; align-items: center; gap: 10px; }
.stat-cat-label {
  width: 145px; font-size: .84rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
}
.stat-cat-bar-wrap { flex: 1; background: var(--surface2); border-radius: 6px; height: 8px; }
.stat-cat-bar { height: 8px; border-radius: 6px; transition: width .4s; min-width: 3px; }
.stat-cat-count { font-size: .78rem; color: var(--text-muted); width: 46px; text-align: right; flex-shrink: 0; }
.stat-subcat-row { margin-top: -3px; }

.stats-chart {
  display: flex; align-items: flex-end; gap: 8px; height: 120px;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 14px;
}
.chart-bar-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 4px; height: 100%; justify-content: flex-end;
}
.chart-bar {
  width: 100%; border-radius: 5px 5px 0 0; background: var(--accent);
  opacity: .7; min-height: 3px;
}
.chart-bar:hover { opacity: 1; }
.chart-label { font-size: .65rem; color: var(--text-muted); }
.chart-val { font-size: .68rem; color: var(--text); font-weight: 700; }

/* ===== HISTORY VIEW ===== */
#view-history { padding: 0 28px 28px; }
.history-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.history-filters .select-field, .history-filters .input-field { width: auto; }
.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface); border-radius: 10px; border: 1px solid var(--border);
}
.history-color { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.history-time { font-size: .76rem; color: var(--text-muted); white-space: nowrap; min-width: 120px; }
.history-cat { font-size: .84rem; font-weight: 600; flex: 1; }
.history-note { font-size: .76rem; color: var(--text-muted); flex: 1; }
.history-dur { font-size: .74rem; color: var(--text-muted); white-space: nowrap; }
.history-del {
  width: 26px; height: 26px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  font-size: .82rem; display: flex; align-items: center; justify-content: center;
  transition: all .13s; flex-shrink: 0;
}
.history-del:hover { color: #ff6b6b; border-color: #ff6b6b; background: rgba(255,107,107,.08); }
.history-empty {
  text-align: center; color: var(--text-muted); padding: 48px;
  font-size: .9rem;
}

/* ===== FOCUS OVERLAY ===== */
.focus-overlay {
  position: fixed; inset: 0; background: #08090f;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 500; gap: 22px;
}
.focus-overlay.hidden { display: none; }
.focus-exit {
  position: absolute; top: 20px; right: 24px; width: 36px; height: 36px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text-muted);
  border-radius: 50%; font-size: .95rem; cursor: pointer; transition: all .13s;
  display: flex; align-items: center; justify-content: center;
}
.focus-exit:hover { color: var(--text); border-color: var(--border2); }
.focus-mode-label { font-size: .9rem; color: var(--text-muted); }
.focus-progress-wrap { position: relative; width: 260px; height: 260px; }
.focus-progress-wrap .progress-ring { width: 260px; height: 260px; transform: rotate(-90deg); }
.focus-progress-wrap .progress-bg { stroke: var(--surface2); }
.focus-progress-wrap .progress-bar { stroke: var(--accent); }
.focus-timer {
  font-size: 4.6rem; font-weight: 800; letter-spacing: 3px;
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  pointer-events: none; color: var(--text);
}
.focus-controls { display: flex; align-items: center; gap: 14px; }
.focus-btn-start {
  padding: 13px 36px; border: none; border-radius: 50px; background: var(--accent);
  color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: all .15s; box-shadow: 0 6px 22px rgba(232,93,74,.4);
}
.focus-btn-start:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(232,93,74,.5); }
.focus-btn-start.running { background: var(--surface3); box-shadow: none; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 80px; right: 20px; background: var(--surface);
  border: 1px solid var(--border2); border-radius: 10px; padding: 12px 18px;
  font-size: .86rem; box-shadow: var(--shadow); z-index: 600;
  animation: slideIn .22s ease; max-width: 340px;
  display: flex; align-items: center; gap: 12px;
}
.toast-undo {
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  padding: 4px 10px; font-size: .8rem; cursor: pointer; white-space: nowrap;
  font-weight: 600; transition: opacity .15s;
}
.toast-undo:hover { opacity: .85; }
@media (min-width: 769px) { .toast { bottom: 22px; } }
@keyframes slideIn {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ===== MOBILE BOTTOM NAV ===== */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 0 env(safe-area-inset-bottom, 6px); z-index: 400;
  justify-content: space-around; align-items: center;
}
.bottom-nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer; padding: 6px 16px; border-radius: 10px;
  transition: all .15s;
}
.bottom-nav-btn span { font-size: .62rem; font-weight: 600; letter-spacing: .3px; }
.bottom-nav-btn.active { color: var(--accent); }
.bottom-nav-btn:hover { background: var(--surface2); }

/* ===== BUDGET WIDGET (tasklist) ===== */
.budget-widget {
  border-bottom: 1px solid var(--border); padding: 12px 16px;
  background: var(--surface); display: flex; flex-direction: column; gap: 8px;
}
.bw-header { display: flex; align-items: center; justify-content: space-between; flex: 1; }
.bw-settings-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: 1px solid var(--border); border-radius: 7px;
  color: var(--text-muted); cursor: pointer; font-size: .82rem;
  padding: 3px 8px; transition: all .12s;
}
.bw-settings-btn:hover { border-color: var(--accent); color: var(--text); }
.budget-widget { position: relative; }
.bw-title { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); }
.bw-total { font-size: .78rem; font-weight: 700; color: var(--text); }
.bw-bars { display: flex; flex-direction: column; gap: 5px; }
.bw-row {
  display: flex; align-items: center; gap: 7px; font-size: .72rem;
}
.bw-label { color: var(--text-muted); width: 70px; flex-shrink: 0; }
.bw-track {
  flex: 1; height: 8px; background: var(--border); border-radius: 4px;
  overflow: visible; position: relative;
}
[data-theme="light"] .bw-track { background: var(--border); }
.bw-fill {
  height: 100%; border-radius: 4px; transition: width .5s ease;
  min-width: 0;
}
.bw-fill.q1 { background: #ef4444; }
.bw-fill.q2 { background: #f59e0b; }
.bw-fill.q3 { background: var(--accent); }
.bw-fill.q4 { background: var(--text-dim); }
.bw-nums { font-size: .7rem; color: var(--text-muted); white-space: nowrap; width: 32px; text-align: right; }
.bw-row.bw-over .bw-nums { color: #ef4444; font-weight: 700; }
.bw-row.bw-under .bw-nums { color: #f59e0b; font-weight: 700; }
.bw-row.bw-over .bw-fill { opacity: 1; box-shadow: 0 0 6px rgba(239,68,68,.5); }

/* ===== BUDGET PANEL (inline collapsible) ===== */
.budget-panel {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 14px;
}
.budget-panel.hidden { display: none; }
.budget-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .82rem; font-weight: 700; color: var(--text);
}
.budget-panel-close {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: .9rem; padding: 2px 6px; border-radius: 5px; transition: all .12s;
}
.budget-panel-close:hover { background: var(--surface3); color: var(--text); }
.budget-panel-hint { font-size: .78rem; color: var(--text-muted); line-height: 1.5; }

.budget-panel-total { display: flex; flex-direction: column; gap: 6px; }
.budget-panel-total label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.budget-total-stepper {
  display: flex; align-items: center; gap: 10px;
}
.stepper-btn {
  width: 32px; height: 32px; border: 1px solid var(--border2); border-radius: 8px;
  background: var(--surface2); color: var(--text); font-size: 1.1rem; font-weight: 700;
  cursor: pointer; transition: all .12s; display: flex; align-items: center; justify-content: center;
}
.stepper-btn:hover { background: var(--surface3); border-color: var(--accent); }
#budget-total-display { font-size: 1.6rem; font-weight: 800; color: var(--accent); min-width: 36px; text-align: center; }
.stepper-unit { font-size: 1.1rem; }
.stepper-time { font-size: .75rem; color: var(--text-dim); margin-left: 4px; }

.budget-panel-sliders { display: flex; flex-direction: column; gap: 10px; }
.bslider-row { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; background: var(--surface2); border-radius: 10px; border: 1px solid var(--border); }
.bslider-row.q1 { border-left: 3px solid #ef4444; }
.bslider-row.q2 { border-left: 3px solid #f59e0b; }
.bslider-row.q3 { border-left: 3px solid var(--accent); }
.bslider-row.q4 { border-left: 3px solid var(--text-dim); }
.bslider-label {
  display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--text-muted);
}
.bslider-label em { font-style: normal; font-size: .72rem; opacity: .6; }
.bslider-label strong { margin-left: auto; font-size: .8rem; color: var(--text); }
.bslider {
  width: 100%; height: 6px; appearance: none; -webkit-appearance: none;
  background: var(--surface3); border-radius: 4px; outline: none; cursor: pointer;
}
.bslider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.bslider-row.q1 .bslider::-webkit-slider-thumb { background: #ef4444; }
.bslider-row.q2 .bslider::-webkit-slider-thumb { background: #f59e0b; }
.bslider-row.q3 .bslider::-webkit-slider-thumb { background: var(--accent); }
.bslider-row.q4 .bslider::-webkit-slider-thumb { background: var(--text-dim); }

.budget-panel-total-bar {
  height: 8px; background: var(--surface3); border-radius: 6px; overflow: hidden;
  position: relative; display: flex; align-items: center;
}
.bptb-fill { height: 100%; border-radius: 6px; transition: width .3s, background .3s; }
#bptb-label { position: absolute; right: 0; top: -20px; font-size: .72rem; font-weight: 700; white-space: nowrap; }

/* ===== BUDGET SETTINGS (stats view) ===== */
.budget-settings-card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 18px; margin-bottom: 24px; display: flex; flex-direction: column; gap: 14px;
}
.budget-settings-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.budget-settings-header h3 { font-size: .95rem; font-weight: 700; margin: 0; color: var(--text); }
.budget-total-wrap { font-size: .84rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.budget-total-wrap input {
  width: 52px; padding: 4px 6px; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 7px; color: var(--text); font-size: .84rem; text-align: center;
}
.budget-settings-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px;
}
.budget-setting-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--surface2); border-radius: 10px; border: 1px solid var(--border);
  font-size: .84rem; color: var(--text-muted);
}
.budget-setting-item span:nth-child(2) { flex: 1; }
.budget-setting-item input {
  width: 46px; padding: 4px 6px; background: var(--surface3); border: 1px solid var(--border2);
  border-radius: 6px; color: var(--text); font-size: .84rem; text-align: center; font-weight: 700;
}
.budget-setting-item.q1 { border-left: 3px solid #ef4444; }
.budget-setting-item.q2 { border-left: 3px solid #f59e0b; }
.budget-setting-item.q3 { border-left: 3px solid var(--accent); }
.budget-setting-item.q4 { border-left: 3px solid var(--text-dim); }

/* Budget bars in stats */
.budget-stats-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.bstat-row { display: flex; align-items: center; gap: 10px; }
.bstat-label { width: 130px; font-size: .8rem; color: var(--text-muted); flex-shrink: 0; }
.bstat-bars-wrap { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.bstat-track {
  height: 10px; background: var(--surface2); border-radius: 6px;
  overflow: visible; position: relative;
}
.bstat-fill { height: 100%; border-radius: 6px; transition: width .5s; }
.bstat-tgt {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: rgba(255,255,255,.6); border-radius: 2px;
}
.bstat-nums { font-size: .74rem; color: var(--text-muted); }
.bstat-nums.over { color: #ef4444; font-weight: 700; }
.bstat-sum { font-size: .75rem; color: var(--text-muted); padding-top: 4px; border-top: 1px solid var(--border); }
.bstat-warn { color: #f59e0b; font-weight: 700; }

/* ===== EISENHOWER VIEW ===== */
#view-eisenhower { padding: 0 24px 32px; }
.eisenhower-legend { display: flex; gap: 14px; font-size: .82rem; color: var(--text-muted); }
.eisenhower-legend span { display: flex; align-items: center; gap: 4px; }

.eisenhower-axes {
  position: relative; padding: 24px 36px;
}
.axis-label {
  position: absolute; font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-dim);
}
.axis-top    { top: 4px;  left: 50%; transform: translateX(-50%); }
.axis-bottom { bottom: 4px; left: 50%; transform: translateX(-50%); }
.axis-left   { left: 0; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: center; }
.axis-right  { right: 0; top: 50%; transform: translateY(-50%) rotate(90deg); transform-origin: center; }

.eisenhower-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  /* Ordre : Q2 (haut-gauche), Q1 (haut-droite), Q4 (bas-gauche), Q3 (bas-droite) */
}

.quad-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px;
  display: flex; flex-direction: column; gap: 10px; min-height: 200px;
}
.quad-card.q1 { border-top: 3px solid #ef4444; }
.quad-card.q2 { border-top: 3px solid #f59e0b; }
.quad-card.q3 { border-top: 3px solid var(--accent); }
.quad-card.q4 { border-top: 3px solid var(--text-dim); }

.quad-header { display: flex; align-items: flex-start; gap: 10px; }
.quad-badge {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-size: .8rem; font-weight: 800; flex-shrink: 0;
}
.q1-badge { background: rgba(239,68,68,.2); color: #ef4444; }
.q2-badge { background: rgba(245,158,11,.2); color: #f59e0b; }
.q3-badge { background: var(--accent2); color: var(--accent); }
.q4-badge { background: var(--surface3); color: var(--text-muted); }

.quad-title { font-size: .85rem; font-weight: 700; color: var(--text); }
.quad-sub { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

.quad-tasks { display: flex; flex-direction: column; gap: 5px; flex: 1; }

.quad-task-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--surface2); border-radius: 8px; cursor: pointer;
  transition: background .12s, opacity .15s, transform .15s; border: 1px solid transparent;
}
.quad-task-item:hover { background: var(--surface3); border-color: var(--border); }
.quad-task-item.is-active { border-color: var(--accent); background: var(--accent2); }
.quad-task-item.dragging { opacity: .25; transform: scale(.97); }
.quad-task-item.is-done { opacity: .55; background: var(--surface) !important; }
.quad-done-name { text-decoration: line-through; color: var(--text-muted) !important; }

.quad-done-sep {
  font-size: .68rem; font-weight: 700; color: var(--success);
  padding: 6px 4px 2px; text-transform: uppercase; letter-spacing: .5px;
  border-top: 1px solid var(--border); margin-top: 4px;
}

.quad-check-btn {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border2);
  background: transparent; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; color: #fff; transition: all .15s;
}
.quad-check-btn:hover { border-color: var(--success); background: rgba(52,217,195,.15); }
.quad-check-btn.checked { background: var(--success); border-color: var(--success); }
.quad-task-item[draggable="true"] { cursor: grab; }

.quad-drag-handle {
  color: var(--text-dim); font-size: .85rem; cursor: grab; flex-shrink: 0; opacity: .5;
}
.quad-task-item:hover .quad-drag-handle { opacity: 1; }

.quad-card.drag-over {
  border-style: dashed; border-color: var(--accent);
  background: var(--accent2); transform: scale(1.01);
  transition: all .15s;
}
.quad-card { transition: transform .15s, background .15s, border-color .15s; }

.quad-task-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.quad-task-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.quad-task-name { font-size: .84rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quad-task-cat  { font-size: .72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quad-task-meta { font-size: .7rem; color: var(--text-muted); white-space: nowrap; }
.quad-task-roi { flex-shrink: 0; }
.quad-task-pom { font-size: .7rem; color: var(--text-muted); }

.quad-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: .78rem; color: var(--text-dim); font-style: italic; min-height: 60px;
}

.quad-task-btn {
  font-size: .7rem; padding: 3px 7px; border: 1px solid var(--border);
  border-radius: 5px; background: transparent; color: var(--text-muted);
  cursor: pointer; white-space: nowrap; transition: all .12s; flex-shrink: 0;
}
.quad-task-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ===== PARETO SECTION ===== */
.pareto-section { margin-top: 8px; }
.pareto-hint {
  font-size: .8rem; color: var(--text-muted); margin-bottom: 10px; padding: 8px 12px;
  background: var(--surface2); border-radius: 8px; border-left: 3px solid var(--accent);
}
.pareto-hint strong { color: var(--text); }
.pareto-list { display: flex; flex-direction: column; gap: 5px; }
.pareto-row {
  display: grid; grid-template-columns: 32px 24px 1fr 100px 60px 20px;
  align-items: center; gap: 7px; padding: 6px 10px;
  background: var(--surface); border-radius: 8px; border: 1px solid var(--border);
  font-size: .8rem;
}
.pareto-row.pareto-top { border-color: var(--accent); background: var(--accent2); }
.pareto-impact { font-size: .68rem; color: var(--text-muted); font-weight: 800; }
.pareto-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pareto-bar-wrap { height: 5px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
.pareto-bar { height: 100%; border-radius: 3px; transition: width .3s; }
.pareto-bar.roi-hot  { background: #34d9c3; }
.pareto-bar.roi-mid  { background: #f59e0b; }
.pareto-bar.roi-cold { background: #f87171; }
.pareto-star { color: var(--accent); font-size: .85rem; text-align: center; }

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1024px) {
  .timer-panel { width: 320px; }
  .tl-cat-col { width: 100px; }
  .eisenhower-grid { grid-template-columns: 1fr 1fr; }
}

/* Mobile */
@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar { display: none; }
  .main { padding-bottom: 64px; }
  .bottom-nav { display: flex; }

  .timer-view-layout { flex-direction: column; min-height: unset; }
  .timer-panel {
    width: 100%; max-width: 100%; position: static; height: auto;
  }
  .tasklist-panel { border-left: none; border-top: 1px solid var(--border); }
  .tasklist-block { min-height: unset; }

  .timer-block {
    min-height: unset; padding: 16px 16px 24px; border-radius: 0;
    gap: 14px;
  }

  .timer-progress-wrap { width: 170px; height: 170px; }
  .progress-ring { width: 170px; height: 170px; }
  .timer-display { font-size: 2.7rem; }

  .mode-btn { padding: 6px 9px; font-size: .74rem; }

  .tl-cat-col { display: none; }
  .tl-add-row { gap: 6px; }
  .tl-select-sub { display: none; }

  .view-header { padding: 16px 16px 0; }
  #view-categories,
  #view-stats,
  #view-history,
  #view-eisenhower { padding: 0 12px 80px; }
  .eisenhower-grid { grid-template-columns: 1fr; }
  .eisenhower-axes { padding: 8px 4px; }
  .axis-label { display: none; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Small mobile */
@media (max-width: 400px) {
  .mode-tabs { gap: 1px; }
  .mode-btn { padding: 5px 7px; font-size: .7rem; }
  .timer-display { font-size: 2.4rem; }
  .timer-progress-wrap { width: 150px; height: 150px; }
  .progress-ring { width: 150px; height: 150px; }
}

/* ── Projects ─────────────────────────────────────────────── */
.projects-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 8px 28px 28px; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; cursor: pointer; transition: transform .15s, box-shadow .15s; position: relative; overflow: hidden; }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.project-card-bar { position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 14px 14px 0 0; }
.project-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.project-card-icon { font-size: 1.4rem; }
.project-card-name { font-weight: 700; font-size: 1rem; flex: 1; }
.project-card-meta { font-size: .75rem; color: var(--text-muted); margin-bottom: 10px; }
.project-card-progress { height: 5px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.project-card-progress-bar { height: 100%; border-radius: 3px; transition: width .3s; }
.project-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: .75rem; color: var(--text-muted); }
.project-card-actions { display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.project-card:hover .project-card-actions { opacity: 1; }
.project-card-actions button { background: var(--surface2); border: none; border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: .75rem; color: var(--text); }
.project-card-actions button:hover { background: var(--surface3); }
.btn-new-project-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--surface); border: 2px dashed var(--border2); border-radius: 14px; padding: 40px; cursor: pointer; color: var(--text-muted); font-size: .9rem; transition: border-color .15s, color .15s; }
.btn-new-project-empty:hover { border-color: var(--accent); color: var(--accent); }

/* Project detail */
.project-detail.hidden { display: none; }
.project-detail { padding: 0 28px 28px; }
.project-detail-header { display: flex; align-items: center; gap: 12px; padding: 8px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.project-detail-title { display: flex; align-items: center; gap: 8px; flex: 1; }
.project-detail-title h3 { margin: 0; font-size: 1.2rem; }
.project-detail-title span { font-size: 1.4rem; }
.project-detail-actions { display: flex; gap: 8px; }

/* Plan summary */
.plan-summary { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; font-size: .82rem; }
.plan-summary-top { display: flex; gap: 20px; align-items: flex-start; }
.plan-progress-circle { position: relative; width: 90px; height: 90px; flex-shrink: 0; }
.plan-progress-text {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; display: flex; flex-direction: column;
}
.plan-progress-pct { font-size: 1.2rem; font-weight: 800; color: var(--text); line-height: 1; }
.plan-progress-count { font-size: .65rem; color: var(--text-muted); margin-top: 2px; }
.plan-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.plan-summary-item label { font-weight: 600; color: var(--text-muted); font-size: .75rem; text-transform: uppercase; display: block; margin-bottom: 3px; }
.plan-summary-item p { margin: 0; color: var(--text); line-height: 1.4; }
.plan-summary-objectif { font-size: .9rem; font-weight: 600; color: var(--accent); margin-bottom: 10px; }

/* Project tabs */
.proj-tabs {
  display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.proj-tab {
  background: none; border: none; padding: 10px 18px; font-size: .85rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: color .15s, border-color .15s; border-radius: 8px 8px 0 0;
}
.proj-tab:hover { color: var(--text); background: var(--surface2); }
.proj-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.proj-tab-content { animation: fadeIn .2s ease; }
.proj-tab-content.hidden { display: none !important; }

/* Plan detail content */
.plan-detail-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; margin-bottom: 14px;
}
.plan-detail-section-title {
  font-size: .9rem; font-weight: 700; margin-bottom: 4px; color: var(--text);
}
.plan-detail-section-help {
  font-size: .78rem; color: var(--text-muted); font-style: italic; margin-bottom: 12px;
}
.plan-detail-field { margin-bottom: 12px; }
.plan-detail-field-label {
  font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .3px; margin-bottom: 4px;
}
.plan-detail-field-value {
  font-size: .85rem; color: var(--text); line-height: 1.5;
}
.plan-detail-field-value.empty {
  color: var(--text-muted); font-style: italic;
}
.plan-detail-list-item {
  padding: 4px 0; font-size: .84rem; color: var(--text);
}
.plan-detail-list-item::before { content: "• "; color: var(--accent); }
.plan-detail-table {
  width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: 4px;
}
.plan-detail-table th {
  background: var(--surface2); padding: 8px 10px; text-align: left;
  font-weight: 600; font-size: .75rem; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.plan-detail-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text);
}
.plan-detail-table tr:hover { background: var(--surface2); }
.plan-detail-textarea {
  width: 100%; min-height: 80px; resize: vertical; font-size: .85rem;
  line-height: 1.5; padding: 8px 10px;
}
.plan-convert-btn {
  background: none; border: 1px solid var(--accent); color: var(--accent);
  border-radius: 4px; cursor: pointer; font-size: .75rem; padding: 2px 5px;
  opacity: 0; transition: opacity .15s;
}
.plan-detail-table tr:hover .plan-convert-btn { opacity: 1; }
.plan-list-item .plan-convert-btn { opacity: 0; }
.plan-list-item:hover .plan-convert-btn { opacity: 1; }
.plan-convert-btn:hover { background: var(--accent); color: #fff; }
.plan-task-badge { font-size: .85rem; }

/* Kanban */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .kanban-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .kanban-board { grid-template-columns: 1fr; } }
.kanban-col { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.kanban-col-header { padding: 10px 14px; font-weight: 700; font-size: .82rem; background: var(--surface2); border-bottom: 1px solid var(--border); }
.kanban-col-body { padding: 8px; min-height: 80px; display: flex; flex-direction: column; gap: 7px; }
.kanban-col-body.drag-over { background: var(--surface3); border-radius: 8px; }
.kanban-add-card-btn {
  width: 100%; padding: 6px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-muted); font-size: .78rem;
  cursor: pointer; text-align: left; transition: background .12s;
}
.kanban-add-card-btn:hover { background: var(--surface3); color: var(--text); }
.kanban-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: grab; position: relative; transition: box-shadow .15s; }
.kanban-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.kanban-card.dragging { opacity: .4; }
.kanban-card-title { font-weight: 600; font-size: .84rem; margin-bottom: 5px; }
.kanban-card-meta { display: flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--text-muted); flex-wrap: wrap; }
.kanban-card-quad { padding: 1px 5px; border-radius: 4px; font-weight: 700; font-size: .7rem; }
.kanban-card-quad.q1 { background: rgba(239,68,68,.2); color: #ef4444; }
.kanban-card-quad.q2 { background: rgba(245,158,11,.2); color: #f59e0b; }
.kanban-card-quad.q3 { background: rgba(91,156,246,.2); color: var(--accent); }
.kanban-card-quad.q4 { background: var(--surface3); color: var(--text-muted); }
.kanban-card-subtasks { margin-top: 6px; font-size: .72rem; color: var(--accent); }
.kanban-card-poms { font-size: .72rem; }
.kanban-card-date { font-size: .72rem; color: var(--text-muted); }
.kanban-card-date.overdue { color: #ef4444; font-weight: 700; }
.kanban-col[data-status="todo"] .kanban-col-header { color: var(--text-muted); }
.kanban-col[data-status="doing"] .kanban-col-header { color: #f59e0b; }
.kanban-col[data-status="review"] .kanban-col-header { color: var(--accent); }
.kanban-col[data-status="done"] .kanban-col-header { color: #22c55e; }

/* ── Calendrier hebdomadaire ─────────────────────────────────── */
.cal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-week-label { font-weight: 700; font-size: .88rem; min-width: 200px; text-align: center; color: var(--text); }
.cal-mode-btns { display: flex; border: 1px solid var(--border2); border-radius: 8px; overflow: hidden; margin-right: 8px; }
.cal-mode-btn {
  background: var(--surface); border: none; padding: 6px 14px; font-size: .78rem;
  font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.cal-mode-btn:not(:last-child) { border-right: 1px solid var(--border2); }
.cal-mode-btn.active { background: var(--accent); color: #fff; }
.cal-mode-btn:hover:not(.active) { background: var(--surface2); }

/* Calendar month grid */
.cal-month-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.cal-month-header {
  padding: 6px; text-align: center; font-size: .72rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
}
.cal-month-cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  min-height: 90px; padding: 4px; position: relative; transition: background .15s;
}
.cal-month-cell.today { border-color: var(--accent); background: var(--accent2); }
.cal-month-cell.other-month { opacity: .4; }
.cal-month-cell.drag-over { background: var(--accent2); }
.cal-month-cell-num {
  font-size: .75rem; font-weight: 700; padding: 2px 6px; color: var(--text);
}
.cal-month-cell.today .cal-month-cell-num {
  background: var(--accent); color: #fff; border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.cal-month-task {
  font-size: .65rem; padding: 2px 4px; margin: 1px 0; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  border-left: 3px solid transparent; transition: background .1s;
  position: relative;
}
.cal-month-task:hover { opacity: .8; overflow: visible; z-index: 100; }
.cal-month-task.done { opacity: .4; text-decoration: line-through; }
.cal-month-tooltip {
  position: fixed; z-index: 9999; background: var(--surface); border: 1px solid var(--border2);
  border-radius: 10px; padding: 10px 14px; font-size: .75rem; line-height: 1.6;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); pointer-events: none;
  transform: translateX(-50%) translateY(-100%); max-width: 280px; color: var(--text);
}
.cal-month-more {
  font-size: .62rem; color: var(--accent); cursor: pointer; padding: 1px 4px; font-weight: 600;
}

/* Calendar day view */
.cal-day-grid {
  display: flex; flex-direction: column; gap: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.cal-day-hour {
  display: flex; min-height: 50px; border-bottom: 1px solid var(--border);
  position: relative;
}
.cal-day-hour:last-child { border-bottom: none; }
.cal-day-hour-label {
  width: 60px; flex-shrink: 0; padding: 4px 8px; font-size: .72rem;
  color: var(--text-muted); font-weight: 600; text-align: right; border-right: 1px solid var(--border);
}
.cal-day-hour-body {
  flex: 1; padding: 4px 8px; min-height: 50px; position: relative; transition: background .15s;
}
.cal-day-hour-body.drag-over { background: var(--accent2); }
.cal-day-hour-body.now { background: rgba(91,156,246,.06); }
.cal-day-task {
  padding: 4px 8px; margin: 2px 0; border-radius: 6px; font-size: .78rem;
  cursor: pointer; border-left: 3px solid transparent; transition: background .1s;
  background: var(--surface2);
}
.cal-day-task:hover { opacity: .85; }

.cal-unplanned { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.cal-unplanned-title { font-weight: 700; font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.cal-unplanned-count { background: var(--surface2); padding: 1px 7px; border-radius: 10px; font-size: .72rem; color: var(--text); font-weight: 600; }
.cal-unplanned-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.cal-unplanned-list.drag-over { background: var(--surface2); border-radius: 8px; }
.cal-unplanned-card {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 10px; font-size: .75rem; cursor: grab; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.cal-unplanned-card:hover { background: var(--surface3); }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  align-items: start;
}
@media (max-width: 900px) { .cal-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .cal-grid { grid-template-columns: repeat(2, 1fr); } }

.cal-col {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column; min-height: 160px;
  transition: box-shadow .15s;
}
.cal-col.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-col.past { opacity: .7; }
.cal-col-header {
  padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.cal-col-day { font-size: .65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.cal-col-num { font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.cal-col.today .cal-col-num { color: var(--accent); }

.cal-col-body {
  flex: 1; padding: 5px; display: flex; flex-direction: column; gap: 4px;
  transition: background .12s; min-height: 80px;
}
.cal-col-body.drag-over { background: rgba(79,142,247,.08); border-radius: 0 0 12px 12px; }

.cal-card {
  border-radius: 7px; padding: 5px 7px; cursor: pointer; font-size: .74rem;
  border-left: 3px solid var(--accent); background: var(--surface2);
  transition: background .12s; user-select: none;
}
.cal-card:hover { background: var(--surface3); }
.cal-card.done { opacity: .45; }
.cal-card.overdue { border-left-color: #ef4444 !important; }
.cal-card-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-card-meta { display: flex; gap: 5px; align-items: center; margin-top: 3px; flex-wrap: wrap; }

.cal-add-btn {
  width: 100%; background: none; border: none; color: var(--text-muted);
  font-size: .72rem; padding: 5px 4px; cursor: pointer; text-align: left;
  border-radius: 6px; margin-top: 2px;
}
.cal-add-btn:hover { background: var(--surface2); color: var(--accent); }

/* ── Modal Tâche Wide (Trello-style) ────────────────────────── */
.modal-task-wide {
  width: 92vw; max-width: 900px; max-height: 92vh;
  padding: 0; gap: 0; overflow: visible; display: flex; flex-direction: column;
}
.task-modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px 12px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.task-name-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 1.25rem; font-weight: 800; color: var(--text); font-family: inherit;
  letter-spacing: -.4px;
}
.task-name-input::placeholder { color: var(--text-muted); font-weight: 500; }
.task-name-input:focus { background: var(--surface2); border-radius: 8px; padding: 4px 8px; }
.modal-close-btn { flex-shrink: 0; font-size: 1.1rem; opacity: .6; }
.modal-close-btn:hover { opacity: 1; }

.task-modal-body {
  display: flex; flex: 1; overflow-y: auto; overflow-x: visible;
}

/* LEFT column */
.task-modal-left {
  flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 18px;
}
.task-section { display: flex; flex-direction: column; gap: 8px; }
.task-section-title { font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.task-section-title-row { display: flex; align-items: center; gap: 10px; }
.subtask-progress-badge { font-size: .72rem; background: var(--surface2); color: var(--text-muted); padding: 2px 8px; border-radius: 20px; }
/* Markdown editor */
.md-editor { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface2); }
.md-toolbar {
  display: flex; align-items: center; gap: 2px; padding: 4px 8px;
  border-bottom: 1px solid var(--border); background: var(--surface3);
}
.md-tb-btn {
  padding: 3px 8px; border: none; border-radius: 5px; background: transparent;
  color: var(--text-muted); cursor: pointer; font-size: .78rem; font-family: inherit;
  transition: background .12s, color .12s;
}
.md-tb-btn:hover { background: var(--accent2); color: var(--text); }
.md-tb-btn.active { background: var(--accent2); color: var(--accent); }
.md-toolbar-spacer { flex: 1; }
.md-tb-toggle { font-size: .72rem; }

.task-description {
  width: 100%; min-height: 100px; resize: vertical;
  background: transparent; border: none; border-radius: 0;
  padding: 10px 12px; font-size: .87rem; color: var(--text); font-family: inherit;
  line-height: 1.55;
}
.task-description:focus { outline: none; }

.md-preview {
  padding: 10px 12px; font-size: .87rem; color: var(--text);
  line-height: 1.6; min-height: 100px; overflow-y: auto; max-height: 300px;
}
.md-preview.hidden { display: none; }
.md-preview strong { font-weight: 700; }
.md-preview em { font-style: italic; }
.md-preview a { color: var(--accent); text-decoration: underline; word-break: break-all; }
.md-preview a:hover { opacity: .8; }
.md-preview ul, .md-preview ol { padding-left: 20px; margin: 6px 0; }
.md-preview li { margin: 2px 0; }
.md-preview h1, .md-preview h2, .md-preview h3 { margin: 8px 0 4px; font-weight: 700; }
.md-preview h1 { font-size: 1.2rem; } .md-preview h2 { font-size: 1.05rem; } .md-preview h3 { font-size: .95rem; }
.md-preview p { margin: 4px 0; }

/* Expanded editor overlay */
#md-expand-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.55); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.md-expand-panel {
  width: 90vw; max-width: 900px; height: 80vh;
  background: var(--surface); border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  display: flex; flex-direction: column; overflow: hidden;
}
.md-expand-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.md-expand-textarea {
  flex: 1; width: 100%; border: none; resize: none;
  padding: 16px; font-size: .9rem; font-family: inherit;
  color: var(--text); background: var(--surface);
  line-height: 1.6;
}
.md-expand-textarea:focus { outline: none; }
.md-preview code { background: var(--surface3); padding: 1px 5px; border-radius: 4px; font-size: .82rem; }
.md-preview hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

/* Labels */
.task-labels-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.task-label-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 700;
  color: #fff; cursor: pointer; border: 2px solid transparent; transition: opacity .15s, transform .1s;
  user-select: none;
}
.task-label-pill:hover { opacity: .85; transform: scale(1.05); }
.task-label-pill.inactive { opacity: .25; filter: saturate(.3); }
.task-label-add-btn {
  background: var(--surface2); border: 1px dashed var(--border); color: var(--text-muted);
  border-radius: 20px; padding: 3px 10px; font-size: .72rem; cursor: pointer;
}
.task-label-add-btn:hover { background: var(--surface3); }

/* Label editor */
.label-edit-toggle {
  background: none; border: none; cursor: pointer; font-size: .75rem;
  padding: 0 4px; opacity: .5; transition: opacity .15s;
}
.label-edit-toggle:hover { opacity: 1; }
.label-editor.hidden { display: none; }
.label-editor {
  margin-top: 8px; padding: 10px; background: var(--surface2); border-radius: 8px;
  border: 1px solid var(--border);
}
.label-editor-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px; padding: 4px 0;
}
.label-color-input {
  width: 28px; height: 28px; border: none; border-radius: 6px; cursor: pointer;
  padding: 0; background: none;
}
.label-name-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px; font-size: .8rem; color: var(--text);
}
.label-editor-add {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.label-add-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  padding: 4px 10px; font-size: .78rem; cursor: pointer; font-weight: 600;
  white-space: nowrap;
}
.label-add-btn:hover { opacity: .85; }
.label-del-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: .8rem; padding: 2px 4px; opacity: .5;
}
.label-del-btn:hover { opacity: 1; color: #ef4444; }
.label-preview {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}

/* Attachments */
.task-attach-list { display: flex; flex-direction: column; gap: 8px; }
.task-attach-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
}
.task-attach-thumb {
  width: 52px; height: 42px; object-fit: cover; border-radius: 6px; flex-shrink: 0;
  background: var(--surface3); cursor: pointer;
}
.task-attach-icon {
  width: 52px; height: 42px; border-radius: 6px; flex-shrink: 0;
  background: var(--surface3); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.task-attach-info { flex: 1; min-width: 0; }
.task-attach-name { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-attach-meta { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }
.task-attach-del { font-size: .85rem; opacity: .5; cursor: pointer; flex-shrink: 0; }
.task-attach-del:hover { opacity: 1; color: #ef4444; }
.attach-add-btn {
  align-self: flex-start; cursor: pointer; font-size: .78rem; padding: 5px 12px;
}
.attach-size-hint { font-size: .68rem; color: var(--text-muted); margin-top: 2px; }

/* RIGHT sidebar */
.task-modal-right {
  width: 250px; flex-shrink: 0; overflow: visible;
  padding: 14px 14px; display: flex; flex-direction: column; gap: 14px;
  border-left: 1px solid var(--border); background: var(--surface2);
}
.task-sidebar-section { display: flex; flex-direction: column; gap: 6px; }
.task-sidebar-label { font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.task-sidebar-actions { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 10px; }
.task-sidebar-btn { width: 100%; text-align: center; }
.btn-danger { background: rgba(239,68,68,.15); color: #ef4444; border: 1px solid rgba(239,68,68,.3); border-radius: 10px; padding: 7px 12px; font-size: .8rem; font-weight: 600; cursor: pointer; }
.btn-danger:hover { background: rgba(239,68,68,.25); }
.full-width { width: 100%; text-align: center; }

@media (max-width: 640px) {
  .task-modal-body { flex-direction: column; }
  .task-modal-right { width: 100%; border-left: none; border-top: 1px solid var(--border); }
}

/* Plan d'action modal */
.modal-project-form { max-width: 780px; width: 90vw; max-height: 85vh; overflow-y: auto; }
.project-form-basic { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.proj-color-row { display: flex; align-items: center; gap: 10px; font-size: .83rem; }
.proj-color-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.proj-color-swatch { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform .1s; }
.proj-color-swatch.selected { border-color: #fff; transform: scale(1.2); }
.proj-template-row { display: flex; align-items: center; gap: 10px; font-size: .83rem; margin-top: 8px; }
.proj-template-row select { font-size: .82rem; padding: 5px 8px; border-radius: 8px; background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.plan-tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.plan-tab { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 12px; font-size: .78rem; cursor: pointer; color: var(--text-muted); transition: background .15s, color .15s; }
.plan-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.plan-tab-content { display: flex; flex-direction: column; gap: 12px; }
.plan-tab-content.hidden { display: none; }
.plan-field { display: flex; flex-direction: column; gap: 5px; }
.plan-field-label { font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.plan-list { display: flex; flex-direction: column; gap: 5px; }
.plan-list-item { display: flex; align-items: center; gap: 7px; background: var(--surface2); border-radius: 7px; padding: 5px 10px; font-size: .82rem; }
.plan-list-item span { flex: 1; }
.plan-list-item button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .8rem; opacity: 0; transition: opacity .15s; }
.plan-list-item:hover button { opacity: 1; }
.plan-list-item button:hover { color: #ef4444; }
.plan-list-add { display: flex; gap: 6px; }
.plan-list-add .input-field { flex: 1; padding: 5px 10px; font-size: .82rem; }

/* Plan tables */
.plan-table-wrap { margin-top: 4px; }
.plan-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
}
.plan-table th {
  background: var(--surface2); padding: 6px 8px; text-align: left;
  font-weight: 600; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .3px; color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.plan-table td { padding: 3px 4px; border-bottom: 1px solid var(--border); }
.plan-table-input {
  width: 100%; background: transparent; border: 1px solid transparent;
  padding: 4px 6px; font-size: .82rem; border-radius: 4px; color: var(--text);
}
.plan-table-input:focus { border-color: var(--accent); background: var(--surface); }
.plan-table-del {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: .75rem; opacity: 0; transition: opacity .15s;
}
.plan-table tr:hover .plan-table-del { opacity: 1; }
.plan-table-del:hover { color: #ef4444; }

/* ===== STATS PROJECT ROWS ===== */
.stats-section { margin-top: 28px; }
.stats-section-title { font-size: .95rem; font-weight: 700; margin-bottom: 12px; color: var(--text-muted); }
.stats-project-row { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.stats-project-header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.stats-project-poms { font-size: .78rem; color: var(--text-muted); font-weight: 400; }
.stats-project-bar-wrap { height: 5px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin-bottom: 5px; }
.stats-project-bar { height: 100%; border-radius: 3px; transition: width .4s; }
.stats-project-footer { font-size: .72rem; color: var(--text-muted); }
.stats-empty { color: var(--text-muted); font-size: .85rem; padding: 12px 0; font-style: italic; }

/* ===== PLAN ACTIONS SECTION ===== */
.plan-actions-section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.plan-actions-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.plan-actions-title { font-weight: 700; font-size: .85rem; }
.plan-action-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.plan-action-row:last-child { border-bottom: none; }
.plan-action-info { display: flex; align-items: center; gap: 8px; flex: 1; }
.plan-action-name { font-size: .83rem; }
.plan-action-linked { font-size: .72rem; color: #22c55e; }
.plan-action-btns { display: flex; gap: 6px; }

/* Projects view padding */
#view-projects { padding: 0; }
#view-projects .view-header { padding: 28px 28px 0; }

/* ===== OVERDUE ROW ===== */
.tl-date-tag.overdue { background: rgba(239,68,68,.15); color: #ef4444; font-weight: 700; }
.tl-row.overdue-row { border-left: 3px solid #ef4444 !important; }

/* ===== SEARCH ===== */
/* Inbox capture */
.inbox-capture { padding: 0 12px 10px; }
.inbox-trigger {
  width: 100%; padding: 8px 12px; border: 1px dashed var(--border2); border-radius: 8px;
  background: var(--surface2); color: var(--text-muted); font-size: .78rem;
  cursor: pointer; transition: all .15s; text-align: left;
  display: flex; align-items: center; justify-content: space-between;
}
.inbox-trigger:hover { border-color: var(--accent); color: var(--text); background: var(--surface3); }
.inbox-badge {
  background: var(--accent); color: #fff; font-size: .65rem; font-weight: 800;
  padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}
.inbox-badge:empty { display: none; }

/* Inbox modal */
#modal-inbox { z-index: 500; }
.inbox-modal {
  width: 92vw; max-width: 550px; max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow);
}
.inbox-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 10px;
}
.inbox-modal-header h3 { margin: 0; font-size: 1rem; }
.inbox-modal-input {
  padding: 0 20px 12px; display: flex; flex-direction: column; gap: 8px;
}
.inbox-textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface2); color: var(--text); font-size: .85rem;
  padding: 10px 12px; font-family: inherit; resize: vertical;
}
.inbox-textarea:focus { outline: none; border-color: var(--accent); }
.inbox-modal-list {
  flex: 1; overflow-y: auto; padding: 0 20px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.inbox-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px;
  background: var(--surface2); border-radius: 8px; font-size: .82rem;
  animation: inboxSlide .2s ease-out; border: 1px solid var(--border);
}
@keyframes inboxSlide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.inbox-item.dragging { opacity: .3; }
.inbox-item.drag-over { border-color: var(--accent); box-shadow: 0 -2px 0 var(--accent); }
.inbox-drag { cursor: grab; color: var(--text-dim); opacity: .4; font-size: .9rem; padding: 0 4px; flex-shrink: 0; }
.inbox-drag:hover { opacity: 1; }
.inbox-item-text { flex: 1; min-width: 0; line-height: 1.4; word-break: break-word; }
.inbox-item-time { font-size: .68rem; color: var(--text-dim); white-space: nowrap; }
.inbox-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.inbox-item-btn {
  background: none; border: none; cursor: pointer; font-size: .8rem;
  padding: 2px 6px; opacity: .5; transition: opacity .12s; border-radius: 4px;
}
.inbox-item-btn:hover { opacity: 1; background: var(--surface3); }
.inbox-count {
  font-size: .75rem; color: var(--text-dim); text-align: center; padding: 8px 20px;
}

.search-wrap { position: relative; padding: 0 12px 8px; }
.search-input { width: 100%; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: .82rem; box-sizing: border-box; }
.search-input:focus { outline: none; border-color: var(--accent); }
.search-results { position: absolute; top: 100%; left: 12px; right: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); z-index: 1000; max-height: 320px; overflow-y: auto; }
.search-result-item { padding: 9px 14px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: .83rem; display: flex; align-items: center; gap: 8px; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface2); }
.search-result-type { font-size: .7rem; color: var(--text-muted); background: var(--surface2); padding: 1px 5px; border-radius: 4px; }
.search-result-name { flex: 1; }
.search-result-sub { font-size: .72rem; color: var(--text-muted); }
.search-empty { padding: 14px; color: var(--text-muted); font-size: .83rem; text-align: center; }

/* ===== DASHBOARD ===== */
.dashboard-grid { display: flex; flex-direction: column; gap: 20px; padding: 0 28px 28px; }
.dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 700px) { .dash-kpis { grid-template-columns: repeat(2, 1fr); } }
.dash-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; text-align: center; }
.dash-kpi-value { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.dash-kpi-label { font-size: .72rem; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
/* Recent tasks */
.recent-tasks-list { display: flex; flex-direction: column; gap: 4px; }
.recent-task-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 8px; cursor: pointer; transition: background .12s;
}
.recent-task-item:hover { background: var(--surface2); }
.recent-task-item.done { opacity: .45; }
.recent-task-bar { width: 3px; align-self: stretch; border-radius: 2px; flex-shrink: 0; }
.recent-task-info { flex: 1; min-width: 0; }
.recent-task-name { font-size: .83rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-task-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; }

/* Habits */
.habits-list { display: flex; flex-direction: column; gap: 6px; }
.habit-row {
  display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface2); transition: background .12s;
}
.habit-row:hover { background: var(--surface3); }
.habit-icon { font-size: 1.1rem; flex-shrink: 0; padding-top: 2px; }
.habit-content { flex: 1; min-width: 0; }
.habit-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.habit-label { font-size: .82rem; font-weight: 600; }
.habit-value { font-size: .78rem; font-weight: 700; white-space: nowrap; }
.habit-advice { font-size: .74rem; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }
.dash-habits-section { grid-column: 1 / -1; }

.dash-section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.dash-section-title { font-weight: 700; font-size: .85rem; margin-bottom: 10px; }
.dash-task-list { display: flex; flex-direction: column; gap: 6px; }
.dash-task-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .83rem; cursor: pointer; }
.dash-task-row:last-child { border-bottom: none; }
.dash-task-row:hover { color: var(--accent); }
.dash-empty { color: var(--text-muted); font-size: .82rem; font-style: italic; }
.dash-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.dash-proj-card { background: var(--surface2); border-radius: 10px; padding: 10px 12px; cursor: pointer; border-left: 3px solid var(--accent); }
.dash-proj-card:hover { background: var(--surface3); }
.dash-proj-name { font-weight: 700; font-size: .83rem; margin-bottom: 4px; }
.dash-proj-bar-wrap { height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden; }
.dash-proj-bar { height: 100%; border-radius: 2px; }
.dash-proj-meta { font-size: .7rem; color: var(--text-muted); margin-top: 4px; }
.dash-week-chart { display: flex; align-items: flex-end; gap: 6px; height: 80px; padding-top: 8px; }
.dash-week-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.dash-week-bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 3px; transition: height .3s; }
.dash-week-day { font-size: .65rem; color: var(--text-muted); }
.dash-week-count { font-size: .65rem; color: var(--text-muted); }

/* ===== WEEKLY REVIEW MODAL ===== */
.modal-review { max-width: 580px; max-height: 85vh; overflow-y: auto; }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.review-header h3 { margin: 0; }
.review-section { margin-bottom: 16px; }
.review-section-title { font-weight: 700; font-size: .85rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; }
.review-stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 12px; }
.review-stat { background: var(--surface2); border-radius: 8px; padding: 10px; text-align: center; }
.review-stat-val { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.review-stat-lbl { font-size: .7rem; color: var(--text-muted); }
.review-task-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.review-task-row:last-child { border-bottom: none; }
.review-quad-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: .82rem; }
.review-alert { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); border-radius: 8px; padding: 10px 12px; font-size: .82rem; color: #ef4444; margin-bottom: 8px; }
.review-good { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); border-radius: 8px; padding: 10px 12px; font-size: .82rem; color: #22c55e; margin-bottom: 8px; }

/* ===== GANTT ===== */
.gantt-section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-top: 16px; }
.gantt-title { font-weight: 700; font-size: .85rem; margin-bottom: 12px; }
.gantt-chart { overflow-x: auto; }
.gantt-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; min-width: 400px; }
.gantt-label { width: 140px; font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; color: var(--text); }
.gantt-bar-area { flex: 1; position: relative; height: 20px; }
.gantt-bar { position: absolute; height: 16px; top: 2px; border-radius: 4px; min-width: 6px; cursor: pointer; transition: opacity .15s; }
.gantt-bar:hover { opacity: .8; }
.gantt-bar.done { opacity: .45; }
.gantt-axis { display: flex; gap: 0; margin-bottom: 4px; min-width: 400px; }
.gantt-axis-label { flex: 1; font-size: .65rem; color: var(--text-muted); text-align: center; }
.gantt-empty { color: var(--text-muted); font-size: .82rem; font-style: italic; }

/* ===== HISTORY TASK NAME ===== */
.history-info { display: flex; flex-direction: column; gap: 2px; }
.history-task-name { font-size: .75rem; color: var(--accent); font-weight: 600; }

/* ── Paramètres ──────────────────────────────────────────────── */
.settings-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 20px; overflow-x: auto; position: relative; z-index: 10;
  flex-wrap: wrap;
}
.settings-tab {
  padding: 8px 14px; border: none; background: none; font-size: .82rem;
  font-weight: 600; color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s;
  white-space: nowrap;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.settings-panel { display: none; max-width: 700px; }
.settings-panel.active { display: block; }
.settings-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; margin-bottom: 16px;
}
.settings-card h3 { margin: 0 0 4px; font-size: 1rem; }
.settings-hint { font-size: .78rem; color: var(--text-muted); margin-bottom: 12px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  gap: 12px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row label { font-size: .85rem; color: var(--text); font-weight: 500; }
.settings-input-wrap {
  display: flex; align-items: center; gap: 6px;
}
.settings-input-wrap input[type="number"] {
  width: 70px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface2); color: var(--text);
  font-size: .85rem; text-align: center;
}
.settings-input-wrap span { font-size: .78rem; color: var(--text-muted); }
.settings-range {
  width: 160px; accent-color: var(--accent);
}
.settings-status {
  font-size: .78rem; padding: 4px 10px; border-radius: 6px;
  font-weight: 600;
}
/* Toggle switch */
.settings-toggle {
  position: relative; width: 44px; height: 24px; flex-shrink: 0;
}
.settings-toggle input { opacity: 0; width: 0; height: 0; }
.settings-slider {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--surface3); border-radius: 24px; cursor: pointer;
  transition: background .2s;
}
.settings-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.settings-toggle input:checked + .settings-slider { background: var(--accent); }
.settings-toggle input:checked + .settings-slider::before { transform: translateX(20px); }
/* Presets */
.settings-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.settings-preset {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface2); font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: all .12s; display: flex; align-items: center; gap: 6px;
}
.settings-preset:hover { border-color: var(--accent); }
.settings-preset.active { background: var(--accent2); border-color: var(--accent); color: var(--accent); }
.settings-preset-del {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: .7rem; padding: 0 2px;
}
.settings-preset-del:hover { color: #ef4444; }
.nav-separator { height: 1px; background: var(--border); margin: 8px 14px; }
.storage-bar {
  height: 10px; background: var(--surface3); border-radius: 5px; overflow: hidden;
}
.storage-bar-fill {
  height: 100%; border-radius: 5px; transition: width .3s ease;
  background: linear-gradient(90deg, #22c55e, #22c55e);
}
.storage-bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.storage-detail-row {
  display: flex; justify-content: space-between; padding: 3px 0;
  border-bottom: 1px solid var(--border);
}
.storage-detail-row:last-child { border-bottom: none; }
.storage-detail-label { color: var(--text-muted); }
.storage-detail-value { font-weight: 700; color: var(--text); }

/* ── Coach IA ────────────────────────────────────────────────── */
/* Template editor */
.tpl-card {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 18px; margin-bottom: 10px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; transition: background .15s;
}
.tpl-card:hover { background: var(--surface3); }
.tpl-card-icon { font-size: 1.6rem; flex-shrink: 0; width: 36px; text-align: center; }
.tpl-card-info { flex: 1; min-width: 0; }
.tpl-card-name { font-weight: 700; font-size: .88rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tpl-card-desc { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.tpl-card-meta { font-size: .65rem; color: var(--text-muted); margin-top: 4px; }
.tpl-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.tpl-badge-system { font-size: .6rem; font-weight: 600; background: var(--surface3); color: var(--text-muted); padding: 1px 6px; border-radius: 8px; }
.tpl-badge-default { font-size: .6rem; font-weight: 600; background: #eab308; color: #000; padding: 1px 6px; border-radius: 8px; }
.tpl-section-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; margin-bottom: 10px; cursor: grab;
}
.tpl-section-card.dragging { opacity: .4; }
.tpl-section-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px;
}
.tpl-section-title-input {
  flex: 1; font-size: .85rem; font-weight: 600; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px; color: var(--text);
}
.tpl-section-help-input {
  width: 100%; font-size: .72rem; font-style: italic; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; color: var(--text-muted); margin-bottom: 8px;
}
.tpl-field-columns {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; width: 100%;
}
.tpl-col-input {
  width: 110px; font-size: .72rem; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 6px; color: var(--text);
}
.tpl-field-row { cursor: grab; }
.tpl-field-row.dragging { opacity: .4; }
.tpl-field-row {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin: 4px 0;
  background: var(--surface2); border-radius: 6px; font-size: .78rem;
}
.tpl-field-row:hover { background: var(--surface3); }
.tpl-field-label-input {
  flex: 1; font-size: .78rem; background: transparent; border: 1px solid transparent;
  border-radius: 4px; padding: 3px 6px; color: var(--text);
}
.tpl-field-label-input:focus { border-color: var(--accent); background: var(--surface); }
.tpl-field-type-select {
  font-size: .72rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 4px; color: var(--text);
}
.tpl-field-del {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: .75rem; padding: 2px 4px;
}
.tpl-field-del:hover { color: #ef4444; }
.tpl-add-field-btn {
  background: none; border: 1px dashed var(--border); border-radius: 6px;
  padding: 5px 10px; font-size: .72rem; color: var(--text-muted); cursor: pointer;
  width: 100%; margin-top: 6px;
}
.tpl-add-field-btn:hover { background: var(--surface2); color: var(--text); }

.coach-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-size: 1.4rem; border: none; cursor: pointer;
  box-shadow: 0 4px 20px rgba(99,102,241,.5);
  transition: transform .2s, box-shadow .2s;
  display: flex; align-items: center; justify-content: center;
}
.coach-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(99,102,241,.7); }
.coach-fab.active { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
@keyframes coachPulse {
  0%   { box-shadow: 0 0 0 0 rgba(99,102,241,.7); }
  70%  { box-shadow: 0 0 0 14px rgba(99,102,241,0); }
  100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}
.coach-fab.pulse { animation: coachPulse 1s ease-out 3; }
@keyframes coachGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(99,102,241,.4), 0 0 24px rgba(139,92,246,.2); }
  50%      { box-shadow: 0 0 16px rgba(99,102,241,.7), 0 0 40px rgba(139,92,246,.4); }
}
.coach-fab.glow { animation: coachGlow 2s ease-in-out infinite; }

.coach-panel {
  position: fixed; bottom: 90px; right: 24px; z-index: 299;
  width: 360px; max-height: 580px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 18px; box-shadow: 0 16px 48px rgba(0,0,0,.4);
  display: flex; flex-direction: column; overflow: hidden;
  transition: opacity .2s, transform .2s;
}
.coach-panel.hidden { display: none; }

.coach-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(139,92,246,.1));
  flex-shrink: 0;
}
.coach-header-left { display: flex; align-items: center; gap: 10px; }
.coach-avatar { font-size: 1.5rem; }
.coach-title { font-weight: 800; font-size: .92rem; }
.coach-subtitle { font-size: .68rem; color: var(--text-muted); }
.coach-close { background: none; border: none; color: var(--text-muted); font-size: 1rem; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.coach-close:hover { background: var(--surface2); color: var(--text); }

.coach-messages {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.coach-msg { display: flex; flex-direction: column; }
.coach-msg-bot { align-items: flex-start; }
.coach-msg-user { align-items: flex-end; }
.coach-msg-bubble {
  max-width: 90%; padding: 9px 13px; border-radius: 14px;
  font-size: .82rem; line-height: 1.55; white-space: pre-wrap;
}
.coach-msg-bot .coach-msg-bubble {
  background: var(--surface2); color: var(--text); border-radius: 4px 14px 14px 14px;
}
.coach-msg-user .coach-msg-bubble {
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  border-radius: 14px 4px 14px 14px;
}
.coach-msg-action {
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3);
  border-radius: 10px; padding: 8px 12px; font-size: .78rem;
  color: #22c55e; margin-top: 4px; max-width: 90%;
}
.coach-thinking {
  display: flex; gap: 4px; padding: 10px 13px;
  background: var(--surface2); border-radius: 4px 14px 14px 14px;
  width: fit-content;
}
.coach-thinking span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted);
  animation: coachDot 1.2s infinite;
}
.coach-thinking span:nth-child(2) { animation-delay: .2s; }
.coach-thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes coachDot { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }

.coach-suggestions {
  padding: 0 12px 10px; display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0;
}
.coach-sug {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 11px; font-size: .72rem;
  color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s;
}
.coach-sug:hover { background: rgba(99,102,241,.15); color: #818cf8; border-color: #6366f1; }

.coach-input-row {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border); flex-shrink: 0;
  background: var(--surface2);
}
.coach-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; font-size: .82rem;
  color: var(--text); resize: none; font-family: inherit; line-height: 1.4;
}
.coach-input:focus { outline: none; border-color: #6366f1; }
.coach-send {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none; border-radius: 10px; color: #fff;
  padding: 0 14px; cursor: pointer; font-size: 1rem;
  transition: opacity .15s;
}
.coach-send:hover { opacity: .85; }
.coach-send:disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 500px) {
  .coach-panel { width: calc(100vw - 20px); right: 10px; bottom: 80px; }
}

/* ── Coach Settings Panel ───────────────────────────────────── */
.coach-icon-btn { background:none; border:none; font-size:1rem; cursor:pointer; padding:4px 6px; border-radius:6px; opacity:.7; }
.coach-icon-btn:hover { background:var(--surface2); opacity:1; }

.coach-settings {
  padding: 14px 14px 10px; border-bottom: 1px solid var(--border);
  background: var(--surface2); overflow-y: auto; max-height: 400px;
}
.coach-settings.hidden { display: none; }
.coach-settings-title { font-weight: 800; font-size: .88rem; margin-bottom: 12px; }

.coach-setting-group { margin-bottom: 12px; }
.coach-setting-label { display: block; font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.coach-setting-input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-size: .81rem; color: var(--text);
  font-family: inherit; resize: vertical;
}
.coach-setting-input:focus { outline: none; border-color: #6366f1; }

.coach-radio-group { display: flex; flex-direction: column; gap: 5px; }
.coach-radio-group label { display: flex; align-items: center; gap: 7px; font-size: .8rem; cursor: pointer; }
.coach-radio-group input[type="radio"] { accent-color: #6366f1; }

.coach-toggle-row { display: flex; align-items: center; gap: 8px; font-size: .8rem; cursor: pointer; }
.coach-toggle-row input[type="checkbox"] { accent-color: #6366f1; width: 15px; height: 15px; }
