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

:root {
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: #1e293b;
  --sidebar-border: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #f1f5f9;
  --sidebar-width: 240px;

  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-input: #f8fafc;

  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #6366f1;

  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --status-todo: #64748b;
  --status-doing: #3b82f6;
  --status-done: #10b981;
  --status-blocked: #ef4444;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);

  --font: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --transition: 150ms ease;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

/* ── LAYOUT ──────────────────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
}

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

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo svg { width: 18px; height: 18px; fill: white; }

.sidebar-brand {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--sidebar-text-active);
  letter-spacing: -0.02em;
}

.sidebar-section-label {
  padding: 16px 16px 6px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 400;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
.sidebar-item.active { background: var(--sidebar-active); color: var(--sidebar-text-active); font-weight: 500; }

.sidebar-item .dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.sidebar-item .count {
  margin-left: auto;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-add-btn {
  margin: 4px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-3);
  font-size: 0.85rem;
  background: none;
  border: 1px dashed rgba(255,255,255,0.12);
  transition: all var(--transition);
  font-family: var(--font);
}
.sidebar-add-btn:hover { border-color: rgba(255,255,255,0.25); color: var(--sidebar-text-active); }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition);
}
.user-card:hover { background: var(--sidebar-hover); }

.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; color: var(--sidebar-text-active); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--text-3); }

.logout-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-3);
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
  display: flex;
}
.logout-btn:hover { color: var(--danger); }

/* ── PROFILE MODAL ───────────────────────────────────────────────────────── */
.profile-avatar-wrap {
  position: relative;
  width: 84px; height: 84px;
  border-radius: 50%;
  cursor: pointer;
}
.profile-avatar-wrap .user-avatar { width: 84px; height: 84px; font-size: 32px; }
.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  color: white;
  opacity: 0;
  transition: opacity var(--transition);
}
.profile-avatar-overlay svg { width: 22px; height: 22px; }
.profile-avatar-wrap:hover .profile-avatar-overlay { opacity: 1; }

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 4px;
}
.btn-link:hover { text-decoration: underline; }

/* ── MAIN CONTENT ────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── PAGE HEADER ─────────────────────────────────────────────────────────── */
.page-header {
  padding: 20px 28px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.page-header-left { flex: 1; min-width: 0; }

.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-color-dot {
  width: 12px; height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── TABS ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  padding: 16px 28px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tab-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--font);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── TOOLBAR ─────────────────────────────────────────────────────────────── */
.toolbar {
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── BUTTON STYLES ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; display: block; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: var(--bg-card); color: var(--text-2); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-hover); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-icon { padding: 6px; }

/* ── CONTENT SCROLL AREA ─────────────────────────────────────────────────── */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 28px 40px;
}

/* ── DASHBOARD / HOME ────────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #d1d5db;
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.project-card-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.project-card-icon svg { width: 18px; height: 18px; fill: white; }

.project-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.project-card-desc {
  font-size: 0.8rem;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.task-count-badge {
  font-size: 0.75rem;
  color: var(--text-3);
  background: var(--bg-hover);
  padding: 3px 8px;
  border-radius: 20px;
}

.project-card-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.project-card:hover .project-card-actions { opacity: 1; }

.icon-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.danger:hover { background: #fef2f2; color: var(--danger); }
.icon-btn svg { width: 14px; height: 14px; }

/* ── TASK LIST VIEW ──────────────────────────────────────────────────────── */
.section-block {
  margin-bottom: 20px;
  border-radius: 8px;
  transition: opacity 150ms ease;
}
.section-block.dragging-section { opacity: 0.4; }
.section-block.drag-over-top    { box-shadow: inset 0 3px 0 0 var(--primary); }
.section-block.drag-over-bottom { box-shadow: inset 0 -3px 0 0 var(--primary); }

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  user-select: none;
}
.section-header.collapsed { border-radius: 8px; }

