/* ═══════════════════════════════════════════════════════════════
   MOMENTUM — Design System
   Font: DM Sans (Google Fonts)
   Theme: Clean light with deep navy accents
═══════════════════════════════════════════════════════════════ */

:root {
  --bg:          #f4f5f7;
  --surface:     #ffffff;
  --border:      #e4e7ec;
  --border-soft: rgba(0,0,0,.06);

  --text-primary:   #111827;
  --text-secondary: #4b5563;
  --text-muted:     #9ca3af;

  --accent:      #4f46e5;
  --accent-soft: rgba(79,70,229,.10);
  --accent-2:    #0ea5e9;

  --good:        #10b981;
  --good-soft:   rgba(16,185,129,.12);
  --warn:        #f59e0b;
  --warn-soft:   rgba(245,158,11,.12);
  --danger:      #ef4444;
  --danger-soft: rgba(239,68,68,.12);

  --sidebar-w:   220px;
  --topheader-h: 58px;
  --titlebar-h:  48px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 28px rgba(0,0,0,.09), 0 4px 8px rgba(0,0,0,.05);

  --font: 'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════
   LAYOUT SHELL
═══════════════════════════════════ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #1e1b4b;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.main-area {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════
   SIDEBAR
═══════════════════════════════════ */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.brand-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -.02em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.6);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background .14s, color .14s;
  position: relative;
}
.nav-btn:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
}
.nav-btn.active {
  background: rgba(79,70,229,.35);
  color: #ffffff;
}
.nav-btn.admin-locked-tab { opacity: .45; }
.nav-icon {
  width: 17px; height: 17px;
  flex-shrink: 0;
  stroke-width: 1.7;
}
.nav-label { flex: 1; }

/* Sidebar footer — current user */
.sidebar-footer {
  flex-shrink: 0;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.current-user-block {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cu-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.cu-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.cu-role {
  font-size: 11px;
  color: rgba(255,255,255,.5);
}

/* ═══════════════════════════════════
   TOP HEADER
═══════════════════════════════════ */
.topheader {
  position: sticky; top: 0; z-index: 50;
  height: var(--topheader-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  /* Never wrap on desktop — single line always */
  flex-wrap: nowrap;
  overflow: hidden;
  min-width: 0;
}
.topheader-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.topheader-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.header-project-row {
  display: flex;
  align-items: center;
  gap: 6px;
  /* Never wrap — buttons stay on same line as project select */
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}
.project-indicator {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,.18);
}
.project-select-input {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  /* Shrinks gracefully instead of wrapping */
  min-width: 120px;
  max-width: 260px;
  width: 200px;
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.project-select-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.search-input {
  font-family: var(--font);
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  /* Fixed width — doesn't grow/shrink awkwardly */
  width: 220px;
  flex-shrink: 0;
}
.search-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--surface); }
.search-input::placeholder { color: var(--text-muted); }

.user-selector-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.user-select {
  font-family: var(--font);
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  min-width: 130px;
  max-width: 180px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════
   PAGE TITLE BAR
═══════════════════════════════════ */
.page-titlebar {
  height: var(--titlebar-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
}
.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 10px;
}

/* ═══════════════════════════════════
   PAGE CONTENT
═══════════════════════════════════ */
.page-content {
  flex: 1;
  padding: 20px;
  overflow-x: hidden;
}
/* Ultrawide cap — content never stretches too far on 2k/4k monitors */
@media (min-width: 1600px) {
  .topheader { padding: 0 28px; }
  .page-content { padding: 24px 28px; }
  .project-select-input { max-width: 320px; width: 260px; }
  .search-input { width: 280px; }
}
@media (min-width: 2000px) {
  .topheader { padding: 0 36px; }
  .page-content { padding: 28px 36px; }
}
.view { display: block; }
.view.hidden { display: none; }

/* ═══════════════════════════════════
   BUTTONS & CONTROLS
═══════════════════════════════════ */
.hdr-btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
  white-space: nowrap;
}
.hdr-btn:hover {
  background: var(--bg);
  border-color: #c0c7d4;
  box-shadow: var(--shadow-sm);
}
.hdr-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.hdr-btn.primary:hover { background: #4338ca; border-color: #4338ca; }
.hdr-btn.danger { color: var(--danger); border-color: rgba(239,68,68,.3); }
.hdr-btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.hdr-btn.hidden { display: none; }

.ctrl-select, .ctrl-input {
  font-family: var(--font);
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
}
.ctrl-select:focus, .ctrl-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.ctrl-input::placeholder { color: var(--text-muted); }
.w-full { width: 100%; }

.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.notice-pill {
  font-size: 12px;
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: 999px;
  padding: 4px 12px;
}
.notice-pill code { font-family: var(--mono); font-size: 11px; }

/* ═══════════════════════════════════
   TOOLBAR
═══════════════════════════════════ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.pill {
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
}
.toggle-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ═══════════════════════════════════
   KPI / METRIC CARDS
═══════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.kpi-value.sm { font-size: 18px; }
.kpi-value.good { color: var(--good); }
.kpi-value.warn { color: var(--warn); }
.kpi-value.danger { color: var(--danger); }

/* ═══════════════════════════════════
   CARDS
═══════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.card-h {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -.01em;
}
.card-k {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.card-v {
  font-size: 26px;
  font-weight: 700;
  margin-top: 2px;
}

.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}
.chart-box {
  position: relative;
  width: 100%;
  height: 260px;
  min-height: 220px;
}

/* ═══════════════════════════════════
   GRIDS
═══════════════════════════════════ */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.grid5 { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }
.overall-notes-grid { margin-top: 14px; }

.notes-textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 10px;
  resize: vertical;
}
.notes-textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.notes-textarea::placeholder { color: var(--text-muted); }

/* ═══════════════════════════════════
   TABLE
═══════════════════════════════════ */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  resize: vertical;
  min-height: 220px;
  max-height: 78vh;
  background: var(--surface);
  /* Always-visible scrollbars so users know content scrolls horizontally */
  scrollbar-width: thin;
  scrollbar-color: #c7d2fe #f4f5f7;
}
.table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.table-wrap::-webkit-scrollbar-track { background: var(--bg); border-radius: 4px; }
.table-wrap::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 4px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: #818cf8; }
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1550px;
  table-layout: fixed;
}
.table th, .table td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 13px;
}
.table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 2;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.table td { color: var(--text-primary); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(79,70,229,.03); }

