:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d2e;
  --bg-card: #1e2130;
  --bg-hover: #252840;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --accent-purple: #8b5cf6;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #2d3148;
  --border-light: #3d4268;
  --sidebar-width: 240px;
  --header-height: 56px;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

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

/* ─── SIDEBAR ─────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--accent-blue);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.sidebar-logo .logo-text {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}
.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

nav { padding: 8px 0; flex: 1; }

.nav-section {
  padding: 16px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 0;
  transition: all 0.15s;
  font-size: 13.5px;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: rgba(59,130,246,0.1);
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
}
.nav-item .icon { width: 16px; text-align: center; flex-shrink: 0; }

.nav-sub { padding-left: 28px; }
.nav-sub .nav-item { font-size: 13px; }

/* ─── MAIN ─────────────────────────────────────── */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ─── HEADER ─────────────────────────────────────── */
#header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
}

.search-wrapper {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-wrapper input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px 8px 36px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.search-wrapper input:focus { border-color: var(--accent-blue); }
.search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

#search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}
#search-results.visible { display: block; }
.search-group { padding: 8px 0; }
.search-group-title {
  padding: 4px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 700;
}
.search-result-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-result-item:hover { background: var(--bg-hover); }
.search-result-item .type-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--border);
  color: var(--text-secondary);
}

.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.btn-icon {
  width: 34px; height: 34px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.btn-icon:hover { color: var(--text-primary); border-color: var(--border-light); }

/* ─── CONTENT ─────────────────────────────────────── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ─── VIEWS ─────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ─── PAGE TITLE ─────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ─── BUTTONS ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border: none;
  transition: all 0.15s;
}
.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ─── STAT CARDS ─────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--border-light); }
.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}
.stat-card .stat-sub { font-size: 11px; color: var(--text-muted); }
.stat-card.blue .stat-value { color: var(--accent-blue); }
.stat-card.cyan .stat-value { color: var(--accent-cyan); }
.stat-card.green .stat-value { color: var(--accent-green); }
.stat-card.yellow .stat-value { color: var(--accent-yellow); }
.stat-card.red .stat-value { color: var(--accent-red); }
.stat-card.orange .stat-value { color: var(--accent-orange); }
.stat-card.purple .stat-value { color: var(--accent-purple); }

/* ─── GRID 2-COL ─────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 24px; }

/* ─── CARDS ─────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 18px; }

/* ─── PROGRESS BAR ─────────────────────────────── */
.progress-bar-wrap {
  background: var(--bg-primary);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin: 6px 0;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  transition: width 0.5s;
}

/* ─── BAR CHART ─────────────────────────────────── */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 100px; padding: 8px 0; }
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-fill { width: 100%; border-radius: 3px 3px 0 0; min-height: 4px; transition: height 0.4s; }
.bar-label { font-size: 9px; color: var(--text-muted); text-align: center; }
.bar-val { font-size: 10px; font-weight: 600; color: var(--text-secondary); }