.section-drag-handle {
  display: flex;
  align-items: center;
  color: var(--text-3);
  cursor: grab;
  flex-shrink: 0;
  border-radius: 4px;
  padding: 2px;
}
.section-drag-handle:hover { color: var(--text-2); background: rgba(0,0,0,0.05); }
.section-drag-handle:active { cursor: grabbing; }
.section-drag-handle svg { width: 15px; height: 15px; display: block; }

.section-chevron {
  display: flex;
  align-items: center;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform 150ms ease;
}
.section-chevron svg { width: 15px; height: 15px; }
.section-chevron.collapsed { transform: rotate(-90deg); }

.section-color-bar {
  width: 4px; height: 20px;
  border-radius: 2px;
  flex-shrink: 0;
}

.section-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.section-task-count {
  font-size: 0.75rem;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.section-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
.section-header:hover .section-actions { opacity: 1; }

.tasks-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.task-row {
  display: grid;
  grid-template-columns: 1fr 120px 100px 100px 40px;
  align-items: center;
  padding: 0 16px;
  min-height: 46px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  gap: 8px;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--bg-hover); }

.task-row-header {
  display: grid;
  grid-template-columns: 1fr 120px 100px 100px 40px;
  padding: 7px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  border-top: none;
  gap: 8px;
}
.col-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.task-title-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}

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

.task-title-text {
  font-size: 0.875rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-title-text.done { text-decoration: line-through; color: var(--text-3); }

.task-links-count {
  font-size: 0.7rem;
  color: var(--text-3);
  background: var(--bg-hover);
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.date-cell {
  font-size: 0.8rem;
  color: var(--text-2);
  font-family: var(--font-mono);
}
.date-cell.overdue { color: var(--danger); }
.date-cell.empty { color: var(--text-3); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
}

.add-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  cursor: pointer;
  color: var(--text-3);
  font-size: 0.83rem;
  transition: all var(--transition);
}
.add-task-row:hover { background: var(--bg-hover); color: var(--primary); }

.unsectioned-tasks { margin-bottom: 20px; }

/* ── EMPTY STATES ────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  gap: 12px;
}
.empty-icon {
  width: 60px; height: 60px;
  background: var(--bg-hover);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.empty-icon svg { width: 28px; height: 28px; color: var(--text-3); }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.empty-subtitle { font-size: 0.85rem; color: var(--text-3); max-width: 320px; }

/* ── GANTT CHART ─────────────────────────────────────────────────────────── */
.gantt-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.gantt-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.gantt-left {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
}
.gantt-left::-webkit-scrollbar { display: none; }

.gantt-right {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
}
.gantt-right::-webkit-scrollbar { height: 8px; background: var(--bg-hover); }
.gantt-right::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.gantt-header-left {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 2;
}

.gantt-header-right {
  height: 52px;
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 2;
  min-width: max-content;
}

.gantt-month-col {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.gantt-month-label {
  padding: 6px 10px 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  white-space: nowrap;
}

.gantt-days-row {
  display: flex;
  flex: 1;
  align-items: center;
}

.gantt-day-cell {
  font-size: 0.68rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  text-align: center;
  flex-shrink: 0;
  position: relative;
}
.gantt-day-cell.today { color: var(--primary); font-weight: 700; }
.gantt-day-cell.weekend { color: var(--border); }

.gantt-task-row-left {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  cursor: pointer;
  transition: background var(--transition);
}
.gantt-task-row-left:hover { background: var(--bg-hover); }

.gantt-task-name {
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.gantt-task-assignee { flex-shrink: 0; display: flex; align-items: center; }

.gantt-task-row-right {
  height: 44px;
  position: relative;
  border-bottom: 1px solid var(--border);
  min-width: max-content;
}

.gantt-grid-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
  opacity: 0.5;
}
.gantt-grid-line.weekend { background: #f1f5f9; width: auto; opacity: 1; }
.gantt-today-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--primary);
  opacity: 0.7;
  z-index: 3;
}

.gantt-bar {
  position: absolute;
  top: 8px;
  height: 28px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 500;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: grab;
  transition: filter var(--transition), box-shadow var(--transition);
  z-index: 1;
  user-select: none;
}
.gantt-bar:hover { filter: brightness(1.1); box-shadow: 0 3px 8px rgba(0,0,0,0.2); }
.gantt-bar.dragging { filter: brightness(1.08); box-shadow: 0 4px 14px rgba(0,0,0,0.3); z-index: 5; opacity: 0.92 !important; }

.gantt-task-name.done,
.gantt-bar-label.done { text-decoration: line-through; }
.gantt-task-name.done { color: var(--text-3); }

.gantt-bar-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.gantt-bar-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-right: 5px;
  pointer-events: none;
}
.gantt-bar-avatar .user-avatar { border: 1.5px solid rgba(255, 255, 255, 0.85); }

