/* ═══════════════════════════════════════════════════════════════
   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;
}

/* ═══════════════════════════════════════════════════
   CRM — CLIENT PIPELINE
═══════════════════════════════════════════════════ */
.crm-pipeline {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: flex-start;
}
.crm-column {
  flex: 0 0 240px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 200px;
}
.crm-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.crm-col-count {
  background: var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.crm-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
/* Pipeline stage colours */
.crm-column[data-stage="Lead"]     .crm-col-header { color:#8b5cf6; border-bottom-color:#8b5cf633; }
.crm-column[data-stage="Proposal"] .crm-col-header { color:#0ea5e9; border-bottom-color:#0ea5e933; }
.crm-column[data-stage="Active"]   .crm-col-header { color:#10b981; border-bottom-color:#10b98133; }
.crm-column[data-stage="On Hold"]  .crm-col-header { color:#f59e0b; border-bottom-color:#f59e0b33; }
.crm-column[data-stage="Closed"]   .crm-col-header { color:#94a3b8; border-bottom-color:#94a3b833; }

/* Client card */
.crm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.crm-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(79,70,229,.1);
}
.crm-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.crm-card-contact {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.crm-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.crm-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.crm-tag.projects { color:#4f46e5; background:#4f46e511; border-color:#4f46e522; }
.crm-tag.budget   { color:#10b981; background:#10b98111; border-color:#10b98122; }

/* Modal */
.crm-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.crm-modal-overlay.hidden { display: none; }
.crm-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.crm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.crm-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.crm-modal-close {
  background: none; border: none;
  font-size: 18px; color: var(--text-muted);
  cursor: pointer; padding: 4px 8px;
  border-radius: 6px;
}
.crm-modal-close:hover { background: var(--bg); color: var(--text-primary); }
.crm-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.crm-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.crm-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.crm-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.crm-field { display: flex; flex-direction: column; gap: 4px; }
.crm-field-full { grid-column: span 2; }
.crm-field label { font-size: 11px; font-weight: 600; color: var(--text-muted); }

/* Log + docs */
.crm-log-add {
  display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.crm-log-add .ctrl-input:first-child { width: 130px; flex-shrink: 0; }
.crm-log-list, .crm-doc-list {
  display: flex; flex-direction: column; gap: 6px;
}
.crm-log-entry, .crm-doc-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
}
.crm-log-date {
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 88px;
  font-size: 11px;
}
.crm-log-text { flex: 1; color: var(--text-primary); line-height: 1.5; }
.crm-log-del {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 14px; padding: 0 4px; flex-shrink: 0;
}
.crm-log-del:hover { color: var(--danger); }
.crm-doc-label { font-weight: 700; color: var(--text-primary); flex-shrink: 0; min-width: 120px; }
.crm-doc-url { flex: 1; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-projects-panel { display: flex; flex-direction: column; gap: 8px; }
.crm-proj-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
}
.crm-proj-name { font-weight: 700; color: var(--text-primary); }
.crm-proj-budget { color: var(--text-muted); font-size: 11px; }

/* Responsive */
@media (max-width: 768px) {
  .crm-pipeline { flex-direction: column; }
  .crm-column { flex: none; width: 100%; }
  .crm-fields { grid-template-columns: 1fr; }
  .crm-field-full { grid-column: span 1; }
}

/* ═══════════════════════════════════════════════════
   FINANCIAL SUITE
═══════════════════════════════════════════════════ */
/* Phase fee table */
.fin-phase-table { display:flex; flex-direction:column; gap:6px; }
.fin-phase-row {
  display:grid;
  grid-template-columns:1fr 100px 100px 100px 28px;
  gap:8px; align-items:center;
  background:var(--bg);
  border-radius:var(--radius-sm);
  padding:8px 10px;
  font-size:12px;
}
.fin-phase-row input { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:4px 8px; font-size:12px; color:var(--text-primary); font-family:var(--font); width:100%; }
.fin-phase-label { font-size:10px; color:var(--text-muted); margin-bottom:2px; }
.fin-phase-bar-wrap { height:4px; background:var(--border); border-radius:999px; margin-top:4px; }
.fin-phase-bar { height:4px; border-radius:999px; background:var(--accent); transition:width .3s; }
/* Invoice table */
.inv-table { width:100%; border-collapse:collapse; font-size:12px; margin-top:8px; }
.inv-table th { text-align:left; padding:6px 10px; font-size:10px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--text-muted); border-bottom:1px solid var(--border); }
.inv-table td { padding:8px 10px; border-bottom:1px solid var(--border); color:var(--text-primary); }
.inv-table tr:last-child td { border-bottom:none; }
.inv-pill { display:inline-block; font-size:10px; font-weight:700; padding:2px 8px; border-radius:999px; }
.inv-pill.Paid    { background:#dcfce7; color:#166534; }
.inv-pill.Sent    { background:#dbeafe; color:#1e40af; }
.inv-pill.Overdue { background:#fee2e2; color:#991b1b; }
.inv-pill.Draft   { background:#f3f4f6; color:#6b7280; }
/* Budget detail button on project cards */
.budget-detail-btn {
  font-size:11px; padding:4px 10px;
  background:none; border:1px solid var(--border);
  border-radius:var(--radius-sm); color:var(--accent);
  cursor:pointer; white-space:nowrap;
}
.budget-detail-btn:hover { background:var(--accent); color:#fff; border-color:var(--accent); }
/* Margin colour helpers */
.margin-good    { color:#10b981; }
.margin-warning { color:#f59e0b; }
.margin-danger  { color:#ef4444; }

/* ── Task dependencies ───────────────────────────────── */
.col-dep { width: 160px; min-width: 140px; }
.dep-cell-wrap { display:flex; flex-direction:column; gap:2px; }
.dep-pred-select, .dep-type-select {
  font-family: var(--font);
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  padding: 3px 6px;
  width: 100%;
  cursor: pointer;
}
.dep-pred-select:focus, .dep-type-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ═══════════════════════════════════════════════════
   UX UPGRADE — Nav groups, Toasts, Empty states, Col visibility
═══════════════════════════════════════════════════ */

/* ── Grouped nav ─────────────────────────────────── */
.nav-group { margin-bottom: 2px; }
.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 5px 12px 5px 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: color .15s;
}
.nav-group-header:hover { color: var(--text-primary); }
.nav-group-label { flex: 1; text-align: left; }
.nav-group-chevron {
  width: 10px; height: 10px;
  transition: transform .2s;
  flex-shrink: 0;
}
.nav-group-header[aria-expanded="false"] .nav-group-chevron {
  transform: rotate(-90deg);
}
.nav-group-items { overflow: hidden; }
.nav-group-collapsed { display: none; }

/* ── Toast notifications ─────────────────────────── */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 200px;
  max-width: 340px;
  pointer-events: all;
  animation: toastIn .2s ease;
  transition: opacity .3s, transform .3s;
}
.toast.toast-success { border-left: 3px solid #10b981; }
.toast.toast-error   { border-left: 3px solid #ef4444; }
.toast.toast-info    { border-left: 3px solid #4f46e5; }
.toast.toast-warning { border-left: 3px solid #f59e0b; }
.toast-icon { font-size: 15px; flex-shrink: 0; }
.toast-out  { opacity: 0; transform: translateX(20px); }
@keyframes toastIn {
  from { opacity:0; transform:translateX(20px); }
  to   { opacity:1; transform:translateX(0); }
}

/* ── Empty states ────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 40px; margin-bottom: 14px; opacity: .6; }
.empty-state-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.empty-state-sub {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 300px;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ── Column visibility pills ─────────────────────── */
.col-vis-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.col-vis-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.col-vis-pill:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hide table columns by class */
.hide-col-phase      th[data-col="phase"],    .hide-col-phase      td:nth-child(2)  { display:none; }
.hide-col-client     th[data-col="client"],   .hide-col-client     td:nth-child(3)  { display:none; }
.hide-col-owner      th[data-col="owner"],    .hide-col-owner      td:nth-child(4)  { display:none; }
.hide-col-priority   th[data-col="priority"], .hide-col-priority   td:nth-child(6)  { display:none; }
.hide-col-percent    th[data-col="percent"],  .hide-col-percent    td:nth-child(7)  { display:none; }
.hide-col-start      th[data-col="start"],    .hide-col-start      td:nth-child(8)  { display:none; }
.hide-col-evidence   th[data-col="evidence"], .hide-col-evidence   td:nth-child(10) { display:none; }
.hide-col-notes      th[data-col="notes"],    .hide-col-notes      td:nth-child(11) { display:none; }
.hide-col-verified   th[data-col="verified"], .hide-col-verified   td:nth-child(12) { display:none; }
.hide-col-dep        th[data-col="dep"],      .hide-col-dep        td:nth-child(13) { display:none; }

/* ── Drag-to-reorder table rows ──────────────────── */
.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
  padding: 0 2px;
  opacity: 0.4;
  transition: opacity .15s;
  user-select: none;
}
tr:hover .drag-handle { opacity: 1; }
.table-draggable-row.dragging { opacity: .4; background: var(--bg); }
.table-draggable-row.drag-over { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ── Mobile task cards ───────────────────────────── */
.mobile-task-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}
.mobile-task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-task-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.mobile-task-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.mobile-task-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mobile-task-card select {
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-primary);
  padding: 4px 8px;
  flex: 1;
}
.mobile-task-card-dates {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

@media (max-width: 768px) {
  #desktopTableWrap { display: none !important; }
  #mobileTaskCards  { display: flex !important; }
  #mobileTableToggle { display: none !important; }
}
@media (min-width: 769px) {
  #mobileTaskCards.show-mobile {
    display: flex !important;
  }
  #desktopTableWrap.hide-desktop {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════
   ONBOARDING SYSTEM
═══════════════════════════════════════════════════ */
.ob-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10,10,20,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font, system-ui);
}
.ob-overlay.hidden { display: none; }

/* Screens */
.ob-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ob-screen.hidden { display: none; }

/* Cards */
.ob-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 40px 44px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 32px 80px rgba(0,0,0,.35);
  animation: obFadeIn .3s ease;
}
.ob-card.ob-wide  { max-width: 780px; }
.ob-card.ob-center { text-align: center; }
@keyframes obFadeIn {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}

/* Typography */
.ob-logo { font-size: 48px; margin-bottom: 12px; }
.ob-checkmark {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.ob-title {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 10px;
  line-height: 1.2;
}
.ob-sub {
  font-size: 15px;
  color: #6b7280;
  margin: 0 0 28px;
  line-height: 1.6;
}
.ob-step-indicator {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #4f46e5;
  margin-bottom: 8px;
}

/* Industry grid */
.ob-industry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.ob-industry-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  background: #fafafa;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.ob-industry-card:hover {
  border-color: #4f46e5;
  background: #f5f3ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(79,70,229,.12);
}
.ob-industry-card.selected {
  border-color: #4f46e5;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(79,70,229,.2);
}
.ob-industry-icon { font-size: 28px; }
.ob-industry-name { font-size: 13px; font-weight: 700; color: #111827; }
.ob-industry-desc { font-size: 11px; color: #9ca3af; line-height: 1.3; }

/* Form */
.ob-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.ob-field { display: flex; flex-direction: column; gap: 6px; }
.ob-label { font-size: 13px; font-weight: 600; color: #374151; }
.ob-input {
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  color: #111827;
  font-family: inherit;
  transition: border-color .15s;
  outline: none;
}
.ob-input:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.1); }

/* Buttons */
.ob-btn-primary {
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, transform .1s;
}
.ob-btn-primary:hover { background: #4338ca; }
.ob-btn-primary:active { transform: scale(.98); }
.ob-btn-primary:disabled { background: #c4b5fd; cursor: not-allowed; }
.ob-btn-ghost {
  background: none;
  color: #6b7280;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.ob-btn-ghost:hover { border-color: #4f46e5; color: #4f46e5; }
.ob-btn-primary-sm {
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ob-btn-ghost-sm {
  background: none;
  color: rgba(255,255,255,.6);
  border: none;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.ob-btn-ghost-sm:hover { color: #fff; }
.ob-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

/* Spotlight */
.ob-spotlight {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 4000px rgba(0,0,0,.75);
  transition: all .4s cubic-bezier(.4,0,.2,1);
  z-index: 9001;
  pointer-events: none;
}

/* Tour tooltip */
.ob-tooltip {
  position: fixed;
  background: #1e1b4b;
  color: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  width: 300px;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  z-index: 9002;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  animation: obFadeIn .25s ease;
}
.ob-tooltip::before {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  background: #1e1b4b;
  transform: rotate(45deg);
}
.ob-tooltip.arrow-left::before   { left: -5px; top: 20px; }
.ob-tooltip.arrow-right::before  { right: -5px; top: 20px; }
.ob-tooltip.arrow-top::before    { top: -5px; left: 20px; }
.ob-tooltip.arrow-bottom::before { bottom: -5px; left: 20px; }
.ob-tooltip-step {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 6px;
}
.ob-tooltip-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}
.ob-tooltip-body {
  font-size: 13px;
  color: rgba(255,255,255,.75);
  line-height: 1.55;
  margin-bottom: 14px;
}
.ob-tooltip-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Highlight ring */
.ob-highlight-ring {
  position: fixed;
  border: 3px solid #4f46e5;
  border-radius: 10px;
  animation: obPulse 1.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 9003;
}
@keyframes obPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79,70,229,.5); }
  50%       { box-shadow: 0 0 0 8px rgba(79,70,229,0); }
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .ob-card { padding: 28px 20px; }
  .ob-industry-grid { grid-template-columns: repeat(2,1fr); }
  .ob-title { font-size: 20px; }
  .ob-tooltip { width: 260px; }
}

/* ═══════════════════════════════════════════════════
   PWA / MOBILE NATIVE FEEL
═══════════════════════════════════════════════════ */

/* iPhone safe areas (notch, home bar) */
@supports (padding: max(0px)){
  .sidebar {
    padding-left:   max(12px, env(safe-area-inset-left));
    padding-bottom: max(0px,  env(safe-area-inset-bottom));
  }
  .main-content {
    padding-right:  max(12px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  .mob-bottom-nav {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* Prevent text selection on tap */
.nav-btn, .hdr-btn, .card, .kanban-card {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Smooth scrolling everywhere */
* { -webkit-overflow-scrolling: touch; }

/* PWA install prompt banner */
.pwa-install-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1e1b4b;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 8000;
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.pwa-install-banner p {
  font-size: 13px;
  line-height: 1.4;
  flex: 1;
}
.pwa-install-banner strong { display: block; font-size: 14px; margin-bottom: 2px; }
.pwa-install-banner-btns { display: flex; gap: 8px; flex-shrink: 0; }
.pwa-install-btn {
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.pwa-dismiss-btn {
  background: none;
  color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

/* Standalone mode — hide browser-only elements */
@media (display-mode: standalone){
  .pwa-install-banner { display: none !important; }
}

/* Better touch targets on mobile */
@media (max-width: 768px){
  .nav-btn { min-height: 44px; }
  .hdr-btn { min-height: 40px; padding: 8px 14px; }
  .select, .ctrl-input { min-height: 40px; font-size: 16px; } /* prevents iOS zoom */
}

/* ── Passcode input shake ────────────────────────────────── */
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
