/* ═══════════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES – Dark Theme
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --bg-base:        #0D1117;
  --bg-surface:     #161B22;
  --bg-elevated:    #1C2128;
  --bg-hover:       #21262D;
  --bg-active:      #2D333B;

  --border-subtle:  #1C2128;
  --border-default: #30363D;
  --border-strong:  #484F58;

  --text-primary:   #E6EDF3;
  --text-secondary: #8B949E;
  --text-muted:     #484F58;

  --accent:         #7C3AED;
  --accent-hover:   #6D28D9;
  --accent-glow:    rgba(124, 58, 237, 0.2);
  --accent-subtle:  rgba(124, 58, 237, 0.08);

  --success:        #3FB950;
  --success-subtle: rgba(63, 185, 80, 0.12);
  --warning:        #D29922;
  --error:          #F85149;
  --error-subtle:   rgba(248, 81, 73, 0.12);

  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);

  --nav-height:     56px;
  --sidebar-width:  210px;
  --transition:     0.15s ease;
  --transition-md:  0.25s ease;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { font-size: 14px; -webkit-text-size-adjust: 100%; height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
}

a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════ */
#app-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ── Nav ──────────────────────────────────────────────────────────── */
#nav {
  height: var(--nav-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  margin-right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand svg { opacity: 0.9; }

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-tab.active {
  color: var(--text-primary);
  background: var(--bg-active);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-icon-btn {
  background: none;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.nav-icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.save-indicator {
  font-size: 11px;
  color: var(--text-muted);
  transition: all var(--transition);
  min-width: 60px;
  text-align: right;
}

.save-indicator.saving { color: var(--warning); }
.save-indicator.saved  { color: var(--success);  }
.save-indicator.error  { color: var(--error);    }

/* ── Body (sidebar + main) ─────────────────────────────────────────── */
#body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  padding: 12px 0;
  transition: width var(--transition-md), opacity var(--transition-md);
}

#sidebar.collapsed {
  width: 0;
  opacity: 0;
  pointer-events: none;
}

.sidebar-section {
  padding: 0 12px 16px;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 12px 12px;
}

.chips-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Chips ────────────────────────────────────────────────────────── */
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  cursor: grab;
  user-select: none;
  transition: all var(--transition);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.chip:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.chip:active { cursor: grabbing; transform: scale(0.97); }

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

.chip-label { flex: 1; }

.chip.dragging {
  opacity: 0.5;
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* Drop highlight on task cards */
.task-card.drop-target {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Main Content ─────────────────────────────────────────────────── */
#main {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.view {
  display: none;
  width: 100%;
  overflow: hidden;
}

.view.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

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

.empty-state-icon { font-size: 48px; opacity: 0.4; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.empty-state-hint  { font-size: 13px; max-width: 280px; }

/* ═══════════════════════════════════════════════════════════════════
   TASK CARDS
   ═══════════════════════════════════════════════════════════════════ */
.task-card {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  padding: 10px 12px 8px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
  background: var(--bg-elevated);
}

.task-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-cat-color, transparent);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.task-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.task-card.status-done { opacity: 0.5; }

.task-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
  word-break: break-word;
}

.task-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.task-card-persons {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.person-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--avatar-color, #6B7280);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--avatar-color, #6B7280);
  flex-shrink: 0;
}

.task-card-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-weight: 500;
}