.gantt-bar-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 2;
}
.gantt-bar-handle-left { left: 0; border-radius: 5px 0 0 5px; }
.gantt-bar-handle-right { right: 0; border-radius: 0 5px 5px 0; }
.gantt-bar-handle:hover { background: rgba(255,255,255,0.35); }

/* While dragging a gantt bar, lock the cursor and disable text selection
   across the whole page so the drag feels stable even if the pointer
   momentarily leaves the bar. */
body.gantt-dragging-move, body.gantt-dragging-move * { cursor: grabbing !important; user-select: none !important; }
body.gantt-dragging-resize, body.gantt-dragging-resize * { cursor: ew-resize !important; user-select: none !important; }

.gantt-section-header-row {
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
}

.gantt-section-row-left {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
}
.gantt-section-row-right {
  height: 34px;
  min-width: max-content;
  position: relative;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
}
.gantt-section-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── MODAL ───────────────────────────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  z-index: 100;
}

#modal-container {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 150ms ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.97) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal.wide { max-width: 640px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.modal-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }

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

.modal-footer {
  padding: 0 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── FORM ELEMENTS ───────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
}
.form-label span { color: var(--text-3); font-weight: 400; }

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-family: var(--font);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

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

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.color-picker-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}
.color-dot.selected, .color-dot:hover { border-color: var(--text); transform: scale(1.1); }