.table col.col-item    { width: 280px; }
.table col.col-phase   { width: 160px; }
.table col.col-client  { width: 160px; }
.table col.col-owner   { width: 150px; }
.table col.col-status  { width: 140px; }
.table col.col-priority{ width: 120px; }
.table col.col-percent { width: 72px; }
.table col.col-start   { width: 150px; }
.table col.col-due     { width: 150px; }
.table col.col-evidence{ width: 250px; }
.table col.col-notes   { width: 280px; }
.table col.col-verified{ width: 220px; }
.table col.col-actions { width: 70px; }

.cell {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  min-height: 38px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: border-color .12s, background .12s;
}
.cell[contenteditable="true"]:hover { border-color: var(--border); }
.cell[contenteditable="true"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--accent-soft);
}
.notes-cell { min-height: 72px; }

.input-date {
  width: 100%;
  min-width: 130px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--font);
  font-size: 13px;
}
.input-date:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.hint { font-size: 11px; opacity: .5; font-weight: 400; }

/* Column resizer */
.col-resizer {
  position: absolute; top: 0; right: -4px;
  width: 8px; height: 100%;
  cursor: col-resize; user-select: none; z-index: 6;
}
.col-resizer::after {
  content: ""; position: absolute;
  top: 10px; bottom: 10px; left: 3px;
  width: 2px;
  background: rgba(79,70,229,.25);
  border-radius: 2px;
}