.status-open       { background: rgba(139,148,158,0.15); color: #8B949E; }
.status-in-progress{ background: rgba(124,58,237,0.15);  color: #A78BFA; }
.status-on-hold    { background: rgba(210,153,34,0.15);  color: #D29922; }
.status-blocked    { background: rgba(248,81,73,0.15);   color: #F85149; }
.status-done       { background: rgba(63,185,80,0.15);   color: #3FB950; }

/* ═══════════════════════════════════════════════════════════════════
   TIMELINE VIEW
   ═══════════════════════════════════════════════════════════════════ */
#view-timeline {
  flex-direction: column;
  overflow: hidden;
}

.timeline-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
  background: var(--bg-surface);
}

.timeline-toolbar-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.btn-sm {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-sm:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-hover); }

.btn-primary {
  background: var(--accent);
  border: 1px solid transparent;
  color: #fff;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition);
}
.btn-primary:hover { background: var(--accent-hover); }

.timeline-scroll-wrapper {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
}

.timeline-grid {
  display: grid;
  min-width: max-content;
  position: relative;
}

.timeline-header-row {
  display: contents;
}

.timeline-kw-header {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  border-right: 1px solid var(--border-subtle);
  z-index: 10;
  text-align: center;
  padding: 6px 8px 4px;
  min-width: 160px;
}

.timeline-kw-header.current-kw {
  background: var(--accent-subtle);
  border-bottom-color: var(--accent);
}

.timeline-kw-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.timeline-kw-header.current-kw .timeline-kw-label { color: #A78BFA; }

.timeline-date-range {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.timeline-label-col {
  position: sticky;
  left: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  z-index: 20;          /* always above bars (z-index:5) */
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  overflow: hidden;
  /* width controlled by JS via grid-template-columns */
}

.timeline-label-col.header {
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border-default);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-surface);
}

.timeline-cell {
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  transition: background var(--transition);
  /* height & min-width controlled by JS */
}

.timeline-cell:hover { background: var(--bg-hover); }
.timeline-cell.current-kw { background: var(--accent-subtle); }

.timeline-add-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}

.timeline-cell:hover .timeline-add-hint { opacity: 1; }

/* Task bars – positioned absolutely by JS */
.timeline-task-bar {
  position: absolute;
  border-radius: var(--radius-sm);
  padding: 0 8px;
  display: flex;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
  transition: filter var(--transition), transform var(--transition);
  border: 1px solid rgba(255,255,255,0.08);
  z-index: 5;
  user-select: none;
}

.timeline-task-bar:hover {
  filter: brightness(1.15);
  transform: scaleY(1.04);
  z-index: 6;
}

.timeline-task-bar-title {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dependency SVG overlay */
#dep-svg {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 4;
}

.dep-arrow {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}
.dep-dot {
  fill: var(--border-strong);
}
.dep-dot-end {
  fill: var(--text-muted);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

/* ── Resize Handle ────────────────────────────────────────────────── */
.bar-resize-handle {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 8px;
  cursor: ew-resize;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(255,255,255,0.08);
  transition: background var(--transition);
  flex-shrink: 0;
}

.timeline-task-bar:hover .bar-resize-handle {
  background: rgba(255,255,255,0.22);
}

.bar-resize-handle::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 16px;
  background: rgba(255,255,255,0.4);
  border-radius: 1px;
}

/* ── KW Drop Highlight ────────────────────────────────────────────── */
.kw-drop-highlight {
  pointer-events: none;
  z-index: 3;
  border-radius: var(--radius-sm);
  animation: kwHighlightPulse 0.8s ease infinite alternate;
}

@keyframes kwHighlightPulse {
  from { opacity: 0.7; }
  to   { opacity: 1;   }
}

/* ═══════════════════════════════════════════════════════════════════
   KANBAN VIEW
   ═══════════════════════════════════════════════════════════════════ */
#view-kanban {
  flex-direction: column;
  overflow: hidden;
}

.kanban-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
  background: var(--bg-surface);
}

.kanban-board {
  display: flex;
  gap: 12px;
  padding: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  align-items: flex-start;
}

.kanban-col {
  width: 270px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: 100%;
}

.kanban-col-header {
  padding: 12px 14px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.kanban-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.kanban-col-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.kanban-col-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 60px;
}

.kanban-cards .task-card { width: 100%; }

.kanban-drop-zone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  transition: all var(--transition);
}

.kanban-drop-zone.over {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════
   LIST VIEW
   ═══════════════════════════════════════════════════════════════════ */
#view-list {
  flex-direction: column;
  overflow: hidden;
}

.list-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
  background: var(--bg-surface);
  flex-wrap: wrap;
}

.filter-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  padding: 5px 10px;
  outline: none;
  transition: border-color var(--transition);
}

.filter-input:focus { border-color: var(--accent); }
.filter-input::placeholder { color: var(--text-muted); }

.filter-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
}

/* ── Bulk action bar ─────────────────────────────────────────────── */
.list-bulk-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.list-bulk-bar.active { display: flex; }

.bulk-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  min-width: 90px;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.bulk-select { max-width: 130px; }