/* ── LINKS INPUT ─────────────────────────────────────────────────────────── */
.links-list { display: flex; flex-direction: column; gap: 6px; }
.link-item {
  display: flex;
  gap: 8px;
  align-items: center;
}
.link-item .form-input { flex: 1; font-family: var(--font-mono); font-size: 0.78rem; }
.remove-link-btn {
  width: 28px; height: 28px; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--text-3); border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.remove-link-btn:hover { background: #fef2f2; color: var(--danger); }

.add-link-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--primary-light);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 500;
  transition: all var(--transition);
}
.add-link-btn:hover { background: #e0e7ff; }

/* ── STATUS PILLS ────────────────────────────────────────────────────────── */
.status-todo { background: #f1f5f9; color: #475569; }
.status-doing { background: #eff6ff; color: #2563eb; }
.status-done { background: #f0fdf4; color: #16a34a; }
.status-blocked { background: #fef2f2; color: #dc2626; }

/* ── LOGIN ───────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
  padding: 20px;
}

.auth-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(99,102,241,0.15);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  animation: modal-in 300ms ease;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.auth-logo-icon {
  width: 44px; height: 44px;
  background: var(--primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.auth-logo-icon svg { width: 24px; height: 24px; fill: white; }
.auth-logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
}

.auth-title { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 4px; letter-spacing: -0.02em; }
.auth-subtitle { font-size: 0.85rem; color: var(--text-3); margin-bottom: 28px; }

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font);
  transition: all var(--transition);
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-error {
  background: #fef2f2;
  color: #dc2626;
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

/* ── TOAST ───────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--text);
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toast-in 200ms ease;
  max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

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

/* ── TASK DETAIL MODAL ───────────────────────────────────────────────────── */
.task-detail-links { display: flex; flex-direction: column; gap: 6px; }
.task-detail-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-hover);
  border-radius: 6px;
  text-decoration: none;
  color: var(--primary);
  font-size: 0.82rem;
  transition: background var(--transition);
}
.task-detail-link:hover { background: var(--primary-light); }

/* ── SCROLLBAR ───────────────────────────────────────────────────────────── */
.content-scroll::-webkit-scrollbar { width: 5px; }
.content-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

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

/* ── DROPDOWN MENU ───────────────────────────────────────────────────────── */
.dropdown-menu {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  z-index: 50;
  min-width: 140px;
  overflow: hidden;
  animation: modal-in 100ms ease;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: #fef2f2; }
.dropdown-item svg { width: 14px; height: 14px; }

/* ── MISC ────────────────────────────────────────────────────────────────── */
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.flex { display: flex; align-items: center; }
.divider { height: 1px; background: var(--border); margin: 4px 0; }

.btn svg, .sidebar-add-btn svg {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0;
  display: block;
}

/* ── FIX GLOBAL SVG ICONS ───────────────────────────────────────────────── */
svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Excepciones que deben ser más grandes */
.sidebar-logo svg       { width: 18px; height: 18px; }
.auth-logo-icon svg     { width: 24px; height: 24px; }
.project-card-icon svg  { width: 18px; height: 18px; }
.empty-icon svg         { width: 28px; height: 28px; }

/* Excepciones más pequeñas */
.icon-btn svg      { width: 14px; height: 14px; }
.logout-btn svg    { width: 16px; height: 16px; }
.modal-close svg   { width: 16px; height: 16px; }
.add-link-btn svg  { width: 13px; height: 13px; }

.resource-card:hover {
  box-shadow: var(--shadow-md) !important;
}
.resource-card:hover .resource-actions {
  opacity: 1 !important;
}

/* ── PROJECT NOTES (sticky notes, shown inside each section) ─────────────── */
.section-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-top: none;
}

.postit {
  position: relative;
  width: 170px;
  min-height: 110px;
  padding: 12px 12px 8px;
  border-radius: 2px 2px 10px 10px;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.14), 0 1px 2px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.postit:nth-child(3n+1) { transform: rotate(-1.4deg); }
.postit:nth-child(3n+2) { transform: rotate(1deg); }
.postit:nth-child(3n)   { transform: rotate(-0.4deg); }
.postit:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.18);
  z-index: 2;
}

/* Folded-corner detail, like a real sticky note */
.postit::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 0 15px 15px;
  border-color: transparent transparent rgba(15, 23, 42, 0.12) transparent;
  border-radius: 0 0 10px 0;
}

.postit-content {
  flex: 1;
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(15, 23, 42, 0.82);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
}
.postit-content a { color: inherit; text-decoration: underline; }
.postit-content strong { font-weight: 700; }
.postit-content u { text-decoration: underline; }

.postit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
}

.postit-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 150ms ease; }
.postit:hover .postit-actions { opacity: 1; }
.postit-actions .icon-btn { color: rgba(15, 23, 42, 0.45); }
.postit-actions .icon-btn:hover { color: rgba(15, 23, 42, 0.85); background: rgba(15, 23, 42, 0.08); }

