/* ── SIDEBAR ──────────────────────────────────────────────────────── */
.sidebar {
  width: 300px; flex-shrink: 0; border-right: 1px solid var(--border);
  background: var(--surface); overflow-y: auto; padding: 0.8rem 0.7rem;
  display: flex; flex-direction: column; gap: 1.2rem;
  font-family: 'Shippori Antique B1','JetBrains Mono', 'Fira Mono', 'Cascadia Code', monospace;
}
.sidebar-footer {
  margin-top: auto; padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-start;
}
.trash-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 1rem; padding: 0.2rem 0.3rem; border-radius: 4px;
  transition: all 0.15s; line-height: 1;
}
.trash-btn:hover { color: var(--danger); background: rgba(255,80,80,0.08); }

/* ── UPDATE BADGE ─────────────────────────────────────────────────── */
#updateBadge {
  display: none; align-items: center; gap: 0.3rem;
  font-size: 0.55rem; padding: 0.2rem 0.5rem; border-radius: 4px;
  border: 1px solid #4caf7d; background: rgba(76,175,125,0.12);
  color: #4caf7d; cursor: pointer; font-family: var(--font);
  transition: all 0.15s; white-space: nowrap; text-decoration: none;
}
#updateBadge:hover { background: rgba(76,175,125,0.25); border-color: #6fcf97; color: #6fcf97; }
#updateBadge.visible { display: flex; }

/* ── HIGHLIGHT TS / TPE ──────────────────────────────────────────────── */
.urgency-item.highlight-ts  { background: #2a2a2a; }
.urgency-item.highlight-tpe { background: #2a1215; }
#btnHighlightTS.hl-active  {
  border-color: #888; color: #ddd; background: #2a2a2a;
  box-shadow: 0 0 6px rgba(180,180,180,0.5), 0 0 12px rgba(180,180,180,0.2);
}
#btnHighlightTPE.hl-active {
  border-color: #c04040; color: #f08080; background: #2a1215;
  box-shadow: 0 0 6px rgba(200,60,60,0.6), 0 0 12px rgba(200,60,60,0.25);
}

/* Inline alert sous la BA */
.inline-alert {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.7rem; margin: 0.3rem 0;
  background: rgba(255,128,64,0.1); border: 1px solid rgba(255,128,64,0.35);
  border-radius: 5px; font-size: 0.7rem; color: #ffb080;
  animation: fadeInDown 0.2s ease;
}
@keyframes fadeInDown { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.section-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; }
.sort-toggle { background: none; border: 1px solid var(--border); color: var(--muted);
  font-size: 0.9em; padding: 0.15rem 0.45rem; border-radius: 4px; cursor: pointer;
  font-family: var(--font); transition: all 0.12s; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; }