.bulk-person-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.bulk-person-btn {
  padding: 4px 9px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.bulk-btn-delete {
  color: var(--error);
  border-color: rgba(248,81,73,0.3);
}

.bulk-btn-delete:hover {
  background: var(--error-subtle);
  border-color: var(--error);
}

/* ── Checkbox column ─────────────────────────────────────────────── */
.list-check-col {
  width: 36px;
  padding: 6px 4px 6px 12px !important;
  text-align: center;
}

.list-check-col input[type=checkbox] {
  cursor: pointer;
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.list-row-selected { background: var(--accent-subtle) !important; }

.list-table-wrapper {
  flex: 1;
  overflow: auto;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.list-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.list-table th:hover { color: var(--text-secondary); }
.list-table th.sort-asc::after  { content: ' ↑'; }
.list-table th.sort-desc::after { content: ' ↓'; }

.list-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.list-table tr { transition: background var(--transition); cursor: pointer; }
.list-table tr:hover td { background: var(--bg-hover); }

.list-table tr.status-done td { opacity: 0.55; }

.list-kw-badge {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.15s ease;
}

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

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: slideUp 0.2s ease;
  overflow: hidden;
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-sm  { width: 400px; }
.modal-md  { width: 560px; }
.modal-lg  { width: 720px; }
.modal-full { width: min(900px, 95vw); }

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ─ Form elements ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

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

.form-select {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.form-select:focus { border-color: var(--accent); }

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

/* ─ Settings lists ─────────────────────────────────────────────────── */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.settings-item-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
}

.settings-item-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
}

.settings-item-name-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  min-width: 0;
}

.settings-item-del {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.settings-item-del:hover { color: var(--error); background: var(--error-subtle); }

.btn-add-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  background: none;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 6px;
  transition: all var(--transition);
}

.btn-add-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }

/* color picker inline */
input[type="color"] {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-default);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  background: none;
  overflow: hidden;
}

input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }

/* ═══════════════════════════════════════════════════════════════════
   NOTIFICATIONS / TOAST
   ═══════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  animation: toastIn 0.2s ease;
  max-width: 300px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error);   }
.toast.info    { border-left: 3px solid var(--accent);  }

@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(20px); opacity: 0; }
}

.toast.out { animation: toastOut 0.2s ease forwards; }

/* ═══════════════════════════════════════════════════════════════════
   MICRO-ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */
@keyframes assignPulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.assign-flash { animation: assignPulse 0.4s ease; }

@keyframes bounceIn {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

.bounce-in { animation: bounceIn 0.25s ease; }

/* ═══════════════════════════════════════════════════════════════════
   MOBILE BOTTOM SHEET
   ═══════════════════════════════════════════════════════════════════ */
.mobile-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 150;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
}

.mobile-sheet.open { transform: translateY(0); }

.mobile-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border-default);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.mobile-sheet-header {
  padding: 10px 16px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.mobile-sheet-body {
  padding: 0 16px 16px;
  overflow-y: auto;
  flex: 1;
}

.mobile-sheet-section { margin-bottom: 14px; }

.mobile-sheet-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.mobile-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mobile-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border-default);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-elevated);
}

.mobile-chip:hover,
.mobile-chip.selected {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: #A78BFA;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE QUICK SHEET (MobileQuick)
   ═══════════════════════════════════════════════════════════════════ */
#mobile-quick-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 300;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
}

#mobile-quick-sheet.open { transform: translateY(0); }

.mq-handle {
  width: 36px; height: 4px;
  background: var(--border-default);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.mq-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.mq-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mq-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  transition: color var(--transition);
}
.mq-close:hover { color: var(--text-primary); }

.mq-body {
  padding: 12px 16px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mq-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.mq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mq-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.mq-chip:active { transform: scale(0.95); }

.mq-chip-active {
  background: var(--accent-subtle);
}

.mq-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.mq-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  background: var(--bg-elevated);
}

@keyframes mqFlash {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.9); }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.mq-flash { animation: mqFlash 0.25s ease; }

/* ═══════════════════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════
   NAV ADDITIONS
   ═══════════════════════════════════════════════════════════════════ */
.nav-icon-btn-muted {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-muted);
}

.nav-tab-icon { margin-right: 4px; font-style: normal; }

/* ═══════════════════════════════════════════════════════════════════
   MODAL GRID (responsive 2-column)
   ═══════════════════════════════════════════════════════════════════ */
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 20px;
  padding: 20px;
}

.modal-col-main { min-width: 0; }
.modal-col-side  { min-width: 0; }