.postit-yellow { background: #fdf1a8; }
.postit-pink   { background: #fad0e2; }
.postit-blue   { background: #c3e6fb; }
.postit-green  { background: #cdf0cf; }
.postit-purple { background: #e2d7fb; }

/* Bold/underline toolbar in the note editor */
.note-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}
.note-toolbar-btn {
  width: 28px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition);
}
.note-toolbar-btn:hover { background: var(--bg-hover); color: var(--text); }

.status-select {
  border: none;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
}
.status-select.status-todo    { background: #f1f5f9; color: #475569; }
.status-select.status-doing   { background: #eff6ff; color: #2563eb; }
.status-select.status-done    { background: #f0fdf4; color: #16a34a; }
.status-select.status-blocked { background: #fef2f2; color: #dc2626; }
.status-select:hover { filter: brightness(0.95); }

/* ── HOME WIDGETS ────────────────────────────────────────────────────────── */
.home-widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  align-items: start;
}

.home-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.home-widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.home-widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.home-widget-title svg { width: 15px; height: 15px; color: var(--text-3); }

.home-widget-count {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-3);
  background: var(--bg-hover);
  padding: 1px 7px;
  border-radius: 10px;
}

.home-widget-body {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.home-empty-mini {
  padding: 16px;
  font-size: 0.78rem;
  color: var(--text-3);
  text-align: center;
}

.home-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.home-item:last-child { border-bottom: none; }
.home-item:hover { background: var(--bg-hover); }

.home-item-title {
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.home-milestone-flag { display: inline-flex; }
.home-milestone-flag svg { width: 12px; height: 12px; }

.home-item-project {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.home-item-date {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-3);
  flex-shrink: 0;
  white-space: nowrap;
}
.home-item-date.overdue { color: var(--danger); font-weight: 600; }

/* ── MILESTONE CHIPS ─────────────────────────────────────────────────────── */
.milestone-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.78rem;
}
.milestone-chip-name { font-weight: 600; color: var(--text); }
.milestone-chip-date { color: var(--text-3); font-family: var(--font-mono); font-size: 0.72rem; }
.milestone-chip-date.overdue { color: var(--danger); }
.milestone-chip-actions { display: flex; gap: 0; opacity: 0; transition: opacity var(--transition); }
.milestone-chip:hover .milestone-chip-actions { opacity: 1; }
.milestone-chip-actions .icon-btn { width: 22px; height: 22px; }
.milestone-chip-actions .icon-btn svg { width: 12px; height: 12px; }

/* ── GANTT MILESTONE MARKER ──────────────────────────────────────────────── */
.gantt-milestone-col {
  position: absolute;
  top: 0; bottom: 0;
  z-index: 0;
  cursor: help;
}
.gantt-milestone-col:hover {
  z-index: 20;
}
.gantt-milestone-col::after,
.gantt-day-cell.has-milestone::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--text);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 20;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.gantt-milestone-col::before,
.gantt-day-cell.has-milestone::before {
  content: '';
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 20;
}
.gantt-milestone-col:hover::after, .gantt-milestone-col:hover::before,
.gantt-day-cell.has-milestone:hover::after, .gantt-day-cell.has-milestone:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.gantt-milestone-flag {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gantt-milestone-flag svg {
  width: 7px; height: 7px;
  stroke: white;
}
.gantt-day-cell.has-milestone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-weight: 700;
  color: var(--text);
}

/* ── PROJECT MEMBERS ─────────────────────────────────────────────────────── */
.member-check-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
}

.member-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-2);
  transition: background var(--transition);
}
.member-check-row:hover { background: var(--bg-hover); }
.member-check-row.is-you { cursor: default; }
.member-check-row.is-you:hover { background: none; }

.member-checkbox { flex-shrink: 0; width: 15px; height: 15px; accent-color: var(--primary); }

.user-avatar-sm {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.member-check-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── BRANDS (Immersive / Liquid) ─────────────────────────────────────────── */
.brand-badge-icon {
  border-radius: 5px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 5px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.brand-chip img { border-radius: 4px; flex-shrink: 0; display: block; }

.brand-picker-row {
  display: flex;
  gap: 10px;
}
.brand-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg-card);
  transition: border-color var(--transition), background var(--transition);
}
.brand-option img { width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0; }
.brand-option-name { font-size: 0.8rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.brand-option-sub { font-size: 0.68rem; color: var(--text-3); }
.brand-option.selected { background: var(--bg-hover); }

/* ─── HOLIDAY CALENDAR ───────────────────────────────────────────────────────── */
.calendar-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.calendar-month {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.calendar-month-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
  color: var(--text);
  text-transform: capitalize;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 8px;
}

.calendar-weekdays > div {
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 4px 0;
}

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

.cal-day,
.cal-day-empty {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.75rem;
  border-radius: 4px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
}

.cal-day-num { line-height: 1; }

.cal-day-avatars {
  display: flex;
  align-items: center;
  line-height: 0;
}
.cal-day-avatars .user-avatar {
  margin-left: -5px;
  border: 1.5px solid var(--bg-card);
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.08);
}
.cal-day-avatars .user-avatar:first-child { margin-left: 0; }
.cal-day.holiday .cal-day-avatars .user-avatar { border-color: #fef3c7; }
.cal-day-more {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-3);
  margin-left: 2px;
}

.cal-day-empty {
  background: transparent;
  border: none;
}

.cal-day.holiday {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(252, 211, 77, 0.5);
}

.cal-day.holiday:hover {
  background: #fce7a6;
  box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.7);
}

.holidays-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.holiday-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.holiday-row:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.holiday-info {
  flex: 1;
  min-width: 0;
}

.holiday-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.holiday-owner {
  font-weight: 500;
  color: var(--text-3);
}

.holiday-dates {
  font-size: 0.75rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-top: 3px;
}

.holiday-notes {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 5px;
  font-style: italic;
}

.holiday-row-actions {
  display: flex;
  gap: 4px;
  margin-left: 12px;
  flex-shrink: 0;
}
/* ── CALENDAR PAGE (full-screen team calendar) ──────────────────────────────── */
.cal-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-nav [data-action="cal-prev"] svg { transform: rotate(90deg); }
.cal-nav [data-action="cal-next"] svg { transform: rotate(-90deg); }

.cal-current-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-transform: capitalize;
  min-width: 130px;
}