/* ═══════════════════════════════════
   STATUS / PRIORITY TAGS
═══════════════════════════════════ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
}
.tag.good    { background: var(--good-soft);   color: #065f46; border-color: rgba(16,185,129,.3); }
.tag.warn    { background: var(--warn-soft);   color: #78350f; border-color: rgba(245,158,11,.3); }
.tag.bad     { background: var(--danger-soft); color: #7f1d1d; border-color: rgba(239,68,68,.3); }
.tag.info    { background: var(--accent-soft); color: #312e81; border-color: rgba(79,70,229,.3); }
.verified-tag { background: rgba(16,185,129,.12); color: #065f46; border-color: rgba(16,185,129,.3); }
.awaiting-tag { background: rgba(245,158,11,.12); color: #78350f; border-color: rgba(245,158,11,.3); }

/* ═══════════════════════════════════
   SCORE PILLS
═══════════════════════════════════ */
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
}
.score-green  { background: var(--good-soft);   color: #065f46; border-color: rgba(16,185,129,.3); }
.score-yellow { background: var(--warn-soft);   color: #78350f; border-color: rgba(245,158,11,.3); }
.score-red    { background: var(--danger-soft); color: #7f1d1d; border-color: rgba(239,68,68,.3); }

/* ═══════════════════════════════════
   PIE CHARTS (SVG)
═══════════════════════════════════ */
.status-pie {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.10));
  transition: transform .2s ease;
  cursor: pointer;
}
.status-pie:hover { transform: scale(1.03); }
.status-pie-svg { width: 100%; height: 100%; overflow: visible; }
/* Pie center text */
.status-pie-svg .pie-center-top {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  fill: #111827;
}
.status-pie-svg .pie-center-bottom {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 600;
  fill: #9ca3af;
  letter-spacing: .06em;
}
/* Slice hover */
.status-pie-svg path,
.status-pie-svg circle[data-status-slice],
.status-pie-svg path[data-project-slice],
.status-pie-svg circle[data-project-slice] {
  cursor: pointer;
  transition: opacity .15s ease, filter .15s ease;
}
.status-pie-svg path:hover,
.status-pie-svg circle[data-status-slice]:hover,
.status-pie-svg path[data-project-slice]:hover,
.status-pie-svg circle[data-project-slice]:hover {
  opacity: .85;
  filter: brightness(1.08);
}
.pie-layout {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 130px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  text-align: left;
}
.legend-item:hover { background: var(--bg); }
.legend-item strong { margin-left: auto; color: var(--text-primary); font-weight: 700; }
.legend-swatch {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.sw-done        { background: var(--good); }
.sw-progress    { background: var(--accent); }
.sw-notstarted  { background: var(--border); }

/* ═══════════════════════════════════
   PHASE LIST
═══════════════════════════════════ */
.phase-list { display: flex; flex-direction: column; gap: 10px; }
.phase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width .4s ease;
}

/* ═══════════════════════════════════
   KANBAN BOARD
═══════════════════════════════════ */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: 12px;
  overflow: auto;
  padding-bottom: 16px;
  max-height: calc(100vh - 240px);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c7d2fe #f4f5f7;
}
.kanban::-webkit-scrollbar { height: 8px; width: 8px; }
.kanban::-webkit-scrollbar-track { background: var(--bg); border-radius: 4px; }
.kanban::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 4px; }
.kanban::-webkit-scrollbar-thumb:hover { background: #818cf8; }
.column {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.col-head {
  padding: 12px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.badge {
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--bg);
}
.col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 340px);
  flex: 1;
}
.col-body::-webkit-scrollbar { width: 4px; }
.col-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.card-task {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}
.card-task[draggable="true"] { cursor: grab; }
.card-task[draggable="true"]:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card-task:active { cursor: grabbing; }
.t-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 7px;
}
.t-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}

/* Task card avatar */
.task-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  border: 1.5px solid var(--surface);
}
.task-avatar-group {
  display: flex;
  align-items: center;
}
.task-avatar-group .task-avatar + .task-avatar { margin-left: -6px; }