/* ── Status pills ──────────────────────────────────────────────────── */
.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.status-pill {
  padding: 4px 10px;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.status-pill:hover {
  border-color: var(--sc, var(--accent));
  color: var(--sc, var(--accent));
}

.status-pill.active {
  background: color-mix(in srgb, var(--sc, var(--accent)) 12%, transparent);
  border-color: var(--sc, var(--accent));
  color: var(--sc, var(--accent));
}

/* ── Task status dot in modal header ──────────────────────────────── */
.task-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-open        { background: #8B949E; }
.status-dot-in-progress { background: #A78BFA; }
.status-dot-on-hold     { background: #D29922; }
.status-dot-blocked     { background: #F85149; }
.status-dot-done        { background: #3FB950; }

/* ── Title input in modal ─────────────────────────────────────────── */
.task-title-input {
  font-size: 17px !important;
  font-weight: 600 !important;
  padding: 10px 14px !important;
  border-color: transparent !important;
  background: transparent !important;
}

.task-title-input:focus {
  border-color: var(--accent) !important;
  background: var(--bg-surface) !important;
}

/* ── Person toggles ────────────────────────────────────────────────── */
.person-toggles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.person-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  color: var(--text-primary);
}

.person-toggle:hover { background: var(--bg-hover); border-color: var(--border-default); }

.person-toggle.active {
  background: var(--accent-subtle);
  border-color: var(--accent);
}

/* ── Dependency chips ──────────────────────────────────────────────── */
.dep-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
  padding: 4px 0;
}

.dep-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
}

.dep-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }

.dep-chip.dep-chip-active {
  background: var(--error-subtle);
  border-color: var(--error);
  color: var(--error);
}

.dep-kw {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 2px;
}

.dep-chip.dep-chip-active .dep-kw { color: inherit; opacity: 0.7; }

/* ═══════════════════════════════════════════════════════════════════
   MOBILE FAB
   ═══════════════════════════════════════════════════════════════════ */
#mobile-fab {
  display: none;
  position: fixed;
  bottom: 28px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  border: none;
  box-shadow: 0 4px 20px rgba(124,58,237,0.45);
  z-index: 100;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

#mobile-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(124,58,237,0.6); }
#mobile-fab:active { transform: scale(0.95); }

/* ═══════════════════════════════════════════════════════════════════
   CONFETTI (done celebration)
   ═══════════════════════════════════════════════════════════════════ */
.confetti-dot {
  position: fixed;
  width: 8px; height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;
  animation: confettifly 0.8s ease-out forwards;
}

@keyframes confettifly {
  0%   { transform: translate(0,0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(720deg); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE  ·  Tablet  (≤ 768px)
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  /* ── Layout ── */
  #sidebar    { display: none; }
  #mobile-fab { display: flex; }
  #btn-sidebar-toggle { display: none; }

  /* Full-height body (no accidental shrink) */
  #body, #main {
    min-height: 0;
  }

  /* ── Nav ── */
  .nav-tab         { padding: 6px 10px; font-size: 12px; }
  .nav-tab-label   { display: none; }
  .nav-tab-icon    { margin-right: 0; font-size: 16px; }

  /* ── Timeline ──
     KW_WIDTH/LABEL_W are set by JS, CSS should not override.
     Only add mobile-specific UX tweaks here.                        */
  .timeline-scroll-wrapper {
    -webkit-overflow-scrolling: touch;  /* momentum scroll iOS */
    overflow-x: auto;
    overflow-y: auto;
  }

  .timeline-toolbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .timeline-kw-header {
    padding: 5px 4px 3px;
  }

  .timeline-kw-label   { font-size: 10px; }
  .timeline-date-range { font-size: 9px; display: none; } /* hide date range on mobile */

  .timeline-label-col  { padding: 4px 6px; }

  .bar-resize-handle   { display: none; } /* no resize on touch */

  /* ── Modals ── */
  .modal       { width: 96vw !important; max-height: 94vh !important; }
  .modal-grid  { grid-template-columns: 1fr; gap: 0; padding: 14px; }
  .modal-col-side { border-top: 1px solid var(--border-subtle); padding-top: 14px; margin-top: 4px; }

  /* ── Kanban ── */
  .kanban-board {
    padding: 10px 10px 80px; /* bottom padding for FAB */
    -webkit-overflow-scrolling: touch;
  }
  .kanban-col { width: 230px; }

  /* ── List ── */
  .list-toolbar { padding: 8px 10px; gap: 6px; }
  .list-table td, .list-table th { padding: 8px 10px; }

  /* Hide less critical columns in list on mobile */
  .list-table th:nth-child(4),
  .list-table td:nth-child(4) { display: none; }  /* Kategorie */
  .list-table th:nth-child(7),
  .list-table td:nth-child(7) { display: none; }  /* KW Ende */
}

/* ── Bar title sliding text ── */
@keyframes slide-title {
  0%,  15% { transform: translateX(0); }
  85%, 100% { transform: translateX(var(--slide-dist, 0px)); }
}
.timeline-task-bar-title.sliding {
  text-overflow: clip;
  animation: slide-title 3s ease-in-out 0.3s infinite alternate;
}

/* ── Bar meta dots ── */
.bar-dots { display:flex; align-items:center; gap:3px; flex-shrink:0; margin-left:auto; padding-right:4px; }
.bar-dot  { display:inline-block; width:6px; height:6px; border-radius:50%; flex-shrink:0; }

/* ── Material / Shopping list ── */
.material-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.material-toggle-label input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.cost-prefix {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 12px; pointer-events: none;
}
.shopping-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.shopping-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 12px;
}
.shopping-item:hover { background: var(--bg-hover); }
.shopping-check { accent-color: var(--accent); flex-shrink: 0; }
.shopping-text  { flex: 1; color: var(--text-secondary); }
.shopping-text.done { text-decoration: line-through; color: var(--text-muted); }
.shopping-delete {
  flex-shrink: 0; background: none; border: none;
  color: var(--text-muted); font-size: 14px; cursor: pointer;
  line-height: 1; padding: 0 2px;
}
.shopping-delete:hover { color: var(--error); }
.shopping-add-row {
  display: flex; gap: 6px; margin-top: 8px;
}
.shopping-add-row .form-input { flex: 1; }

/* ── Image gallery ── */
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.image-thumb {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  flex-shrink: 0;
}
.image-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-thumb a   { display: block; width: 100%; height: 100%; }
.img-delete-btn {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,.55); border: none; border-radius: 50%;
  color: #fff; font-size: 11px; width: 18px; height: 18px;
  line-height: 18px; text-align: center;
  cursor: pointer; padding: 0;
}
.img-delete-btn:hover { background: var(--error); }
.img-upload-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; width: 64px; height: 64px;
  border: 1px dashed var(--border-default);
  border-radius: 6px; cursor: pointer;
  color: var(--text-muted); font-size: 10px;
  transition: border-color .15s, color .15s;
}
.img-upload-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Milestones ── */