/* ─── ACTIVITY FEED ─────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; width: 72px; flex-shrink: 0; padding-top: 2px; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
  margin-top: 6px;
  flex-shrink: 0;
}
.activity-content { flex: 1; }
.activity-action { font-size: 12px; color: var(--text-secondary); }
.activity-target { font-size: 13px; color: var(--text-primary); font-weight: 500; }

/* ─── TABLE ─────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
th:hover { color: var(--text-primary); }
th.sorted { color: var(--accent-blue); }
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.col-id { width: 50px; }
.col-actions { width: 120px; text-align: right; }

/* ─── BADGES ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Status badges */
.badge-todo { background: rgba(100,116,139,0.2); color: #94a3b8; }
.badge-pending { background: rgba(245,158,11,0.2); color: #f59e0b; }
.badge-in_progress { background: rgba(59,130,246,0.2); color: #3b82f6; }
.badge-paused { background: rgba(249,115,22,0.2); color: #f97316; }
.badge-done { background: rgba(16,185,129,0.2); color: #10b981; }
.badge-cancelled { background: rgba(239,68,68,0.2); color: #ef4444; }

/* Priority badges */
.badge-low { background: rgba(100,116,139,0.2); color: #94a3b8; }
.badge-medium { background: rgba(59,130,246,0.2); color: #3b82f6; }
.badge-high { background: rgba(249,115,22,0.2); color: #f97316; }
.badge-critical { background: rgba(239,68,68,0.2); color: #ef4444; }

/* ─── FILTERS BAR ─────────────────────────────────── */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  align-items: center;
}
.filters-bar select,
.filters-bar input {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
}
.filters-bar select:focus,
.filters-bar input:focus { border-color: var(--accent-blue); }
.filters-bar label { font-size: 12px; color: var(--text-secondary); }

/* ─── KANBAN ─────────────────────────────────────── */
#kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 200px);
  align-items: flex-start;
}
.kanban-col {
  min-width: 230px;
  max-width: 260px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.kanban-col-header {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  border-radius: var(--radius) var(--radius) 0 0;
}
.kanban-col-count {
  background: var(--bg-primary);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--text-secondary);
}
.kanban-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
  flex: 1;
}
.kanban-cards.drag-over { background: rgba(59,130,246,0.05); border-radius: 6px; }

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  cursor: grab;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.kanban-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: rotate(2deg);
}
.kanban-card-title { font-size: 13px; font-weight: 500; margin-bottom: 8px; line-height: 1.3; }
.kanban-card-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.kanban-card-project { font-size: 11px; color: var(--text-muted); }
.kanban-card-due { font-size: 10px; color: var(--text-muted); margin-top: 6px; }
.kanban-card-due.overdue { color: var(--accent-red); }

/* ─── MODAL ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  display: none;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.modal-lg { max-width: 900px; }
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ─── FORMS ─────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-control {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  width: 100%;
  font-family: inherit;
}
.form-control:focus { border-color: var(--accent-blue); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-control[readonly] { opacity: 0.7; }

/* ─── TAGS INPUT ─────────────────────────────────── */
.tags-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 38px;
  cursor: text;
  align-items: center;
}
.tags-input-wrap:focus-within { border-color: var(--accent-blue); }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(59,130,246,0.2);
  color: var(--accent-blue);
}
.tag-chip .remove { cursor: pointer; font-size: 13px; line-height: 1; }

/* ─── PROJECT CARDS ─────────────────────────────── */
.project-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.project-card:hover { border-color: var(--border-light); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.project-card-header { display: flex; align-items: center; gap: 10px; }
.project-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.project-card-name { font-size: 15px; font-weight: 600; }
.project-card-meta { font-size: 12px; color: var(--text-secondary); }
.project-card-stats { display: flex; gap: 16px; }
.project-stat { display: flex; flex-direction: column; gap: 2px; }
.project-stat-val { font-size: 20px; font-weight: 700; }
.project-stat-label { font-size: 11px; color: var(--text-muted); }

/* ─── NOTE CARDS ─────────────────────────────────── */
.note-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.note-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.note-card:hover { border-color: var(--border-light); }
.note-card-title { font-size: 14px; font-weight: 600; }
.note-card-category { font-size: 11px; color: var(--accent-cyan); font-weight: 600; }
.note-card-preview {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: pre-wrap;
}
.note-card-date { font-size: 11px; color: var(--text-muted); }

/* ─── REPORT ─────────────────────────────────────── */
.report-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.range-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.15s;
}
.range-btn.active { background: var(--accent-blue); border-color: var(--accent-blue); color: #fff; }
.range-btn:hover:not(.active) { border-color: var(--border-light); color: var(--text-primary); }

.report-output {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  color: var(--text-primary);
}

/* ─── CODE BLOCKS ─────────────────────────────────── */
pre, code {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
}
.note-content-rendered {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
}
.note-content-rendered pre {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
}
.note-content-rendered code { background: rgba(255,255,255,0.07); padding: 1px 5px; border-radius: 3px; }
.note-content-rendered pre code { background: none; padding: 0; }
.note-content-rendered h1,.note-content-rendered h2,.note-content-rendered h3 {
  margin: 12px 0 6px;
  color: var(--text-primary);
}
.note-content-rendered blockquote {
  border-left: 3px solid var(--accent-blue);
  padding-left: 12px;
  color: var(--text-secondary);
  margin: 8px 0;
}

/* ─── HISTORY ─────────────────────────────────────── */
.history-list { display: flex; flex-direction: column; gap: 0; }
.history-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.history-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; width: 140px; flex-shrink: 0; }
.history-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  margin-top: 5px;
  flex-shrink: 0;
}
.history-body { flex: 1; }
.history-field { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.history-change { font-size: 13px; color: var(--text-primary); }
.history-note { font-size: 12px; color: var(--text-muted); font-style: italic; }

/* ─── WORK LOG ─────────────────────────────────────── */
.duration-input { display: flex; gap: 6px; align-items: center; }
.duration-input input { width: 70px; }
.duration-label { font-size: 12px; color: var(--text-secondary); }

/* ─── EMPTY STATE ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ─── TOAST ─────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  animation: slide-in 0.2s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--accent-blue); }
@keyframes slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ─── INLINE STATUS SELECT ─────────────────────────── */
.status-select {
  background: none;
  border: none;
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 999px;
}

/* ─── ACTIONS ─────────────────────────────────────── */
.actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ─── CLIENT CARDS ─────────────────────────────────── */
.client-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.client-card:hover { border-color: var(--border-light); }
.client-card-name { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.client-card-contact { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.client-stats { display: flex; gap: 20px; }

/* ─── SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  #sidebar { width: 52px; }
  .sidebar-logo .logo-text, .sidebar-logo .logo-sub, .nav-item span, .nav-section { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-sub { padding-left: 0; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  #content { padding: 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ─── MISC ─────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.w-full { width: 100%; }
.cursor-pointer { cursor: pointer; }

.link-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  color: var(--accent-blue);
  font-size: 12px;
  text-decoration: none;
}
.link-item:hover { text-decoration: underline; }

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.workstream-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
}
.workstream-chip:hover { border-color: var(--border-light); }
.workstream-dot { width: 8px; height: 8px; border-radius: 50%; }

.ws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.ws-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ws-card:hover { border-color: var(--border-light); }
.ws-color-bar { width: 4px; height: 40px; border-radius: 2px; flex-shrink: 0; }
.ws-name { font-size: 14px; font-weight: 600; }
.ws-count { font-size: 12px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   TIMER WIDGET
   ═══════════════════════════════════════════════════════════════════════════ */
#timer-widget {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 12px;
}
.timer-info {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timer-time {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-cyan);
}
.timer-time.paused { color: var(--accent-orange); }
.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 4px;
}
.btn-success {
  background: var(--accent-green);
  color: #fff;
  border: none;
}
.btn-success:hover { filter: brightness(1.15); }
.btn-danger {
  background: var(--accent-red);
  color: #fff;
  border: none;
}
.btn-danger:hover { filter: brightness(1.15); }

/* ═══════════════════════════════════════════════════════════════════════════
   MY DAY / DAILY VIEW
   ═══════════════════════════════════════════════════════════════════════════ */
.stat-card.cyan { --stat-color: var(--accent-cyan); }
.stat-card.green { --stat-color: var(--accent-green); }
.stat-card.yellow { --stat-color: var(--accent-yellow); }
.stat-card.blue { --stat-color: var(--accent-blue); }
.stat-card.purple { --stat-color: var(--accent-purple); }

.priority-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.priority-item:last-child { border-bottom: none; }
.priority-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.priority-rank.rank-1 { background: var(--accent-red); }
.priority-rank.rank-2 { background: var(--accent-orange); }
.priority-rank.rank-3 { background: var(--accent-yellow); color: var(--bg-dark); }
.priority-task-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.priority-task-name.done { text-decoration: line-through; color: var(--text-muted); }
.priority-actions { display: flex; gap: 4px; }

.plan-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.plan-item:last-child { border-bottom: none; }
.plan-item-name {
  flex: 1;
  font-size: 14px;
  cursor: pointer;
}
.plan-item-name.done { text-decoration: line-through; color: var(--text-muted); }

.active-task-card {
  background: linear-gradient(135deg, rgba(6,182,212,0.08) 0%, rgba(59,130,246,0.06) 100%);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius);
  padding: 14px;
}
.active-task-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.active-task-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.active-task-timer {
  font-family: 'Courier New', monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 10px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-time {
  color: var(--text-muted);
  font-size: 12px;
  min-width: 40px;
  flex-shrink: 0;
}
.activity-desc { flex: 1; }

.overdue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--accent-red);
}
.overdue-item:last-child { border-bottom: none; }
.overdue-name { flex: 1; cursor: pointer; }
.due-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.due-item:last-child { border-bottom: none; }
.due-name { flex: 1; cursor: pointer; }
.empty-state-sm {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════════════════════════════════════════ */
.cal-month-grid { user-select: none; }
.cal-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.cal-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px;
  text-transform: uppercase;
}
.cal-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-cell {
  min-height: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px;
  cursor: pointer;
  transition: background 0.1s;
  overflow: hidden;
}
.cal-cell:hover { background: var(--bg-hover); }
.cal-cell.other-month { opacity: 0.4; }
.cal-cell.today { border-color: var(--accent-cyan); }
.cal-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 3px;
}
.cal-day-num.today-num {
  background: var(--accent-cyan);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-events-list { display: flex; flex-direction: column; gap: 2px; }
.cal-event {
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 3px;
  border-left: 3px solid var(--accent-blue);
  background: rgba(59,130,246,0.1);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}
.cal-event:hover { filter: brightness(1.2); }
.cal-event-task_due { border-left-color: var(--accent-red); background: rgba(239,68,68,0.1); }
.cal-event-task_scheduled { border-left-color: var(--accent-blue); background: rgba(59,130,246,0.1); }
.cal-event-work_log { border-left-color: var(--accent-green); background: rgba(16,185,129,0.1); }
.cal-event-daily_plan { border-left-color: var(--accent-purple); background: rgba(139,92,246,0.1); }
.cal-more { font-size: 10px; color: var(--text-muted); padding: 1px 3px; }

.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-week-col {
  min-height: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}
.cal-week-col.today { border-color: var(--accent-cyan); }
.cal-week-day-hdr {
  padding: 6px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
}
.cal-week-day-name { font-size: 11px; color: var(--text-muted); }
.cal-week-day-num { font-size: 16px; font-weight: 700; }
.cal-week-events { padding: 4px; display: flex; flex-direction: column; gap: 2px; }

.cal-agenda { display: flex; flex-direction: column; gap: 12px; }
.agenda-date-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: capitalize;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.agenda-event {
  padding: 8px 10px;
  border-radius: 4px;
  border-left: 3px solid var(--accent-blue);
  background: var(--bg-card);
  margin-bottom: 4px;
  cursor: pointer;
}
.agenda-event:hover { filter: brightness(1.1); }
.agenda-event-title { font-size: 13px; font-weight: 500; }
.agenda-event-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.cal-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 11px;
}
.cal-legend::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.cal-legend-task_due::before { background: var(--accent-red); }
.cal-legend-task_scheduled::before { background: var(--accent-blue); }
.cal-legend-work_log::before { background: var(--accent-green); }
.cal-legend-daily_plan::before { background: var(--accent-purple); }
.cal-view-btn.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }

