/* ══════════════════════════════════════════════
   Fourwell Roadmap — Premium Dark UI
   ══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0f172a; /* Slate 900 */
  --bg-2: #1e293b; /* Slate 800 */
  --bg-3: #334155; /* Slate 700 for highlighting */
  --glass: rgba(15, 23, 42, 0.7);
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --text-primary: #f0f0fa;
  --text-secondary: #8080a0;
  --text-muted: #50506a;
  --accent: #7c3aed;
  --accent-light: #a855f7;
  --accent-glow: rgba(124,58,237,0.25);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --low: #64748b;
  --sidebar-w: 260px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --sidebar-collapsed: false;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

/* ── Layout ──────────────────────────────────── */
body { display: flex; height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s ease, min-width 0.3s ease;
  position: relative;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
  overflow: visible;
}

.main {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  position: relative;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}

.brand-icon { font-size: 20px; }

.project-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-list::-webkit-scrollbar { width: 4px; }
.project-list::-webkit-scrollbar-track { background: transparent; }
.project-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.proj-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  border: 1px solid transparent;
}

.proj-item:hover { background: var(--surface); }
.proj-item.active {
  background: var(--surface);
  border-color: var(--border);
}

.proj-item-icon { font-size: 18px; flex-shrink: 0; }
.proj-item-info { flex: 1; overflow: hidden; }
.proj-item-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proj-item-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.mini-pct { font-size: 10px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

.proj-progress { height: 6px; border-radius: 3px; }
.proj-progress::-webkit-progress-bar { background: var(--border); border-radius: 3px; }
.proj-progress::-webkit-progress-value { border-radius: 3px; transition: width 0.4s ease; }
.proj-progress::-moz-progress-bar { border-radius: 3px; transition: width 0.4s ease; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
}

.btn-logout:hover {
  background: rgba(239,68,68,0.15);
  border-color: var(--danger);
  color: var(--danger);
}

.version { font-size: 11px; color: var(--text-muted); text-align: center; }

/* ── Sidebar Dashboard ───────────────────────── */
.sidebar-dashboard {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.dash-value {
  font-weight: 600;
  color: var(--accent-light);
  font-family: 'JetBrains Mono', monospace;
}

.dash-label { font-size: 10px; }

.dash-stat-bar {
  height: 4px;
  background: var(--surface);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

#dash-global-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 99px;
  transition: width 0.4s ease;
  width: 0%;
}

/* ── Sidebar Toggle ──────────────────────────── */
.btn-toggle-sidebar {
  position: absolute;
  bottom: 16px;
  right: -36px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: right 0.3s ease, background 0.2s ease, color 0.2s ease;
  z-index: 100;
}

.btn-toggle-sidebar:hover {
  background: var(--surface-hover);
}

.sidebar.collapsed .btn-toggle-sidebar {
  right: 8px;
  transform: scaleX(-1);
}

/* ── Buttons ─────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  font-family: 'Inter', sans-serif;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  font-family: 'Inter', sans-serif;
}

.btn-secondary:hover { background: var(--surface-hover); }

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background var(--transition);
}

.btn-icon:hover { background: var(--surface-hover); }

.btn-danger-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background var(--transition);
}

.btn-danger-sm:hover { background: rgba(239,68,68,0.2); }

/* ── Empty State ─────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  text-align: center;
}

.empty-icon { font-size: 56px; opacity: 0.4; }
.empty-state h2 { color: var(--text-secondary); font-weight: 600; }
.empty-state p { color: var(--text-muted); max-width: 280px; }

/* ── Project Header ──────────────────────────── */
.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.project-meta {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.project-icon-lg { font-size: 40px; line-height: 1; }

.project-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.project-desc { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }

.project-actions { display: flex; gap: 8px; align-items: center; padding-top: 4px; }

/* ── Global Progress ─────────────────────────── */
.progress-global-wrap {
  margin-bottom: 32px;
}

.progress-global-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

#progress-pct { font-family: 'JetBrains Mono', monospace; color: var(--accent-light); }

.progress-bar-outer {
  width: 100%;
  height: 6px;
  background: var(--surface);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ── Phases ──────────────────────────────────── */
.phases-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 80px;
}

.phase-card {
  background: var(--bg-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.phase-card:hover { border-color: var(--border-hover); }

.phase-card.completed { border-color: rgba(16,185,129,0.25); }

.phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.phase-header:hover { background: var(--surface); }

.phase-chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.phase-card.collapsed .phase-chevron { transform: rotate(-90deg); }

.phase-title-group { flex: 1; }
.phase-name { font-size: 14px; font-weight: 600; }
.phase-desc-text { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.phase-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.phase-progress-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.phase-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.phase-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}

.phase-pct { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; min-width: 30px; text-align: right; }

.phase-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(16,185,129,0.15);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.25);
}

.btn-phase-menu {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background var(--transition);
  flex-shrink: 0;
}

.btn-phase-menu:hover { background: var(--surface); color: var(--text-primary); }

/* ── Tasks ───────────────────────────────────── */
.task-list {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
  cursor: default;
}

.task-item:hover {
  background: var(--surface);
  border-color: var(--border);
}

.task-item.done { opacity: 0.5; }

.task-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.task-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.task-sub-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-created-at {
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.task-created-at:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

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

.task-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--border-hover);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.task-item.done .task-checkbox {
  background: var(--success);
  border-color: var(--success);
}

.task-item.done .task-checkbox::after {
  content: '✓';
  font-size: 11px;
  color: #fff;
  font-weight: 700;
}

.task-checkbox:hover { border-color: var(--accent); transform: scale(1.1); }

.task-title {
  font-size: 13px;
  transition: text-decoration var(--transition), color var(--transition);
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.prio-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  flex-shrink: 0;
}

.prio-high { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.2); cursor: pointer; transition: background 0.2s ease; }
.prio-normal { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); cursor: pointer; transition: background 0.2s ease; }
.prio-low { background: rgba(100,116,139,0.12); color: #94a3b8; border: 1px solid rgba(100,116,139,0.2); cursor: pointer; transition: background 0.2s ease; }

.prio-badge:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

/* Task title inline editing */
.task-title-input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
}

.task-title-input:focus {
  outline: none;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.task-date-input,
.task-deadline-input {
  background: var(--bg-3);
  border: 1.5px solid #f59e0b;
  border-radius: 5px;
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
}

.task-date-input:focus,
.task-deadline-input:focus {
  outline: none;
  border-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.task-date {
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.15);
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.task-date:hover {
  background: rgba(16,185,129,0.15);
  border-color: rgba(16,185,129,0.3);
}

.task-date input[type="date"] {
  all: unset;
  font-size: 11px;
  color: var(--text-primary);
  cursor: pointer;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  padding: 3px 6px;
  border-radius: 4px;
  width: 100px;
}

.task-deadline {
  font-size: 12px;
  font-weight: 500;
  color: #fef3c7;
  background: rgba(245,158,11,0.25);
  border: 1.5px solid rgba(245,158,11,0.5);
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-deadline:hover {
  background: rgba(245,158,11,0.4);
  border-color: rgba(245,158,11,0.6);
  transform: translateY(-1px);
}

.task-deadline.overdue {
  color: #fecaca;
  background: rgba(239,68,68,0.3);
  border-color: rgba(239,68,68,0.6);
  animation: pulse-danger 2s infinite;
}

.task-deadline.overdue:hover {
  background: rgba(239,68,68,0.4);
  border-color: rgba(239,68,68,0.7);
}

.btn-task-del {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
}

.task-item:hover .btn-task-del { opacity: 1; }
.btn-task-del:hover { background: rgba(239,68,68,0.15); color: var(--danger); }

.task-add-row {
  display: flex;
  gap: 8px;
  padding: 8px 20px 16px;
}

.btn-add-task {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  font-family: 'Inter', sans-serif;
  width: fit-content;
}

.btn-add-task:hover {
  border-color: var(--accent-light);
  color: var(--accent-light);
  background: rgba(124,58,237,0.06);
}

/* ── Modals ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-3); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }

.modal-footer {
  padding: 16px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
}

/* ── Fields ──────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }

input[type="text"], textarea, select {
  background: var(--bg-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: none;
  width: 100%;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238080a0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
  padding-right: 40px;
}

input[type="text"]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

select option {
  background: #1e293b; /* Corresponds to var(--bg-2) */
  color: var(--text-primary);
}

input[type="password"] {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Modal de Login */
.modal-login {
  width: 360px;
  min-height: 420px;
}

.modal-login .modal-header {
  justify-content: center;
  padding: 28px 24px 20px;
}

.modal-login .modal-header h3 {
  font-size: 18px;
}

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

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--transition), border-color var(--transition);
}

.swatch:hover { transform: scale(1.15); }
.swatch.selected { border-color: var(--text-primary); transform: scale(1.15); }

/* ── Priority Radios ─────────────────────────── */
.priority-group { display: flex; gap: 12px; }

.priority-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

.priority-opt input { accent-color: var(--accent); }

/* ── Confetti ────────────────────────────────── */
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
}

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

/* ── Utilities ───────────────────────────────── */
.hidden { display: none !important; }

/* ── Sidebar Groups ──────────────────────────– */
.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
  border-radius: var(--radius-sm);
  width: 100%;
  text-align: left;
  position: relative;
}