.sort-toggle:hover { border-color: var(--accent); color: var(--accent); }
.sort-toggle.active { border-color: var(--accent); color: var(--accent); background: #c8b8ff18; }
.section-label {
  font-family: 'Shippori Antique B1','Rajdhani','Share Tech','Arial Narrow',sans-serif;
  font-size: 1.1rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: #ffffff; text-shadow: 0 0 8px rgba(255,255,255,0.35);
  margin-bottom: 0.3rem;
}
.add-project-form { display: flex; flex-direction: column; gap: 0.45rem; }
.add-project-form input, .add-project-form select {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); font-family: var(--font); font-size: 0.62rem; padding: 0.3rem 0.45rem;
}
.add-project-form input:focus, .add-project-form select:focus { outline: none; border-color: var(--accent); }
.input-label { font-size: 0.55rem; color: var(--muted); }
.color-row { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.color-swatch {
  width: 16px; height: 16px; border-radius: 3px; cursor: pointer;
  border: 2px solid transparent; transition: transform 0.1s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: white; }
.btn { background: var(--accent); color: var(--bg); border: none; border-radius: 5px;
  padding: 0.35rem 0.7rem; font-family: var(--font); font-size: 0.62rem;
  font-weight: 600; cursor: pointer; transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }
.btn-sm { padding: 0.2rem 0.45rem; font-size: 0.58rem; }
.btn-green { background: var(--green); color: white; }
.btn-danger { background: none; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; opacity: 1; }
.input-row { display: flex; gap: 0.4rem; align-items: center; }
.input-row input { flex: 1; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font-family: var(--font);
  font-size: 0.62rem; padding: 0.28rem 0.4rem; }
.input-row input:focus { outline: none; border-color: var(--accent); }

/* Project list */
.project-list { display: flex; flex-direction: column; gap: 0.1rem; }
.project-item {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.18rem 0.4rem;
  border-radius: 4px; cursor: pointer; border: 1px solid transparent;
  transition: all 0.12s; font-size: 0.85rem;
}
.project-item:hover { background: var(--surface2); }
.project-item.active { background: var(--surface2); border-color: var(--accent); }
.project-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.project-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-cat { font-size: 0.85em; color: var(--muted); }
.proj-add-btn {
  flex-shrink: 0;
  background: none; border: none; color: transparent;
  font-size: 0.8rem; font-weight: 700; line-height: 1;
  cursor: pointer; padding: 0 2px; border-radius: 3px;
  transition: all 0.12s;
}
.project-item:hover .proj-add-btn { color: var(--muted); }
.proj-add-btn:hover { color: var(--accent) !important; background: rgba(200,184,255,0.1); }

/* Cat list */
.cat-list { display: flex; flex-direction: column; gap: 0.1rem; }
/* Étoile favori — mauve sombre, invisible par défaut, visible au hover */
.fav-star {
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 0.75rem; line-height: 1; color: #8a7faa; transition: all 0.15s;
  flex-shrink: 0; opacity: 0;
}
.project-item:hover .fav-star,
.cat-item:hover .fav-star { opacity: 1; }
.fav-star.active { color: #8a7faa; opacity: 1; }
/* Section favoris */
.fav-section { margin-bottom: 0.4rem; }
.fav-section-label {
  font-family: 'Shippori Antique B1','Rajdhani','Share Tech','Arial Narrow',sans-serif;
  font-size: 1.1rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: #ffffff; text-shadow: 0 0 8px rgba(255,255,255,0.35);
  padding: 0.2rem 0.1rem 0.25rem;
  display: flex; align-items: center; justify-content: space-between;
}
.fav-collapse-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.65rem; padding: 0; line-height: 1; transition: transform 0.15s;
}
.fav-collapse-btn.collapsed { transform: rotate(-90deg); }
.fav-hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0 0.03rem; }
.fav-item {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.18rem 0.4rem; border-radius: 3px; cursor: pointer;
  font-size: 0.85rem; color: #f5ead8; transition: background 0.1s;
}
.fav-item:hover { background: var(--surface2); }
.fav-item.active { color: var(--accent); font-weight: 600; }
.fav-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.fav-cat-icon { font-size: 0.6rem; color: var(--muted); flex-shrink: 0; }
/* Étoile dans la liste favoris = jaune très doux */
.fav-item .fav-star { opacity: 1; color: #ffe8a0; font-size: 0.7rem; }
.fav-item .fav-star:hover { color: #ffd23c; }
/* Sous-groupes collapsibles par nb tâches */
.proj-group, .cat-group { margin-bottom: 0; }
.proj-group-header, .cat-group-header {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.9rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); padding: 0.15rem 0.3rem; cursor: pointer;
  border-radius: 3px; transition: color 0.12s; user-select: none;
}
.proj-group-header:hover, .cat-group-header:hover { color: var(--text); }
.proj-group-header[data-g="zero"], .cat-group-header[data-g="zero"] { background: rgba(96, 84, 210, 0.05);  color: rgba(194, 182, 255, 0.28); }
.proj-group-header[data-g="g12"],  .cat-group-header[data-g="g12"]  { background: rgba(96, 84, 210, 0.11);  color: rgba(194, 182, 255, 0.52); }
.proj-group-header[data-g="g34"],  .cat-group-header[data-g="g34"]  { background: rgba(96, 84, 210, 0.20);  color: rgba(194, 182, 255, 0.75); }
.proj-group-header[data-g="g5"],   .cat-group-header[data-g="g5"]   { background: rgba(96, 84, 210, 0.30);  color: rgba(194, 182, 255, 1.00); }
.group-chevron { font-size: 1.6rem; transition: transform 0.15s; display: inline-block; line-height: 1; }
.group-chevron.collapsed { transform: rotate(-90deg); }
.group-body { overflow: hidden; }
.group-body.collapsed { display: none; }

.cat-item { display: flex; align-items: center; gap: 0.4rem;
  padding: 0.18rem 0.4rem; border-radius: 3px; font-size: 0.85rem; cursor: pointer;
  border: 1px solid transparent; transition: all 0.12s; }
.cat-item.active { background: var(--surface2); border-color: var(--accent); }
.cat-item.active .cat-name { color: #c8b8ff !important; font-weight: 600 !important; }
.cat-item:hover { background: var(--surface2); }
.cat-del { background: none; border: none; color: transparent; cursor: pointer; font-size: 0.65rem; flex-shrink:0; }
.cat-item:hover .cat-del { color: var(--muted); }
.cat-del:hover { color: var(--danger) !important; }
.cat-name { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ── GLOBAL TIMER ────────────────────────────────────────────────────── */
.global-timer {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.2rem 0.6rem;
  font-family: var(--font); font-size: 1.05rem; font-weight: 700;
  letter-spacing: 0.08em; color: var(--text);
  cursor: pointer; user-select: none; transition: border-color 0.15s;
  position: relative;
}
.global-timer:hover { border-color: var(--accent); }
.global-timer.running { border-color: var(--accent3); color: var(--accent3);
  box-shadow: 0 0 8px rgba(122,255,212,0.25); }
.global-timer.finished { border-color: var(--danger); color: var(--danger);
  animation: timerFinPulse 0.7s ease-in-out infinite; }
@keyframes timerFinPulse {
  0%,100% { box-shadow: 0 0 6px rgba(255,107,107,0.4); }
  50%      { box-shadow: 0 0 14px rgba(255,107,107,0.8); }
}
.timer-btn {
  background: none; border: none; cursor: pointer; color: inherit;
  font-size: 0.85rem; padding: 0 0.1rem; line-height: 1; opacity: 0.7;
  transition: opacity 0.12s;
}
.timer-btn:hover { opacity: 1; }

/* Timer preset popover */
.timer-popover {
  display: none; position: fixed;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.7rem 0.9rem; z-index: 10000;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  min-width: 200px; font-size: 0.75rem;
}
.timer-popover.open { display: block; }
.timer-presets { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.timer-preset-btn {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); border-radius: 4px; padding: 0.2rem 0.5rem;
  font-family: var(--font); font-size: 0.7rem; cursor: pointer;
  transition: all 0.12s;
}
.timer-preset-btn:hover { border-color: var(--accent3); color: var(--accent3); }
.timer-custom-row { display: flex; gap: 0.3rem; align-items: center; }
.timer-custom-row input {
  width: 44px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font-family: var(--font);
  font-size: 0.78rem; text-align: center; padding: 0.2rem 0.3rem;
}
.timer-custom-row span { color: var(--muted); }
.timer-start-btn {
  margin-top: 0.5rem; width: 100%;
  background: var(--accent3); color: #000; border: none; border-radius: 5px;
  font-family: var(--font); font-size: 0.72rem; font-weight: 700;
  padding: 0.3rem 0; cursor: pointer; transition: opacity 0.12s;
}
.timer-start-btn:hover { opacity: 0.85; }

/* Watch icon on task row — same hover behaviour as settings gear */
.task-watch-icon {
  opacity: 0; cursor: pointer;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0; line-height: 1; color: #ffffff;
  background: none; border: none; padding: 0;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px;
}
.urgency-item:hover .task-watch-icon { opacity: 1; }
.task-watch-icon:hover { color: var(--accent3) !important; }
.task-watch-icon.running { opacity: 1 !important; color: var(--accent3);
  filter: drop-shadow(0 0 4px rgba(122,255,212,0.7)); }

/* Mini timer popover on task */
.task-timer-pop {
  display: none; position: fixed;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.6rem 0.8rem; z-index: 10000;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5); min-width: 180px;
  font-family: var(--font); font-size: 0.75rem;
}
.task-timer-pop.open { display: block; }
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 0.75rem;
  padding: 0.55rem 1.1rem; border-radius: 6px; z-index: 9999;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  animation: toastIn 0.2s ease, toastOut 0.3s ease 2.7s forwards;
  pointer-events: none; max-width: 340px; text-align: center;
}
.toast.warn { border-color: #ff8040; color: #ffb080; }
@keyframes toastIn  { from { opacity:0; transform:translateX(-50%) translateY(8px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; } }
.toast-reload {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--surface2); border: 1px solid var(--accent);
  color: var(--text); font-family: var(--font); font-size: 0.75rem;
  padding: 0.55rem 1.1rem; border-radius: 6px; z-index: 9999;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  animation: toastIn 0.2s ease;
  display: flex; align-items: center; gap: 0.6rem; white-space: nowrap;
}
.toast-reload button:first-of-type {
  background: var(--accent); border: none; color: #000; font-family: var(--font);
  font-size: 0.72rem; padding: 0.2rem 0.6rem; border-radius: 4px; cursor: pointer;
  font-weight: 600;
}
/* Shortcuts */
.shortcuts-section { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.shortcut-list { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.8rem; }
.shortcut-item {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.28rem 0.4rem;
  border-radius: 4px; border: 1px solid var(--border); background: var(--surface2);
  cursor: pointer; transition: border-color 0.12s;
}
.shortcut-item:hover { border-color: var(--accent); }
.shortcut-favicon { width: 13px; height: 13px; border-radius: 2px; flex-shrink: 0; object-fit: contain; }
.shortcut-favicon-placeholder {
  width: 13px; height: 13px; border-radius: 2px; flex-shrink: 0;
  background: var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 0.45rem; color: var(--muted);
}
.shortcut-label { flex: 1; font-size: 0.95em; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcut-label:hover { color: var(--accent); }
.shortcut-type-badge {
  font-size: 0.45rem; padding: 0.05rem 0.25rem; border-radius: 2px;
  border: 1px solid var(--border); color: var(--muted); flex-shrink: 0;
}
.shortcut-type-badge.app { color: var(--accent2); border-color: #ff9e7a44; }
.shortcut-type-badge.web { color: var(--accent); border-color: #c8b8ff44; }
.shortcut-del { background: none; border: none; color: transparent; cursor: pointer; font-size: 0.7rem; flex-shrink: 0; }
.shortcut-item:hover .shortcut-del { color: var(--muted); }
.shortcut-del:hover { color: var(--danger) !important; }
.shortcut-edit-btn { background: none; border: none; color: transparent; cursor: pointer; font-size: 0.6rem; flex-shrink: 0; }
.shortcut-item:hover .shortcut-edit-btn { color: var(--muted); }
.shortcut-edit-btn:hover { color: var(--accent) !important; }
.shortcut-add-row { display: flex; gap: 0.4rem; }
.shortcut-add-row input {
  flex: 1; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font-family: var(--font);
  font-size: 0.6rem; padding: 0.25rem 0.4rem;
}
.shortcut-add-row input:focus { outline: none; border-color: var(--accent); }

/* ── THÈME CLAIR — overrides sidebar ────────────────────────────────── */
:root[data-theme="light"] .section-label {
  color: #2a1a5e;
  text-shadow: none;
}
:root[data-theme="light"] .fav-section-label {
  color: #2a1a5e;
  text-shadow: none;
}
:root[data-theme="light"] .fav-item {
  color: var(--text);
}
:root[data-theme="light"] .fav-item .fav-star {
  color: #b8860b;
}
:root[data-theme="light"] .proj-group-header[data-g="zero"],
:root[data-theme="light"] .cat-group-header[data-g="zero"] {
  background: rgba(96, 84, 210, 0.07);
  color: rgba(60, 40, 160, 0.35);
}
:root[data-theme="light"] .proj-group-header[data-g="g12"],
:root[data-theme="light"] .cat-group-header[data-g="g12"] {
  background: rgba(96, 84, 210, 0.12);
  color: rgba(60, 40, 160, 0.60);
}
:root[data-theme="light"] .proj-group-header[data-g="g34"],
:root[data-theme="light"] .cat-group-header[data-g="g34"] {
  background: rgba(96, 84, 210, 0.20);
  color: rgba(60, 40, 160, 0.85);
}
:root[data-theme="light"] .proj-group-header[data-g="g5"],
:root[data-theme="light"] .cat-group-header[data-g="g5"] {
  background: rgba(96, 84, 210, 0.28);
  color: rgba(60, 40, 160, 1.00);
}