/* ═══════════════════════════════════════════════════════════════════════════
   WORK LOG STATISTICS
   ═══════════════════════════════════════════════════════════════════════════ */
.bar-chart { display: flex; flex-direction: column; gap: 6px; }
.bar-item {
  display: grid;
  grid-template-columns: 60px 1fr 50px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.bar-label { color: var(--text-muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-wrap { background: var(--bg-hover); border-radius: 3px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.bar-value { color: var(--text-secondary); font-weight: 500; }

.pie-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.pie-list-item:last-child { border-bottom: none; }
.pie-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pie-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie-pct { color: var(--text-muted); font-size: 12px; min-width: 35px; text-align: right; }
.pie-time { font-weight: 600; min-width: 50px; text-align: right; }

.wls-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.wls-task-row:last-child { border-bottom: none; }
.wls-task-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wls-task-time { font-weight: 600; color: var(--accent-cyan); margin-left: 8px; }
.wls-period-btn.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }

/* ═══════════════════════════════════════════════════════════════════════════
   REMINDER TOASTS
   ═══════════════════════════════════════════════════════════════════════════ */
.toast.reminder {
  background: var(--accent-purple);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  max-width: 320px;
  font-size: 13px;
  line-height: 1.4;
}


/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 3 CSS — Knowledge base, Automations, Project dashboard, Reports
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Knowledge base layout ─────────────────────────────────────────────────── */
.kb-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  height: calc(100vh - 140px);
  min-height: 0;
}
.kb-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  padding: 8px;
}
.kb-cat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.12s;
}
.kb-cat-item:hover { background: var(--bg-hover); }
.kb-cat-item.active { background: var(--accent-blue); color: #fff; }
.kb-cat-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-hover);
  border-radius: 10px;
  padding: 0 6px;
}
.kb-cat-item.active .kb-cat-count { background: rgba(255,255,255,0.2); color: #fff; }

.kb-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.kb-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.kb-doc-list, .kb-cmd-list {
  overflow-y: auto;
  flex: 1;
}

/* ─── Doc items ──────────────────────────────────────────────────────────────── */
.kb-doc-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.kb-doc-item:hover { border-color: var(--border-light); }
.kb-doc-icon { font-size: 20px; flex-shrink: 0; }
.kb-doc-info { flex: 1; min-width: 0; }
.kb-doc-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.kb-doc-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kb-doc-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ─── Command items ──────────────────────────────────────────────────────────── */
.kb-cmd-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.kb-cmd-item:hover { border-color: var(--border-light); }
.kb-cmd-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.kb-cmd-title { font-size: 14px; font-weight: 600; margin-right: 8px; }
.kb-cmd-desc { font-size: 13px; color: var(--text-muted); }
.badge-tech { background: rgba(139,92,246,0.15); color: var(--accent-purple); border: 1px solid rgba(139,92,246,0.3); }
.badge-tag { background: rgba(100,116,139,0.15); color: var(--text-secondary); font-size: 11px; }

/* ─── Doc editor modal ──────────────────────────────────────────────────────── */
.doc-editor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  height: 480px;
}
.doc-editor-pane, .doc-preview-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.doc-editor-pane label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.doc-editor-pane textarea { flex: 1; resize: none; font-family: 'Courier New', monospace; font-size: 13px; }
.doc-preview-pane {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  overflow-y: auto;
}
.report-preview-body h1 { font-size: 20px; border-bottom: 2px solid var(--border); padding-bottom: 8px; margin: 16px 0 8px; }
.report-preview-body h2 { font-size: 16px; color: var(--text-secondary); margin: 14px 0 6px; }
.report-preview-body h3 { font-size: 14px; margin: 12px 0 4px; }
.report-preview-body code.inline-code { background: var(--bg-card); padding: 2px 5px; border-radius: 3px; font-family: monospace; font-size: 12px; }
.report-preview-body table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.report-preview-body td, .report-preview-body tr { border: 1px solid var(--border); padding: 6px 8px; font-size: 13px; }
.report-preview-body ul { padding-left: 20px; }
.report-preview-body li { margin: 2px 0; font-size: 13px; }