.cal-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-2);
  font-weight: 500;
}

.cal-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Big month view — weeks stacked as continuous grids so multi-day absences
   render as one unbroken bar (see renderCalWeekRow in app.js) */
.calendar-big {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-hover);
  padding: 14px;
  margin-bottom: 20px;
}

.calendar-weekdays-big {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 8px;
}

.calendar-weekdays-big > div {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 4px 0;
}

.calendar-grid-weeks {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
}
.calendar-grid-weeks .cal-week:first-child {
  border-top: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.calendar-grid-weeks .cal-week:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Full-height column background — this is what makes the vertical grid
   lines run the whole way down through the bars, not just behind the
   day number. */
.cal-cell-bg {
  border-right: 1px solid var(--border);
  min-height: 100%;
}
.cal-cell-bg.last-col { border-right: none; }
.cal-cell-bg.other-month { background: var(--bg-hover); }
.cal-cell-bg.today { background: var(--primary-light); }

.cal-week .cal-day-num {
  padding: 7px 9px 3px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1;
}
.cal-week .cal-day-num.other-month { color: var(--text-3); opacity: 0.55; font-weight: 500; }
.cal-week .cal-day-num.today { color: var(--primary); font-weight: 700; }

.cal-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 1px 4px 2px;
  padding: 2px 8px 2px 3px;
  border-radius: 10px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  cursor: default;
}
.cal-bar .user-avatar {
  width: 15px; height: 15px;
  font-size: 7px;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
}
.cal-bar-label { overflow: hidden; text-overflow: ellipsis; }

.cal-bar-more {
  margin: 0 4px 3px;
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-3);
}

/* Year view mini-months (extends the existing .calendar-month styles) */
.calendar-month-clickable { cursor: pointer; transition: all var(--transition); }
.calendar-month-clickable:hover { border-color: var(--primary); background: var(--primary-light); }

.cal-day.today { box-shadow: 0 0 0 1.5px var(--primary); }

.cal-day-dots {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5px;
  width: 100%;
  padding: 0 3px;
}

.cal-dot {
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  flex-shrink: 0;
}