/* KW hover tooltip – desktop only */
@media (hover: hover) {
  .timeline-kw-header[data-weeks]:hover::after {
    content: attr(data-weeks);
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-size: 10px;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
    pointer-events: none;
    z-index: 50;
  }
}

.ms-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 10px;
  margin-top: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: opacity .15s;
}
.ms-header-badge:hover { opacity: 0.75; }
.ms-badge-milestone { background: rgba(167,139,250,.2); color: #A78BFA; border: 1px solid rgba(167,139,250,.4); }
.ms-badge-deadline  { background: rgba(248,81,73,.15);  color: #F85149; border: 1px solid rgba(248,81,73,.35); }

.ms-add-btn {
  display: none;
  position: absolute;
  bottom: 3px; right: 3px;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.4;
}
.timeline-kw-header { position: relative; }
.timeline-kw-header:hover .ms-add-btn { display: block; }
.ms-add-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }

.ms-type-btn {
  flex: 1;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: background .15s, color .15s, border-color .15s;
}
.ms-type-btn[data-type="milestone"].active { background: rgba(167,139,250,.2); color: #A78BFA; border-color: rgba(167,139,250,.5); }
.ms-type-btn[data-type="deadline"].active  { background: rgba(248,81,73,.15);  color: #F85149; border-color: rgba(248,81,73,.4); }

/* ── Row drag ── */
.row-drag-handle {
  flex-shrink: 0;
  width: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  cursor: grab;
  opacity: 0;
  transition: opacity .15s;
  line-height: 1;
  padding: 2px 0;
}
.timeline-label-col:hover .row-drag-handle { opacity: 1; }
.row-drag-handle:active { cursor: grabbing; }

.row-drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 60;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11px;
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  white-space: nowrap;
  opacity: .9;
}

.row-drop-indicator {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  z-index: 25;
  pointer-events: none;
}

/* ── Context menu ── */
.context-menu {
  position: fixed; z-index: 9000;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 4px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  font-size: 13px;
}
.ctx-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-primary);
}
.ctx-item:hover { background: var(--bg-hover); }
.ctx-item-danger { color: var(--error); }
.ctx-item-danger:hover { background: rgba(248,81,73,.12); }
.ctx-divider { height: 1px; background: var(--border-subtle); margin: 3px 4px; }

/* ── Half-week toggle buttons ── */
.kw-half-btn {
  flex: 1;
  padding: 4px 0;
  font-size: 11px;
  border-radius: 5px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.kw-half-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE  ·  Phone  (≤ 480px)
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .nav-brand span { display: none; }
  .nav-tab        { padding: 6px 8px; }
  #btn-export, #btn-import { display: none; }

  /* Smaller status labels in timeline */
  .task-card-status { font-size: 9px; padding: 1px 4px; }

  /* Kanban cards more compact */
  .kanban-cards { gap: 6px; padding: 8px; }

  /* Reduce modal padding */
  .modal-grid  { padding: 10px; }
  .form-group  { margin-bottom: 12px; }
}