/* ═══════════════════════════════════
   GANTT
═══════════════════════════════════ */
.gantt-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  max-height: 70vh;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c7d2fe #f4f5f7;
}
.gantt-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.gantt-wrap::-webkit-scrollbar-track { background: var(--bg); border-radius: 4px; }
.gantt-wrap::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 4px; }
.gantt-wrap::-webkit-scrollbar-thumb:hover { background: #818cf8; }
.gantt { min-width: 1180px; }
.gantt-head {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.gantt-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.gantt-row:last-child { border-bottom: none; }
.gantt-label {
  width: 280px;
  min-width: 280px;
  padding: 10px 14px;
  border-right: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
}
.gantt-label .small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 11px; }
.gantt-timeline { position: relative; flex: 1; min-height: 48px; }
.gantt-grid { position: absolute; inset: 0; display: grid; }
.gantt-grid > div { border-right: 1px dashed rgba(79,70,229,.08); }
.gantt-grid > div:last-child { border-right: none; }
.gantt-col-label {
  padding: 10px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1px dashed rgba(79,70,229,.08);
  letter-spacing: .02em;
}
.gantt-head .gantt-timeline { min-height: 78px; }
.gantt-grid-primary { height: 38px; }
.gantt-day-header {
  position: absolute;
  left: 0; right: 0; top: 38px;
  height: 40px;
  display: grid;
  background: var(--bg);
  border-top: 1px solid rgba(79,70,229,.06);
}
.gantt-day-label {
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1px dashed rgba(79,70,229,.08);
  white-space: nowrap;
}
.gantt-day-grid {
  position: absolute; inset: 0;
  display: grid;
  pointer-events: none;
}
.gantt-day-grid > div { border-right: 1px solid rgba(79,70,229,.05); }
.gantt-day-grid > div:last-child { border-right: none; }
.gantt-bar {
  position: absolute;
  height: 20px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  padding: 0 8px;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .12s, transform .12s;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.gantt-bar:hover { filter: brightness(1.1); transform: scaleY(1.08); }
.gantt-today {
  position: absolute; top: 0; bottom: 0;
  width: 2px;
  background: var(--danger);
  opacity: .7;
  pointer-events: none;
  z-index: 4;
}
.gantt-today-label {
  position: absolute; top: 3px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
}
.gantt-details {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
}

/* ═══════════════════════════════════
   PEOPLE / TEAM
═══════════════════════════════════ */
.people-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 14px;
  align-items: start;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.people-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Person card with avatar */
.person {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}
.person:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.person-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: .01em;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.person-info { flex: 1; }
.person-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.person-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.person-email {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-top: 1px;
}
.person-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.person-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.assign-select, .person-role-select {
  font-family: var(--font);
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

/* ═══════════════════════════════════
   TIME TRACKER
═══════════════════════════════════ */
.timer-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.timer-panel-left { flex: 1; }
.timer-display {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .04em;
  flex-shrink: 0;
}
.timer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════
   VERIFICATION
═══════════════════════════════════ */
.verify-btn {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid;
  cursor: pointer;
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
}
.verify-btn.verified {
  background: var(--good-soft);
  color: #065f46;
  border-color: rgba(16,185,129,.3);
}
.verify-btn.awaiting {
  background: var(--warn-soft);
  color: #78350f;
  border-color: rgba(245,158,11,.3);
}
.verify-btn:disabled { opacity: .5; cursor: not-allowed; }
.verify-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.verify-badge.awaiting {
  background: var(--warn-soft);
  color: #78350f;
}
.verification-cell-inner .small {
  white-space: normal;
  color: var(--text-muted);
}

/* ═══════════════════════════════════
   ADMIN MODAL
═══════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  min-width: 340px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.5;
}
.modal-input {
  width: 100%;
  font-family: var(--mono);
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--bg);
  color: var(--text-primary);
  letter-spacing: .08em;
  margin-bottom: 14px;
}
.modal-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.modal-error {
  font-size: 12px;
  color: var(--danger);
  margin-bottom: 10px;
  display: none;
}
.modal-error.show { display: block; }

/* ═══════════════════════════════════
   FOOTER
═══════════════════════════════════ */
.app-footer {
  margin-left: var(--sidebar-w);
  border-top: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
}
.sync-status {
  font-size: 11px;
  color: var(--good);
}
.sync-status.syncing { color: var(--warn); }
.sync-status.error { color: var(--danger); }

/* ═══════════════════════════════════
   MISC
═══════════════════════════════════ */
.muted { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.small { font-size: 12px; color: var(--text-muted); }
.hidden { display: none !important; }

/* select inside table */
.table select {
  font-family: var(--font);
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  width: 100%;
}
.table select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ═══════════════════════════════════
   PDF EXPORT CLEAN STATE
═══════════════════════════════════ */
.export-clean,
.export-clean * {
  animation: none !important;
  transition: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  text-shadow: none !important;
}
.export-clean .card,
.export-clean .column,
.export-clean .table-wrap,
.export-clean .gantt-wrap,
.export-clean .person,
.export-clean .card-task {
  box-shadow: none !important;
  transform: none !important;
}

/* ═══════════════════════════════════
   RESPONSIVE
═══════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET LANDSCAPE (≤1100px)
   Sidebar collapses to 64px icon-only strip
═══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  :root { --sidebar-w: 64px; }
  .brand-name, .nav-label, .cu-name, .cu-role, .cu-info { display: none; }
  .sidebar-brand { justify-content: center; padding: 14px; }
  .nav-btn { justify-content: center; padding: 10px; }
  .sidebar-footer { padding: 10px; }
  .current-user-block { justify-content: center; }
  /* Topheader stays single-line — just tighten spacing and shrink inputs */
  .topheader { flex-wrap: nowrap; height: var(--topheader-h); padding: 0 12px; gap: 8px; }
  .search-input { width: 150px; }
  .project-select-input { width: 150px; min-width: 100px; }
  .user-select { min-width: 110px; max-width: 150px; }
  /* Hide rename/delete to save header space */
  #renameProjectBtn, #deleteProjectBtn { display: none; }
  .kanban { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
  .people-layout { grid-template-columns: 1fr; }
  .budget-project-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  /* Hide mobile-only elements */
  .mob-hamburger, .mob-bottom-nav, .mob-drawer, .mob-drawer-overlay { display: none !important; }
}
/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET PORTRAIT (≤768px)
   Sidebar hidden, hamburger drawer + bottom tab bar
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; --topheader-h: auto; }

  /* Layout shell */
  .sidebar { display: none !important; }
  .app-footer { margin-left: 0; padding: 8px 14px; }
  .main-area { margin-left: 0; padding-bottom: 70px; }

  /* ── Hamburger ── */
  .mob-hamburger {
    display: flex !important;
    position: fixed; top: 10px; left: 10px; z-index: 400;
    width: 40px; height: 40px; border-radius: 10px;
    background: #1e1b4b; border: none; color: #fff;
    align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.25);
    -webkit-tap-highlight-color: transparent;
  }

  /* ── Drawer overlay ── */
  .mob-drawer-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 299;
    backdrop-filter: blur(2px);
  }
  .mob-drawer-overlay.open { display: block; }

  /* ── Slide-in drawer ── */
  .mob-drawer {
    display: flex !important; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(300px, 85vw); background: #1e1b4b;
    z-index: 300; transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .mob-drawer.open { transform: translateX(0); }

  .mob-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.1); flex-shrink: 0;
  }
  .mob-drawer-brand { display: flex; align-items: center; gap: 10px; }
  .mob-drawer-close {
    background: none; border: none; color: rgba(255,255,255,.6);
    font-size: 20px; cursor: pointer; padding: 6px 10px; border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-drawer-close:hover, .mob-drawer-close:active { background: rgba(255,255,255,.12); color: #fff; }

  .mob-drawer-nav {
    flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
  }
  .mob-drawer-btn {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 12px 14px; background: transparent; border: none;
    color: rgba(255,255,255,.7); font-family: var(--font); font-size: 15px; font-weight: 500;
    border-radius: var(--radius-sm); cursor: pointer; text-align: left;
    transition: background .12s, color .12s;
    -webkit-tap-highlight-color: transparent; min-height: 44px;
  }
  .mob-drawer-btn:hover, .mob-drawer-btn:active { background: rgba(255,255,255,.1); color: #fff; }
  .mob-drawer-btn.active { background: rgba(79,70,229,.4); color: #fff; }
  .mob-drawer-btn .nav-icon { width: 20px; height: 20px; flex-shrink: 0; }

  .mob-drawer-user {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.1); flex-shrink: 0;
  }

  /* ── Bottom tab bar ── */
  .mob-bottom-nav {
    display: flex !important; position: fixed;
    bottom: 0; left: 0; right: 0; height: 64px;
    background: var(--surface); border-top: 1px solid var(--border);
    z-index: 200; box-shadow: 0 -4px 20px rgba(0,0,0,.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mob-tab {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 8px 4px 6px; font-family: var(--font);
    transition: color .12s; -webkit-tap-highlight-color: transparent; min-width: 44px;
  }
  .mob-tab.active { color: var(--accent); }
  .mob-tab-icon { width: 24px; height: 24px; }
  .mob-tab-label { font-size: 10px; font-weight: 600; letter-spacing: .02em; }

  /* ── Top header — intentional 2-row layout ──
     Row 1 (topheader-left):  [project select] [+ New]
     Row 2 (topheader-right): [search          ] [user]
  ── */
  .topheader {
    padding: 8px 12px 8px 60px;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    height: auto;
    overflow: visible;
  }
  .topheader-left {
    display: flex; align-items: center;
    gap: 8px; flex-wrap: nowrap; width: 100%; min-width: 0;
  }
  .topheader-right {
    display: flex; align-items: center;
    gap: 8px; flex-wrap: nowrap; width: 100%; min-width: 0;
  }
  .header-project-row {
    display: flex; align-items: center;
    gap: 6px; flex: 1; min-width: 0; overflow: hidden; flex-wrap: nowrap;
  }
  #renameProjectBtn, #deleteProjectBtn { display: none; }
  .project-select-input { flex: 1; min-width: 0; max-width: none; width: auto; font-size: 13px; }
  .search-input { flex: 1; min-width: 0; width: auto; max-width: none; }
  .user-selector-wrap { flex-shrink: 0; }
  .user-select { min-width: 110px; max-width: 170px; font-size: 12px; }
  .hdr-btn { font-size: 12px; padding: 7px 11px; white-space: nowrap; flex-shrink: 0; }

  /* ── Page ── */
  .page-titlebar { padding: 0 12px; }
  .page-title { font-size: 15px; }
  .page-content { padding: 12px; }

  /* ── Grids ── */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid3, .grid4, .grid5 { grid-template-columns: 1fr; gap: 10px; }
  .charts-row { grid-template-columns: 1fr; gap: 12px; }
  .budget-project-grid { grid-template-columns: 1fr; }
  .people-layout { grid-template-columns: 1fr; }
  .overall-notes-grid { grid-template-columns: 1fr; }

  /* ── Cards ── */
  .card { padding: 12px 14px; }
  .kpi-card { padding: 12px 14px; }
  .kpi-value { font-size: 22px; }

  /* ── Kanban: 2 columns, horizontal scroll ── */
  .kanban {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    max-height: calc(100vh - 220px); gap: 10px;
  }

  /* ── Table / Gantt ── */
  .table-wrap { max-height: 58vh; }
  .gantt-wrap { max-height: 52vh; }
  .gantt-label { width: 200px; min-width: 200px; }

  /* ── Pie ── */
  .pie-layout { flex-direction: column; align-items: flex-start; gap: 12px; }
  .status-pie { width: 120px; height: 120px; }

  /* ── Misc ── */
  .phase-row { flex-wrap: wrap; gap: 8px; }
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .toolbar-right { flex-wrap: wrap; gap: 6px; }
  .timer-panel { flex-direction: column; gap: 10px; }
  .timer-display { font-size: 24px; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .person { flex-wrap: wrap; gap: 10px; }
  .person-actions { width: 100%; justify-content: flex-end; }
  .analytics-note { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — PHONE (≤480px)
═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  /* ── Header ── */
  .topheader { padding: 8px 10px 8px 58px; gap: 7px; }
  .topheader-left { gap: 6px; }
  .header-project-row { gap: 5px; }
  .project-select-input { font-size: 12px; }
  #newProjectBtn { font-size: 11px; padding: 6px 8px; }
  .topheader-right { gap: 6px; }
  .search-input { font-size: 12px; padding: 6px 10px; }
  .user-select { font-size: 11px; padding: 5px 7px; min-width: 90px; max-width: 130px; }
  .field-label { display: none; }

  /* ── Page ── */
  .page-content { padding: 10px; }
  .page-titlebar { padding: 0 10px; }
  .page-title { font-size: 14px; }

  /* ── Grids: single column ── */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .grid3, .grid4, .grid5, .charts-row { grid-template-columns: 1fr; }
  .overall-notes-grid { grid-template-columns: 1fr; }
  .budget-project-grid { grid-template-columns: 1fr; }
  .people-layout { grid-template-columns: 1fr; }

  /* ── KPI ── */
  .kpi-value { font-size: 20px; }
  .kpi-label { font-size: 10px; }
  .kpi-card { padding: 10px 12px; }

  /* ── Kanban: single-column swipe ── */
  .kanban { grid-template-columns: minmax(260px, 88vw); max-height: calc(100vh - 200px); gap: 10px; }

  /* ── Table / Gantt ── */
  .table-wrap { max-height: 55vh; }
  .gantt-wrap { max-height: 50vh; }
  .gantt-label { width: 160px; min-width: 160px; font-size: 11px; }

  /* ── Toolbar ── */
  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .toolbar-right { flex-wrap: wrap; gap: 6px; }
  .pill { font-size: 11px; }

  /* ── Forms ── */
  .row { flex-direction: column; align-items: stretch; gap: 8px; }
  .row .ctrl-input, .row .hdr-btn { width: 100%; }
  .hdr-btn { font-size: 12px; padding: 8px 12px; min-height: 40px; }

  /* ── Time tracking ── */
  .timer-panel { flex-direction: column; gap: 10px; }
  .timer-display { font-size: 20px; }
  .timer-actions { flex-wrap: wrap; gap: 6px; }
  .grid4 { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* ── People ── */
  .person { flex-wrap: wrap; gap: 10px; }
  .person-avatar { width: 38px; height: 38px; font-size: 14px; }
  .person-actions { width: 100%; justify-content: flex-end; }

  /* ── Budget ── */
  .budget-proj-fields { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .budget-field-input { font-size: 11px; padding: 4px 5px; }

  /* ── Pie ── */
  .status-pie { width: 110px; height: 110px; }
  .pie-layout { gap: 10px; }

  /* ── Phase ── */
  .phase-row { flex-direction: column; gap: 6px; align-items: flex-start; }
  .phase-row .progress { min-width: 100%; }

  /* ── Footer ── */
  .app-footer { flex-direction: column; gap: 3px; font-size: 10px; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════
   SAFE DEFAULT — hide mobile elements on desktop
═══════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .mob-hamburger { display: none !important; }
  .mob-bottom-nav { display: none !important; }
  .mob-drawer { display: none !important; }
  .mob-drawer-overlay { display: none !important; }
}


/* ═══════════════════════════════════
   BUDGET PAGE
═══════════════════════════════════ */
.budget-kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.budget-util-bar-wrap {
  height: 5px;
  background: var(--bg);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}
.budget-util-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--good), var(--accent-2));
  transition: width .5s ease;
}

/* Project budget card grid */
.budget-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.budget-proj-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--bg);
  transition: box-shadow .15s, transform .15s;
}
.budget-proj-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.budget-proj-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.budget-proj-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.budget-proj-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}
.budget-proj-status {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.budget-proj-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.budget-field-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 3px;
}
.budget-field-input {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 7px;
  background: var(--surface);
  width: 100%;
  transition: border-color .12s;
}
.budget-field-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--accent-soft);
}
.budget-proj-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.budget-proj-bar {
  height: 100%;
  border-radius: 999px;
  transition: width .4s ease;
}
.budget-proj-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}
.budget-net-positive { color: var(--good); font-weight: 700; }
.budget-net-negative { color: var(--danger); font-weight: 700; }

/* Analytics note below chart title */
.analytics-note {
  font-size: 11px;
  color: var(--text-muted);
  margin: -6px 0 10px;
  font-style: italic;
}