.group-header:hover {
  background: var(--surface);
}

.group-header .group-actions {
  display: none;
  gap: 4px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.group-header:hover .group-actions {
  display: flex;
}

.group-header .group-icon { font-size: 14px; }
.group-header .group-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-header .group-chevron {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.sidebar-group.collapsed .group-chevron {
  transform: rotate(-90deg);
}

.group-projects {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: 4px;
}

.sidebar-group.collapsed .group-projects {
  display: none;
}

/* ── Animations ──────────────────────────────– */
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: translateY(0) } }

@keyframes taskComplete {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.task-item.completing { animation: taskComplete 0.3s ease; }

@keyframes pulse-danger {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ── Dashboard View ──────────────────────────── */
.dashboard-view {
  animation: fadeIn 0.3s ease;
}

.stats-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.stats-day-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.graph-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.trend-graph-svg-container {
  width: 100%;
  height: 200px;
  margin-top: 20px;
  position: relative;
}

.trend-graph-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.graph-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.graph-area {
  fill: url(#graph-gradient);
  opacity: 0.3;
}

.graph-point {
  fill: var(--bg-2);
  stroke: var(--accent-light);
  stroke-width: 2;
  transition: r 0.2s ease;
}

.graph-point:hover {
  r: 6;
}

.graph-axis {
  stroke: var(--border);
  stroke-width: 1;
}

.graph-bar {
  rx: 4;
  ry: 4;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0.8;
}

.graph-bar:hover {
  opacity: 1;
}

.graph-bar-high { fill: #ef4444; }
.graph-bar-normal { fill: #f59e0b; }
.graph-bar-low { fill: #64748b; }

.graph-label {
  fill: var(--text-muted);
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
}

.graph-tooltip {
  position: absolute;
  background: var(--bg-3);
  border: 1px solid var(--border-hover);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  pointer-events: none;
  display: none;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.stats-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-day-date {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-light);
}

.stats-day-total {
  font-size: 12px;
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 99px;
  color: var(--text-secondary);
}

.stats-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.stats-group-item {
  background: var(--surface);
  padding: 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
}

.stats-group-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-group-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stats-group-count {
  font-size: 18px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}

.stats-group-bar-outer {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

.stats-group-bar-inner {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

/* Premium Accents */
.glow-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.05) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

@media (max-width: 1100px) {
  .dashboard-view .stats-container[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* Priority Tasks Section */
.priority-task-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.priority-task-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.priority-task-card .task-checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-hover);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}

.priority-task-card .task-checkbox:hover {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.priority-task-card .task-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.priority-task-card .overdue {
  color: var(--danger);
  font-weight: 600;
}

/* ── Profile Modal Tabs ──────────────────────────── */
.prof-tab {
  background: none;
  border: none;
  color: #666;
  font-size: .8rem;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  font-family: inherit;
}

.prof-tab:hover { background: rgba(255,255,255,0.05); color: #ccc; }

.prof-tab.active { background: rgba(99,102,241,0.15); color: #a5b4fc; font-weight: 600; }

.prof-panel { display: none; }

.prof-panel.active { display: block; }