/* ─── Advanced reports layout ──────────────────────────────────────────────── */
.reports-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  height: calc(100vh - 140px);
  min-height: 0;
}
.reports-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.reports-list-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}
.report-list-item {
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 4px;
  transition: background 0.12s;
  border: 1px solid transparent;
}
.report-list-item:hover { background: var(--bg-hover); }
.report-list-item.active { background: rgba(59,130,246,0.1); border-color: var(--accent-blue); }
.report-item-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.report-item-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.reports-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.report-editor-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}
.report-editor-body textarea {
  width: 100%;
  height: 100%;
  resize: none;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

/* ─── Automation cards ──────────────────────────────────────────────────────── */
.automation-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.automation-card.active { border-left: 3px solid var(--accent-green); }
.automation-card.inactive { border-left: 3px solid var(--border); opacity: 0.8; }
.automation-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.automation-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.automation-trigger { font-size: 12px; color: var(--text-muted); }
.automation-actions { display: flex; gap: 6px; align-items: center; }
.automation-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.automation-meta { display: flex; gap: 12px; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  border-radius: 20px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent-green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ─── Project dashboard modal ────────────────────────────────────────────────── */
.project-dashboard-modal .modal { max-width: 900px; width: 95vw; }
.pdash-stats-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.pdash-stat {
  background: var(--bg-hover);
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
}
.pdash-stat-value { font-size: 20px; font-weight: 700; color: var(--accent-cyan); }
.pdash-stat-label { font-size: 11px; color: var(--text-muted); }
.pdash-progress-track {
  background: var(--bg-hover);
  border-radius: 4px;
  height: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}
.pdash-progress-fill { height: 100%; background: var(--accent-green); border-radius: 4px; transition: width 0.5s; }

/* ─── Milestone timeline ─────────────────────────────────────────────────────── */
.milestone-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.milestone-item:last-child { border-bottom: none; }
.milestone-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  margin-top: 4px;
}
.milestone-item.done .milestone-dot { background: var(--accent-green); }
.milestone-item.in_progress .milestone-dot { background: var(--accent-blue); }
.milestone-item.cancelled .milestone-dot { background: var(--accent-red); }
.milestone-content { flex: 1; }
.milestone-name { font-size: 14px; font-weight: 600; }
.milestone-meta { font-size: 12px; color: var(--text-muted); margin: 2px 0 6px; }
.milestone-progress-bar { background: var(--bg-hover); border-radius: 2px; height: 4px; overflow: hidden; }
.milestone-progress-fill { height: 100%; background: var(--accent-cyan); }

/* ─── Project extended fields ─────────────────────────────────────────────────── */
.project-detail-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.project-detail-tab {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  color: var(--text-muted);
}
.project-detail-tab:hover { color: var(--text-primary); }
.project-detail-tab.active { border-bottom-color: var(--accent-blue); color: var(--accent-blue); font-weight: 600; }

/* ─── Client dashboard ────────────────────────────────────────────────────────── */
.client-dashboard-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

