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

:root {
  --bg:        #0a0e1a;
  --surface:   #111827;
  --surface2:  #1a2236;
  --surface3:  #1f2d42;
  --border:    #1e2d45;
  --border2:   #2a3f5f;
  --text:      #e8edf5;
  --text2:     #94a3b8;
  --muted:     #546a8a;
  --accent:    #6366f1;
  --accent-h:  #4f46e5;
  --blue:      #3b82f6;
  --green:     #10b981;
  --yellow:    #f59e0b;
  --red:       #ef4444;
  --orange:    #f97316;
  --purple:    #a855f7;
  --sidebar-w: 220px;
  --topbar-h:  56px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.5);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; font-size: 13.5px; }
input, textarea, select { font-family: inherit; font-size: 13.5px; color: var(--text); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.brand-name { font-size: 14px; font-weight: 700; line-height: 1.2; }
.brand-sub  { font-size: 11px; color: var(--accent); font-weight: 500; }

.sidebar-nav { flex: 1; padding: 12px 8px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  padding: 4px 8px;
  margin-bottom: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, color .12s;
  margin-bottom: 1px;
}
.nav-item:hover  { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--surface3); color: var(--text); }
.nav-item.active .nav-icon { color: var(--accent); }

.nav-icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.nav-icon svg { width: 100%; height: 100%; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.user-section { margin-bottom: 10px; }
.user-label   { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.user-pills   { display: flex; gap: 4px; }
.user-pill {
  flex: 1;
  text-align: center;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  transition: all .12s;
}
.user-pill:hover   { border-color: var(--accent); color: var(--text); }
.user-pill.active  { background: var(--accent); border-color: var(--accent); color: #fff; }
.user-pill.active.jacob  { background: #4f46e5; border-color: #4f46e5; }
.user-pill.active.mikkel { background: #0ea5e9; border-color: #0ea5e9; }

.logout-link {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 4px;
  border-radius: 6px;
  transition: color .12s;
}
.logout-link:hover { color: var(--text); }

/* ── Main wrap ───────────────────────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 16px;
}
.page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-left  { display: flex; align-items: center; flex-shrink: 0; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.breadcrumb     { color: var(--muted); font-weight: 400; font-size: 15px; }
.breadcrumb:hover { color: var(--text); }
.breadcrumb-sep { color: var(--muted); font-size: 14px; }

/* ── Main content ────────────────────────────────────────────────────────── */
.main-content { padding: 24px; flex: 1; }

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-wrap { width: 100%; max-width: 400px; padding: 16px; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-logo .brand-icon { width: 42px; height: 42px; font-size: 13px; border-radius: 10px; }
.login-logo h1 { font-size: 22px; font-weight: 700; }
.login-tagline { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label { font-size: 12px; font-weight: 500; color: var(--text2); }
.login-form input {
  width: 100%; padding: 10px 12px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); transition: border-color .15s;
}
.login-form input:focus { outline: none; border-color: var(--accent); }

/* ── Alert ───────────────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: var(--red); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius);
  border: 1px solid var(--border2);
  font-size: 13px; font-weight: 500;
  background: transparent; color: var(--text);
  transition: all .12s; cursor: pointer; white-space: nowrap;
}
.btn:hover     { background: var(--surface2); border-color: var(--border2); }
.btn-primary   { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn-ghost     { color: var(--text2); border-color: transparent; }
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border); }
.btn-danger    { color: var(--red); border-color: rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.1); }
.btn-sm        { padding: 5px 10px; font-size: 12px; }
.btn-xs        { padding: 3px 8px; font-size: 11px; }
.btn-full      { width: 100%; justify-content: center; }

/* ── View toggle ─────────────────────────────────────────────────────────── */
.view-toggle {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
}
.view-btn {
  padding: 6px 14px; font-size: 12px; font-weight: 500;
  color: var(--text2); transition: all .12s;
}
.view-btn:hover  { color: var(--text); }
.view-btn.active { background: var(--accent); color: #fff; }

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  padding: 8px 14px; font-size: 13px; color: var(--text2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .12s, border-color .12s;
  display: flex; align-items: center; gap: 6px;
}
.tab:hover   { color: var(--text); }
.tab.active  { color: var(--accent); border-bottom-color: var(--accent); }
.tab.star-tab.active { color: var(--yellow); border-bottom-color: var(--yellow); }
.tab-count {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 1px 6px;
  font-size: 11px; color: var(--text2);
}
.tab.active .tab-count { background: rgba(99,102,241,.15); border-color: rgba(99,102,241,.3); color: var(--accent); }

/* ── Filter row ──────────────────────────────────────────────────────────── */
.filter-row {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  margin-bottom: 12px;
}
.filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-label { font-size: 11px; color: var(--muted); font-weight: 500; }

.chip {
  padding: 3px 10px; border-radius: 20px;
  border: 1px solid var(--border2);
  background: transparent; color: var(--text2);
  font-size: 12px; transition: all .12s; white-space: nowrap;
}
.chip:hover       { border-color: var(--accent); color: var(--text); }
.chip.active      { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.active.jacob  { background: #4f46e5; border-color: #4f46e5; }
.chip.active.mikkel { background: #0ea5e9; border-color: #0ea5e9; }

/* ── Search ──────────────────────────────────────────────────────────────── */
.search-form  { display: flex; gap: 6px; }
.search-input {
  padding: 6px 12px; background: var(--surface2);
  border: 1px solid var(--border2); border-radius: var(--radius);
  width: 240px; transition: border-color .15s;
}
.search-input:focus { outline: none; border-color: var(--accent); }

/* ── Table ───────────────────────────────────────────────────────────────── */
.table-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  background: var(--surface2); border-bottom: 1px solid var(--border);
}
.data-table tbody .table-row td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.data-table tbody .table-row:last-child td { border-bottom: none; }
.data-table tbody .table-row { transition: background .1s; }
.data-table tbody .table-row:hover { background: var(--surface2); }
.table-row.row-done   { opacity: .55; }
.table-row.row-overdue td:first-child { border-left: 3px solid var(--red); }

.task-link { font-weight: 500; color: var(--text); transition: color .12s; }
.task-link:hover { color: var(--accent); }
.link-subtle { color: var(--text2); transition: color .12s; }
.link-subtle:hover { color: var(--accent); }

/* ── Chips / badges ──────────────────────────────────────────────────────── */
.area-chip {
  display: inline-flex; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 500;
  background: rgba(99,102,241,.12); color: #a5b4fc;
  border: 1px solid rgba(99,102,241,.25);
}
.user-chip {
  display: inline-flex; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border2);
}
.user-chip.jacob  { background: rgba(79,70,229,.15); color: #a5b4fc; border-color: rgba(79,70,229,.3); }
.user-chip.mikkel { background: rgba(14,165,233,.15); color: #7dd3fc; border-color: rgba(14,165,233,.3); }

.user-chip-sm {
  display: inline-flex; width: 20px; height: 20px;
  align-items: center; justify-content: center;
  border-radius: 50%; font-size: 10px; font-weight: 700;
  background: var(--surface3); color: var(--text2);
}
.user-chip-sm.jacob  { background: rgba(79,70,229,.3); color: #a5b4fc; }
.user-chip-sm.mikkel { background: rgba(14,165,233,.3); color: #7dd3fc; }

.deadline-chip {
  display: inline-flex; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 500;
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border2);
}
.deadline-chip.overdue  { background: rgba(239,68,68,.12); color: var(--red); border-color: rgba(239,68,68,.3); }
.deadline-chip.due-soon { background: rgba(245,158,11,.12); color: var(--yellow); border-color: rgba(245,158,11,.3); }

.mini-badge {
  display: inline-flex; padding: 1px 6px; border-radius: 10px;
  font-size: 11px; background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border);
}
.mini-badge.mini-red { background: rgba(239,68,68,.12); color: var(--red); border-color: rgba(239,68,68,.3); }

/* Stage badges */
.stage-badge {
  display: inline-flex; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.stage-badge.stage-lead     { background: rgba(148,163,184,.1); color: var(--text2); border: 1px solid var(--border2); }
.stage-badge.stage-kontakt  { background: rgba(59,130,246,.12); color: #93c5fd; border: 1px solid rgba(59,130,246,.25); }
.stage-badge.stage-moede    { background: rgba(168,85,247,.12); color: #d8b4fe; border: 1px solid rgba(168,85,247,.25); }
.stage-badge.stage-tilbud   { background: rgba(245,158,11,.12); color: var(--yellow); border: 1px solid rgba(245,158,11,.25); }
.stage-badge.stage-vundet   { background: rgba(16,185,129,.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,.25); }
.stage-badge.stage-tabt     { background: rgba(239,68,68,.1); color: var(--red); border: 1px solid rgba(239,68,68,.2); }

/* ── Status select ───────────────────────────────────────────────────────── */
.status-select, .stage-select {
  padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--border2);
  background: var(--surface2); color: var(--text);
  font-size: 12px; cursor: pointer; transition: border-color .12s;
}
.status-select:hover, .stage-select:hover { border-color: var(--accent); }

.status-select.s-todo        { border-color: var(--border2); color: var(--text2); }
.status-select.s-in_progress { border-color: var(--blue); color: var(--blue); }
.status-select.s-waiting     { border-color: var(--yellow); color: var(--yellow); }
.status-select.s-done        { border-color: var(--green); color: var(--green); }

.stage-select.stage-lead    { border-color: var(--border2); color: var(--text2); }
.stage-select.stage-kontakt { border-color: var(--blue); color: var(--blue); }
.stage-select.stage-moede   { border-color: var(--purple); color: var(--purple); }
.stage-select.stage-tilbud  { border-color: var(--yellow); color: var(--yellow); }
.stage-select.stage-vundet  { border-color: var(--green); color: var(--green); }
.stage-select.stage-tabt    { border-color: var(--red); color: var(--red); }

/* ── Star button ─────────────────────────────────────────────────────────── */
.star-btn {
  background: none; border: none; color: var(--muted);
  font-size: 16px; padding: 2px; transition: color .12s, transform .1s;
}
.star-btn:hover   { color: var(--yellow); transform: scale(1.2); }
.star-btn.starred { color: var(--yellow); }

.star-btn-lg { font-size: 24px; padding: 4px; background: none; border: none;
  color: var(--muted); transition: color .12s; }
.star-btn-lg:hover   { color: var(--yellow); }
.star-btn-lg.starred { color: var(--yellow); }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 80px 24px; color: var(--muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; font-size: 15px; }

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2,1fr); } }

.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow); transition: border-color .12s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-card-warn { border-color: rgba(239,68,68,.35) !important; }

.stat-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-card-icon svg { width: 20px; height: 20px; }
.stat-card-icon.blue   { background: rgba(59,130,246,.15); color: var(--blue); }
.stat-card-icon.red    { background: rgba(239,68,68,.15); color: var(--red); }
.stat-card-icon.purple { background: rgba(168,85,247,.15); color: var(--purple); }
.stat-card-icon.green  { background: rgba(16,185,129,.15); color: var(--green); }

.stat-card-value { font-size: 24px; font-weight: 700; line-height: 1; }
.stat-card-label { font-size: 12px; color: var(--text2); margin-top: 3px; }
.text-red { color: var(--red) !important; }

.dashboard-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
.dash-col { display: flex; flex-direction: column; gap: 16px; }

.dash-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow);
}
.dash-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.dash-card-title { font-size: 13px; font-weight: 600; }
.dash-card-footer-link {
  display: block; text-align: center;
  padding: 10px; font-size: 12px; color: var(--accent);
  border-top: 1px solid var(--border); transition: background .12s;
}
.dash-card-footer-link:hover { background: var(--surface2); }

.dash-task-list { padding: 6px 0; }
.dash-task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; transition: background .1s;
}
.dash-task-row:hover { background: var(--surface2); }
.dash-task-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot-todo        { background: var(--muted); }
.status-dot-in_progress { background: var(--blue); }
.status-dot-waiting     { background: var(--yellow); }
.status-dot-done        { background: var(--green); }
.dash-task-info  { flex: 1; min-width: 0; }
.dash-task-title { font-size: 13px; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-task-meta  { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.dash-task-arrow { color: var(--muted); font-size: 12px; }
.dash-empty { padding: 32px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* Pipeline mini */
.pipeline-mini { display: flex; gap: 0; padding: 16px 18px; }
.pipeline-mini-col {
  flex: 1; text-align: center; padding: 10px 8px;
  border-right: 1px solid var(--border);
}
.pipeline-mini-col:last-child { border-right: none; }
.pipeline-mini-won { background: rgba(16,185,129,.05); border-radius: 0 8px 8px 0; }
.pipeline-mini-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.pipeline-mini-count { font-size: 22px; font-weight: 700; }
.pipeline-mini-count.green { color: var(--green); }
.pipeline-mini-value { font-size: 11px; color: var(--text2); margin-top: 2px; }
.pipeline-mini-value.green { color: var(--green); }

/* Activity feed */
.activity-feed { padding: 8px 0; }
.activity-item {
  display: flex; gap: 10px; padding: 10px 18px;
  transition: background .1s;
}
.activity-item:hover { background: var(--surface2); }
.activity-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  background: var(--surface3); color: var(--text2);
}
.activity-avatar.jacob  { background: rgba(79,70,229,.3); color: #a5b4fc; }
.activity-avatar.mikkel { background: rgba(14,165,233,.3); color: #7dd3fc; }
.activity-body  { flex: 1; min-width: 0; }
.activity-header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.activity-author { font-size: 12px; font-weight: 600; }
.activity-time   { font-size: 11px; color: var(--muted); margin-left: auto; }
.activity-type-badge {
  font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 500;
}
.badge-task    { background: rgba(99,102,241,.15); color: #a5b4fc; }
.badge-contact { background: rgba(16,185,129,.12); color: #6ee7b7; }
.activity-ref  { font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.activity-ref a:hover { color: var(--accent); }
.activity-content { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Status breakdown */
.status-breakdown { padding: 8px 0; }
.status-breakdown-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px; transition: background .1s;
}
.status-breakdown-row:hover { background: var(--surface2); }
.status-breakdown-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-todo        { background: var(--muted); }
.dot-in_progress { background: var(--blue); }
.dot-waiting     { background: var(--yellow); }
.dot-done        { background: var(--green); }
.status-breakdown-label { font-size: 12px; width: 100px; flex-shrink: 0; }
.status-breakdown-bar-wrap { flex: 1; height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden; }
.status-breakdown-bar { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }
.status-breakdown-count { font-size: 12px; font-weight: 600; width: 24px; text-align: right; }

/* ── Pipeline board ──────────────────────────────────────────────────────── */
.pipeline-board {
  display: flex; gap: 12px;
  overflow-x: auto; padding-bottom: 16px;
  align-items: flex-start;
}
.pipeline-col {
  flex-shrink: 0; width: 220px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.col-won  { border-color: rgba(16,185,129,.3); }
.col-lost { border-color: rgba(239,68,68,.2); opacity: .75; }

.pipeline-col-header {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.pipeline-col-title { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.pipeline-col-meta  { display: flex; align-items: center; gap: 8px; }
.pipeline-col-count {
  background: var(--surface3); border: 1px solid var(--border2);
  border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600;
}
.pipeline-col-value { font-size: 11px; color: var(--green); font-weight: 500; }

.pipeline-col-cards { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 60px; }

.kanban-card {
  display: block; background: var(--surface2);
  border: 1px solid var(--border2); border-radius: var(--radius);
  padding: 10px 12px; transition: border-color .12s, box-shadow .12s;
}
.kanban-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(99,102,241,.2); }
.kanban-card-company { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.kanban-card-person  { font-size: 11px; color: var(--text2); margin-bottom: 6px; }
.kanban-card-footer  { display: flex; align-items: center; justify-content: space-between; }
.kanban-card-value   { font-size: 11px; color: var(--green); font-weight: 500; }

.kanban-add {
  display: block; text-align: center; padding: 6px;
  font-size: 12px; color: var(--muted); border: 1px dashed var(--border2);
  border-radius: var(--radius); transition: all .12s;
}
.kanban-add:hover { color: var(--accent); border-color: var(--accent); background: rgba(99,102,241,.05); }

/* ── Detail layout ───────────────────────────────────────────────────────── */
.detail-layout {
  display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start;
}
@media (max-width: 768px) { .detail-layout { grid-template-columns: 1fr; } }

.detail-hero {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px;
}
.detail-title    { font-size: 20px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.detail-meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.contact-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.contact-avatar {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #fff;
}

.detail-section  { margin-bottom: 28px; }
.section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .7px; color: var(--muted); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.count-badge {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 1px 7px; font-size: 11px;
  color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 500;
}
.detail-description { color: var(--text); line-height: 1.7; white-space: pre-wrap; font-size: 14px; }

/* ── Notes / activity ────────────────────────────────────────────────────── */
.note-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.note-item   { display: flex; gap: 10px; }
.note-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--surface3); color: var(--text2);
}
.note-avatar.jacob  { background: rgba(79,70,229,.3); color: #a5b4fc; }
.note-avatar.mikkel { background: rgba(14,165,233,.3); color: #7dd3fc; }
.note-bubble {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.note-meta   { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.note-author { font-size: 12px; font-weight: 600; }
.note-author.jacob  { color: #a5b4fc; }
.note-author.mikkel { color: #7dd3fc; }
.note-time   { font-size: 11px; color: var(--muted); }
.note-del {
  background: none; border: none; color: var(--muted);
  font-size: 16px; padding: 0 2px; transition: color .12s;
}
.note-del:hover { color: var(--red); }
.note-text  { font-size: 13px; line-height: 1.6; white-space: pre-wrap; color: var(--text); }
.note-empty { color: var(--muted); font-size: 13px; font-style: italic; padding: 12px 0; }

.note-compose { display: flex; flex-direction: column; gap: 8px; }
.note-compose textarea {
  padding: 10px 12px; background: var(--surface2);
  border: 1px solid var(--border2); border-radius: var(--radius);
  resize: vertical; transition: border-color .15s;
}
.note-compose textarea:focus { outline: none; border-color: var(--accent); }
.note-compose-author { display: flex; align-items: center; gap: 10px; }
.radio-lbl { display: flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; }
.radio-lbl input { accent-color: var(--accent); cursor: pointer; }

/* ── Meta panel ──────────────────────────────────────────────────────────── */
.detail-sidebar { }
.meta-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  position: sticky; top: calc(var(--topbar-h) + 16px);
  box-shadow: var(--shadow);
}
.meta-panel-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .7px; color: var(--muted); margin-bottom: 10px;
}
.meta-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 0; border-top: 1px solid var(--border);
}
.meta-row:first-of-type { border-top: none; }
.meta-key { font-size: 12px; color: var(--text2); flex-shrink: 0; }
.meta-divider { border-top: 2px solid var(--border2); margin: 8px 0; }
.value-text { font-size: 14px; font-weight: 600; color: var(--green); }

/* ── Form page ───────────────────────────────────────────────────────────── */
.form-page { max-width: 720px; }
.crm-form  { display: flex; flex-direction: column; gap: 16px; }

.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 24px;
  box-shadow: var(--shadow);
}
.form-card-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); margin-bottom: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--text2); }
.req { color: var(--red); }
.form-hint { font-size: 11px; color: var(--muted); }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 600px) {
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}

.crm-form input[type="text"],
.crm-form input[type="email"],
.crm-form input[type="tel"],
.crm-form input[type="date"],
.crm-form input[type="number"],
.crm-form textarea,
.crm-form select {
  padding: 8px 12px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius); width: 100%; transition: border-color .15s;
}
.crm-form input:focus, .crm-form textarea:focus, .crm-form select:focus {
  outline: none; border-color: var(--accent);
}

/* Area picker */
.area-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.area-option { display: none; }
.area-option {
  display: inline-flex; align-items: center; gap: 4px;
}
.area-option input[type="radio"] { display: none; }
.area-option span, .area-option-custom span {
  padding: 4px 12px; border-radius: 20px;
  border: 1px solid var(--border2); font-size: 12px;
  color: var(--text2); cursor: pointer; transition: all .12s;
  display: inline-block;
}
.area-option:has(input:checked) span,
.area-option input:checked + span {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.area-option span:hover { border-color: var(--accent); color: var(--text); }
.area-option-custom { display: flex; align-items: center; gap: 6px; }
.area-option-custom input[type="text"] {
  padding: 4px 10px; width: 140px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 20px; font-size: 12px;
}

.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 4px;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-muted { color: var(--muted); }
.text-sm    { font-size: 12px; }
.green      { color: var(--green); }

/* ══════════════════════════════════════════════════════════════════════════
   PHASE 3 — Customers, Products, Prospects, Orders
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Profit / loss colours ─────────────────────────────────────────────── */
.profit-positive { color: #10b981; font-weight: 600; }
.profit-negative { color: #ef4444; font-weight: 600; }
.text-red        { color: #ef4444; }

/* ── Summary strip (customers list) ────────────────────────────────────── */
.summary-strip {
  display: flex; gap: 24px; align-items: center;
  padding: 14px 20px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; font-size: 13px;
}
.summary-strip strong { font-size: 15px; }

/* ── Stock badges ───────────────────────────────────────────────────────── */
.stock-badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: var(--surface2); color: var(--text);
}
.stock-empty { background: rgba(239,68,68,.15); color: #ef4444; }
.stock-low   { background: rgba(245,158,11,.15); color: #f59e0b; }

/* ── Table footer row ───────────────────────────────────────────────────── */
.table-footer td {
  padding: 12px 14px; background: var(--surface);
  border-top: 2px solid var(--border2); font-size: 13px;
}
.row-overdue { opacity: .85; }

/* ── Margin preview (product form) ─────────────────────────────────────── */
.margin-preview {
  display: none; margin-top: 10px; padding: 10px 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; color: var(--text2);
}
.margin-preview .m-val { font-size: 16px; font-weight: 700; color: #10b981; }
.margin-preview .m-pct { color: var(--muted); margin-left: 6px; font-size: 12px; }

/* ── Order totals strip (customer detail) ───────────────────────────────── */
.order-totals-strip {
  display: flex; gap: 0; margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden;
}
.ot-item {
  flex: 1; padding: 14px 18px; text-align: center;
}
.ot-item + .ot-item { border-left: 1px solid var(--border); }
.ot-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.ot-val { font-size: 18px; font-weight: 700; color: var(--text); }
.ot-val.green { color: #10b981; }

/* ── Order cards ────────────────────────────────────────────────────────── */
.order-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 12px; overflow: hidden;
}
.order-card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer; user-select: none;
}
.order-card-header:hover { background: var(--surface2); }
.order-date { font-size: 12px; color: var(--muted); margin-left: auto; }
.order-revenue { font-size: 14px; font-weight: 600; }
.order-profit  { font-size: 13px; color: #10b981; font-weight: 600; }
.order-notes   { font-size: 12px; color: var(--muted); font-style: italic; }
.order-toggle  { margin-left: 8px; color: var(--muted); font-size: 12px; transition: transform .15s; }
.order-card.open .order-toggle { transform: rotate(180deg); }

/* ── Order line-items table ─────────────────────────────────────────────── */
.order-lines { padding: 0 16px 14px; }
.order-items-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.order-items-table th {
  text-align: left; padding: 6px 10px; color: var(--muted);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.order-items-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.order-items-table tr:last-child td { border-bottom: none; }
.order-items-table .profit-col { text-align: right; }
.order-total-row td {
  padding-top: 10px; font-weight: 700;
  border-top: 2px solid var(--border2);
}

/* ── Dynamic order form ─────────────────────────────────────────────────── */
.order-line-header {
  display: grid;
  grid-template-columns: 1fr 70px 110px 110px 100px 36px;
  gap: 8px; align-items: center;
  padding: 6px 0; font-size: 12px; color: var(--muted);
  font-weight: 600; text-transform: uppercase;
}
.order-line {
  display: grid;
  grid-template-columns: 1fr 70px 110px 110px 100px 36px;
  gap: 8px; align-items: center; margin-bottom: 6px;
}
.order-line select, .order-line input[type="number"], .order-line input[type="text"] {
  width: 100%; padding: 7px 10px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 7px; color: var(--text); font-size: 13px;
}
.order-line .line-profit {
  font-size: 12px; font-weight: 600; color: #10b981; text-align: right;
}
.order-line .line-profit.neg { color: #ef4444; }
.btn-remove-line {
  background: none; border: 1px solid var(--border2); border-radius: 6px;
  color: var(--muted); cursor: pointer; width: 32px; height: 32px;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.btn-remove-line:hover { background: rgba(239,68,68,.12); color: #ef4444; border-color: #ef4444; }
.order-form-total {
  text-align: right; padding: 10px 0;
  border-top: 1px solid var(--border); margin-top: 6px;
  font-size: 14px; color: var(--text2);
}
.order-form-total strong { font-size: 16px; color: #10b981; }

/* ── Customer / prospect hero ───────────────────────────────────────────── */
.contact-hero {
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.contact-avatar {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.detail-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.detail-meta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Stage select colours ────────────────────────────────────────────────── */
.stage-select { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border2); cursor: pointer; font-size: 13px; }
.stage-lead     { background: rgba(99,102,241,.15); color: #818cf8; }
.stage-kontakt  { background: rgba(59,130,246,.15); color: #60a5fa; }
.stage-moede    { background: rgba(245,158,11,.15); color: #fbbf24; }
.stage-tilbud   { background: rgba(139,92,246,.15); color: #a78bfa; }
.stage-vundet   { background: rgba(16,185,129,.15); color: #34d399; }
.stage-tabt     { background: rgba(107,114,128,.15); color: #9ca3af; }

/* ── Stage badges ───────────────────────────────────────────────────────── */
.stage-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.stage-badge.stage-lead    { background: rgba(99,102,241,.15); color: #818cf8; }
.stage-badge.stage-kontakt { background: rgba(59,130,246,.15); color: #60a5fa; }
.stage-badge.stage-moede   { background: rgba(245,158,11,.15); color: #fbbf24; }
.stage-badge.stage-tilbud  { background: rgba(139,92,246,.15); color: #a78bfa; }
.stage-badge.stage-vundet  { background: rgba(16,185,129,.15); color: #34d399; }
.stage-badge.stage-tabt    { background: rgba(107,114,128,.15); color: #9ca3af; }

/* ── Value text ─────────────────────────────────────────────────────────── */
.value-text { font-size: 15px; font-weight: 700; color: #10b981; }

/* ── Activity feed badges ────────────────────────────────────────────────── */
.badge-task    { background: rgba(99,102,241,.15); color: #818cf8; }
.badge-contact { background: rgba(16,185,129,.15); color: #34d399; }
.badge-lead    { background: rgba(245,158,11,.15); color: #fbbf24; }

/* ── User chips ─────────────────────────────────────────────────────────── */
.user-chip { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.user-chip.jacob  { background: rgba(99,102,241,.15); color: #818cf8; }
.user-chip.mikkel { background: rgba(16,185,129,.15); color: #34d399; }
.user-chip.begge  { background: rgba(107,114,128,.15); color: #9ca3af; }

/* ── Detail page layout ──────────────────────────────────────────────────── */
.detail-layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start; }
@media (max-width: 800px) { .detail-layout { grid-template-columns: 1fr; } }
.detail-main {}
.detail-sidebar {}
.detail-section { margin-bottom: 24px; }
.section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.detail-description { font-size: 14px; color: var(--text2); line-height: 1.6; }
.count-badge {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 1px 8px; font-size: 11px; color: var(--muted);
}

/* ── Meta panel (sidebar) ────────────────────────────────────────────────── */
.meta-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
}
.meta-panel-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin-bottom: 12px;
}
.meta-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; gap: 8px; font-size: 13px;
}
.meta-key { color: var(--muted); flex-shrink: 0; }
.meta-divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.link-subtle { color: var(--text2); text-decoration: none; }
.link-subtle:hover { color: var(--accent); }

/* ── Kanban pipeline board ───────────────────────────────────────────────── */
.kanban-board {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px;
  align-items: flex-start;
}
.kanban-col {
  min-width: 220px; flex: 1;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.kanban-col-header {
  padding: 10px 14px; display: flex; align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border); font-size: 12px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.kanban-count {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 1px 8px; font-size: 11px;
  color: var(--muted); font-weight: 600;
}
.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kanban-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; display: block;
  text-decoration: none; color: var(--text);
  transition: border-color .12s, transform .1s;
}
.kanban-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.kanban-card-company { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.kanban-card-meta { font-size: 11px; color: var(--muted); }
.kanban-card-value { font-size: 12px; color: #10b981; font-weight: 600; margin-top: 4px; }
.kanban-empty { padding: 10px; text-align: center; color: var(--muted); font-size: 12px; }

/* ── Pipeline mini (dashboard) ───────────────────────────────────────────── */
.pipeline-mini { display: flex; gap: 0; }
.pipeline-mini-col {
  flex: 1; text-align: center; padding: 12px 8px;
  border-right: 1px solid var(--border);
}
.pipeline-mini-col:last-child { border-right: none; }
.pipeline-mini-label { font-size: 10px; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.pipeline-mini-count { font-size: 20px; font-weight: 700; color: var(--text); }

/* ── View toggle (list / kanban) ─────────────────────────────────────────── */
.view-toggle { display: flex; gap: 4px; }
.view-toggle .btn { padding: 5px 12px; }
.view-toggle .btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Area chip ───────────────────────────────────────────────────────────── */
.area-chip {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; background: var(--surface2);
  border: 1px solid var(--border2); color: var(--text2);
}

/* ══════════════════════════════════════════════════════════════════════════
   DASHBOARD v2 — Priority strip + Area kanban
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Priority "Fokus nu" card ───────────────────────────────────────────── */
.priority-card { border-top: 3px solid var(--accent); }
.priority-icon { font-style: normal; }

.priority-task-list { display: flex; flex-direction: column; }

.priority-task-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border); transition: background .1s;
  gap: 12px;
}
.priority-task-row:last-child { border-bottom: none; }
.priority-task-row:hover { background: var(--surface2); }
.priority-task-row.p-overdue { border-left: 3px solid #ef4444; }

.p-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.p-dot   { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.p-info  { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.p-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-meta  { display: flex; gap: 4px; flex-wrap: wrap; }

.star-icon { color: #f59e0b; margin-right: 3px; }

.p-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.p-deadline {
  font-size: 11px; color: var(--muted);
  background: var(--surface2); border: 1px solid var(--border2);
  padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}
.p-deadline-red { background: rgba(239,68,68,.12); color: #ef4444; border-color: rgba(239,68,68,.3); }

.user-mini-jacob  { background: rgba(99,102,241,.12) !important; color: #818cf8 !important; }
.user-mini-mikkel { background: rgba(16,185,129,.12) !important; color: #34d399 !important; }

/* ── Section header row ──────────────────────────────────────────────────── */
.section-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 32px 0 14px;
}
.section-heading {
  font-size: 14px; font-weight: 700; color: var(--text);
  letter-spacing: .01em;
}

/* ── Area kanban board ───────────────────────────────────────────────────── */
.area-kanban {
  display: flex; gap: 12px; overflow-x: auto;
  padding-bottom: 16px; align-items: flex-start;
  /* hide scrollbar but keep scroll */
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.area-kanban::-webkit-scrollbar { height: 6px; }
.area-kanban::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

.area-col {
  min-width: 210px; max-width: 240px; flex: 0 0 220px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}

.area-col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface2); border-bottom: 1px solid var(--border);
}
.area-col-name { font-size: 12px; font-weight: 700; color: var(--text); }
.area-col-count {
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: 20px; padding: 1px 8px;
  font-size: 11px; color: var(--muted); font-weight: 600;
}

.area-col-cards {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; min-height: 60px;
}

.area-task-card {
  display: block; text-decoration: none; color: var(--text);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  transition: border-color .12s, transform .1s, box-shadow .12s;
}
.area-task-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.area-card-overdue {
  border-left: 3px solid #ef4444;
}

.area-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.area-card-status { display: flex; align-items: center; gap: 5px; }
.area-card-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.area-card-status-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.area-card-star { color: #f59e0b; font-size: 12px; }

.area-card-title {
  font-size: 13px; font-weight: 500; line-height: 1.35;
  margin-bottom: 8px; color: var(--text);
}

.area-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
}
.area-card-deadline { font-size: 10px; color: var(--muted); }
.area-deadline-red  { color: #ef4444; font-weight: 600; }

.area-card-user {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.area-card-user.jacob  { background: rgba(99,102,241,.2); color: #818cf8; }
.area-card-user.mikkel { background: rgba(16,185,129,.2); color: #34d399; }

/* status dot colours for area kanban */
.area-card-dot.status-dot-todo     { background: var(--muted); }
.area-card-dot.status-dot-in_progress { background: var(--accent); }
.area-card-dot.status-dot-review   { background: #f59e0b; }
.area-card-dot.status-dot-done     { background: var(--green); }

/* ── Global search (Feature 1) ──────────────────────────────────────────── */
.topbar-search {
  display: flex; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 10px; gap: 6px;
  margin: 0 16px; flex: 0 1 260px;
}
.topbar-search:focus-within {
  border-color: var(--accent);
}
.search-icon { color: var(--muted); display: flex; align-items: center; }
.search-input {
  background: none; border: none; outline: none;
  color: var(--text); padding: 7px 0; width: 100%; font-size: 13px;
}
.search-input::placeholder { color: var(--muted); }

.search-results-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

/* ── Low stock badges (Feature 2) ────────────────────────────────────────── */
.stock-zero { background: rgba(239,68,68,.18); color: #ef4444; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.stock-low  { background: rgba(245,158,11,.15); color: #f59e0b; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }

/* ── btn-success (Feature 6) ─────────────────────────────────────────────── */
.btn-success {
  background: #10b981; color: #fff; border: 1px solid #10b981;
  border-radius: var(--radius); padding: 7px 14px; font-weight: 600;
  transition: background .12s;
}
.btn-success:hover { background: #059669; border-color: #059669; }

/* ── Modal overlay (Feature 4) ───────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg); padding: 24px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
  padding: 0 4px; border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }

/* ── Quick-add FAB (Feature 4) ───────────────────────────────────────────── */
.quick-add-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 100;
  background: var(--accent); color: #fff;
  border: none; border-radius: 28px;
  padding: 12px 22px; font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 18px rgba(99,102,241,.5);
  cursor: pointer; transition: background .15s, transform .1s;
}
.quick-add-fab:hover { background: var(--accent-h); transform: scale(1.04); }

/* ── Tag over / overfør ─────────────────────────────────────────────────── */
.btn-overtag {
  background: rgba(99,102,241,.15);
  color: #818cf8;
  border: 1px solid rgba(99,102,241,.35);
  font-weight: 600;
  transition: all .12s;
}
.btn-overtag:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Assign dropdown in task sidebar */
.assign-select {
  padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border2); cursor: pointer;
  font-size: 13px; font-weight: 600;
}
.assign-jacob  { background: rgba(99,102,241,.15); color: #818cf8; }
.assign-mikkel { background: rgba(16,185,129,.15);  color: #34d399; }
.assign-begge  { background: rgba(107,114,128,.15); color: #9ca3af; }
