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

:root {
  --sidebar-width: 290px;
  --tabbar-height: 48px;
  --accent: #111111;
  --accent-hover: #333333;
  --bg: #ffffff;
  --bg-secondary: #f7f7f7;
  --bg-hover: #f0f0f0;
  --border: #e8e8e8;
  --text-primary: #111111;
  --text-secondary: #666666;
  --text-muted: #999999;
  --radius: 10px;
  --radius-sm: 6px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
}

h1 { margin-bottom: 14px; }

/* ── Layout ── */

.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo img {
  height: 48px;
  width: auto;
  display: block;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
}

.hidden {
  display: none !important;
}

.sidebar-nav ul {
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 20px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 16px 10px 6px;
}

.nav-chevron {
  margin-left: auto;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1;
}

/* ── Back button ── */

.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 4px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.nav-back:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text-primary);
}

.nav-back-arrow {
  font-size: 18px;
  line-height: 1;
}

/* ── Brand nav header ── */

.brand-nav-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.brand-circle-lg {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
}

.brand-nav-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.brand-nav-type {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── Tab bar ── */

.tab-bar {
  height: var(--tabbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  padding: 0 60px;
  flex-shrink: 0;
  gap: 2px;
}

.tab {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.12s;
}
.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.tab-brand-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.tab-brand-name {
  font-size: 13px;
  font-weight: 600;
}

.tab-sep {
  width: 1px;
  background: var(--border);
  margin: 12px 6px;
  flex-shrink: 0;
}

.brand-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

/* ── Main ── */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-secondary);
}


.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ── Content ── */

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 50px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* ── Stats Grid ── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

/* ── Section Title ── */

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

/* ── Brand Cards ── */

.brand-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.brand-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.brand-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
}

.brand-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.brand-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Brand Hero ── */

.brand-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
}

.brand-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
}

.brand-hero h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.brand-hero-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Pipeline ── */

.pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.pipeline-card {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.pipeline-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  color: #aaa;
  flex-shrink: 0;
  user-select: none;
}

/* ── Muted nav items (inactive) ── */

.nav-item-muted {
  opacity: 0.45;
}

.nav-item-muted:hover {
  opacity: 0.75;
}

/* ── Calendar ── */

#calendar-container { margin-bottom: 32px; }

/* Outer box */
.cal-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}

/* Toolbar */
.cal-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap;
  background: var(--bg);
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-week-lbl { font-size: 14px; font-weight: 600; color: var(--text-primary); padding: 0 6px; }
.cal-nav-btn {
  padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); font-size: 13px; cursor: pointer; color: var(--text-secondary);
  transition: background 0.12s;
}
.cal-nav-btn:hover { background: var(--bg-hover); }
.cal-nav-today { font-size: 12px; }
.cal-add-btn {
  padding: 6px 14px; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity 0.15s;
}
.cal-add-btn:hover { opacity: 0.8; }
.cal-refresh-btn {
  padding: 6px 14px; background: var(--bg); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.12s;
}
.cal-refresh-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Fixed header strip with black day bars */
.cal-header-strip {
  display: flex; flex-shrink: 0; border-bottom: 2px solid #111; overflow: visible;
}
.cal-gutter-ph { flex-shrink: 0; border-right: 1px solid var(--border); }
.cal-day-hbar {
  flex: 1; background: #111; padding: 10px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-right: 1px solid #333; cursor: default; user-select: none;
}
.cal-day-hbar:last-child { border-right: none; }
.cal-hbar-today { background: #1a1a1a; box-shadow: inset 0 0 0 2px var(--accent); }
.cal-hbar-name {
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: #fff;
}
.cal-hbar-date { font-size: 11px; color: #aaa; font-weight: 400; }
.cal-hbar-today .cal-hbar-name { color: var(--accent); }

/* Goals strip */
.cal-goals-strip {
  display: flex; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  min-height: 32px;
}
.cal-goal-cell {
  flex: 1; padding: 4px 5px; display: flex; flex-direction: column; gap: 3px;
  border-right: 1px solid var(--border);
  min-height: 32px;
}
.cal-goal-cell:last-child { border-right: none; }
.cal-goal-item {
  display: flex; align-items: center; gap: 4px;
  border-radius: 4px; padding: 2px 4px; font-size: 11px;
}
.cal-goal-icon { flex-shrink: 0; }
.cal-goal-icon-goal { color: #e74c3c; }
.cal-goal-icon-cal  { color: #1877F2; }
.cal-goal-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); font-weight: 700; cursor: text; }
.cal-goal-del {
  background: none; border: none; cursor: pointer; font-size: 13px; line-height: 1;
  color: var(--text-muted); padding: 0 1px; flex-shrink: 0; opacity: 0.5;
}
.cal-goal-del:hover { opacity: 1; color: #e74c3c; }
.cal-goal-add {
  background: none; border: none; cursor: pointer; font-size: 14px; line-height: 1;
  color: var(--text-muted); padding: 0 2px; align-self: flex-start; opacity: 0;
  transition: opacity 0.12s;
}
.cal-goal-cell:hover .cal-goal-add { opacity: 1; }
.cal-goal-type-pick { display: flex; gap: 4px; padding: 2px 0; }
.cal-goal-type-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 7px; font-size: 11px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-primary);
  transition: background 0.1s;
}
.cal-goal-type-btn:hover { background: var(--bg-hover); }
.cal-goal-input {
  width: 100%; border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 6px; font-size: 11px; outline: none; background: #fff;
  color: var(--text-primary);
}
.cal-goal-input:focus { border-color: var(--accent); }

/* Scrollable body */
.cal-scroll-wrap {
  overflow-y: auto; max-height: 520px; flex: 1;
}
.cal-body-inner { display: flex; }

/* Time gutter */
.cal-time-gutter {
  flex-shrink: 0; position: relative;
  border-right: 1px solid var(--border); background: var(--bg-secondary);
}
.cal-time-lbl {
  position: absolute; right: 8px; font-size: 10px; color: var(--text-muted);
  font-weight: 500; line-height: 1; white-space: nowrap;
}

/* Day columns wrapper */
.cal-day-cols-wrap { display: flex; flex: 1; }

/* Individual day column */
.cal-day-col {
  flex: 1; position: relative; border-right: 1px solid var(--border);
  cursor: default;
}
.cal-day-col:last-child { border-right: none; }
.cal-col-today { background: rgba(24,185,106,0.03); }

/* Hour and half-hour lines */
.cal-hr-line {
  position: absolute; left: 0; right: 0; height: 1px;
  background: var(--text-muted); opacity: 0.3; pointer-events: none;
}
.cal-half-line {
  position: absolute; left: 0; right: 0; height: 1px;
  background-image: repeating-linear-gradient(to right, var(--text-muted) 0, var(--text-muted) 5px, transparent 5px, transparent 11px);
  opacity: 0.25; pointer-events: none;
}

/* Current time indicator */
.cal-now-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--accent); z-index: 5; pointer-events: none;
}
.cal-now-line::before {
  content: ''; position: absolute; left: -4px; top: -4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
}

/* Events */
.cal-ev-block {
  position: absolute; left: 3px; right: 3px;
  border-left: 3px solid; border-radius: 4px;
  padding: 3px 6px 2px; font-size: 11px; z-index: 2;
  display: flex; flex-direction: column; gap: 1px;
  cursor: grab; overflow: hidden; user-select: none;
  transition: box-shadow 0.1s;
}
.cal-ev-block:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.cal-ev-dragging { cursor: grabbing; opacity: 0.85; box-shadow: 0 4px 16px rgba(0,0,0,0.2); z-index: 10; }
.cal-ev-time { font-size: 10px; font-weight: 700; opacity: 0.8; line-height: 1; flex-shrink: 0; }
.cal-ev-title { font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev-inline {
  display: flex; align-items: center; gap: 4px;
  overflow: hidden; height: 100%;
}
.cal-ev-inline .cal-ev-time { opacity: 0.7; }
.cal-ev-inline .cal-ev-title { flex: 1; }
.cal-ev-inline .cal-ev-del { position: relative; top: auto; right: auto; display: none; flex-shrink: 0; }
.cal-ev-block:hover .cal-ev-inline .cal-ev-del { display: block; }
.cal-ev-del {
  display: none; position: absolute; top: 2px; right: 3px;
  background: none; border: none; cursor: pointer; font-size: 13px;
  color: rgba(0,0,0,0.5); padding: 0; line-height: 1;
}
.cal-ev-block:hover .cal-ev-del { display: block; }
.cal-ev-dur-tag {
  position: absolute; top: 3px; right: 22px;
  font-size: 9px; font-weight: 700;
  border-radius: 3px; padding: 1px 4px;
  pointer-events: none; line-height: 1.4;
}

/* Hover preview ghost */
.cal-ev-hover {
  position: absolute; left: 3px; right: 3px; border-radius: 4px;
  border: 1.5px dashed var(--accent); background: rgba(24,185,106,0.07);
  padding: 3px 6px; pointer-events: none; z-index: 1;
  display: flex; flex-direction: column; gap: 1px;
}
.cal-ev-hover .cal-ev-time { font-size: 10px; font-weight: 700; color: var(--accent); opacity: 0.9; line-height: 1; }
.cal-ev-hover .cal-ev-title { font-size: 11px; font-weight: 500; color: var(--accent); opacity: 0.6; }

/* Calendar modal */
.cal-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 1000; align-items: center; justify-content: center;
}
.cal-modal-box {
  background: var(--bg); border-radius: var(--radius); padding: 24px 28px;
  width: 400px; max-width: 95vw; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.cal-modal-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.cal-field-lbl { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-top: 2px; display: block; }
.cal-field-inp {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 10px; font-size: 13px; outline: none; background: var(--bg);
  transition: border-color 0.15s; box-sizing: border-box;
}
.cal-field-inp:focus { border-color: var(--accent); }
.cal-color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-cdot {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; transition: transform 0.1s;
}
.cal-cdot.sel { border-color: var(--text-primary); transform: scale(1.15); }
.cal-rec-row { display: flex; gap: 16px; font-size: 13px; }
.cal-days-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-day-lbl {
  display: flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer;
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 99px;
  transition: background 0.1s;
}
.cal-day-lbl input { display: none; }
.cal-day-lbl:has(input:checked) { background: var(--accent); color: #fff; border-color: var(--accent); }
.cal-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.cal-btn-sec { padding: 7px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; font-size: 13px; }
.cal-btn-pri { padding: 7px 16px; border: none; border-radius: var(--radius-sm); background: var(--accent); color: #fff; cursor: pointer; font-size: 13px; font-weight: 600; }

.todo-month-section { margin-top: 8px; }

/* ── Dashboard pane ── */

.db-greeting-box {
  display: flex; align-items: center; justify-content: space-between;
  background: #111; color: #fff;
  border-radius: var(--radius); padding: 28px 32px; margin-bottom: 20px;
  gap: 24px;
}
.db-greeting-left { display: flex; flex-direction: column; gap: 6px; }
.db-greeting-text { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.db-greeting-sub  { font-size: 14px; color: rgba(255,255,255,0.7); font-weight: 400; }
.db-greeting-date { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 4px; }

.db-weather {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
  background: rgba(255,255,255,0.07); border-radius: var(--radius);
  padding: 14px 20px;
}
.db-weather-temp { font-size: 28px; font-weight: 800; line-height: 1; }
.db-weather-desc { font-size: 13px; color: rgba(255,255,255,0.6); margin-top: 2px; }

.db-bottom-row {
  display: grid; grid-template-columns: 1fr 3fr; gap: 20px; align-items: start;
}

.db-todo-box, .db-metric-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
}
.db-metrics-col { display: flex; flex-direction: column; gap: 20px; }

.db-box-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 14px;
}

.db-todo-list { display: flex; flex-direction: column; gap: 8px; }
.db-todo-event {
  display: flex; align-items: center; gap: 10px;
  border-left: 3px solid; border-radius: 6px; padding: 8px 12px;
}
.db-todo-time  { font-size: 12px; font-weight: 700; flex-shrink: 0; color: var(--text-secondary); }
.db-todo-title { flex: 1; font-size: 13px; font-weight: 600; }
.db-todo-dur   { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.db-todo-empty { font-size: 13px; color: var(--text-muted); padding: 8px 0; }

.db-metric-box { min-height: 100px; }
.db-metric-empty {
  font-size: 28px; font-weight: 700; color: var(--text-muted);
  padding: 8px 0;
}

/* ── Todo / Retainer ── */

.retainer-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.retainer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.retainer-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.retainer-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.brand-circle-md {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.retainer-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.retainer-todos {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.todo-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

.todo-cb {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.todo-label {
  flex: 1;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.3;
  outline: none;
  border-radius: 3px;
  padding: 1px 3px;
  min-width: 0;
  word-break: break-word;
}

.todo-label:focus {
  background: rgba(0,0,0,0.05);
}

.todo-label.todo-done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.todo-del {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.1s, color 0.1s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.todo-row:hover .todo-del {
  opacity: 1;
}

.todo-del:hover {
  color: #e00;
}

.todo-add {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 6px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: 11.5px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s, color 0.15s;
}

.todo-add:hover {
  border-color: #aaa;
  color: var(--text-primary);
}

.todo-divider {
  display: flex; align-items: center; gap: 6px;
  margin: 4px 0; cursor: grab; user-select: none;
}
.todo-divider.dragging { opacity: 0.3; }
.todo-divider-drag { font-size: 13px; color: var(--text-muted); opacity: 0.4; flex-shrink: 0; line-height: 1; }
.todo-divider-line {
  flex: 1; height: 0;
  border-top: 1.5px dashed var(--border);
}
.todo-row { cursor: default; }
.todo-row.dragging { opacity: 0.3; }
.todo-drag-handle {
  font-size: 13px; color: var(--text-muted); opacity: 0.35;
  cursor: grab; flex-shrink: 0; line-height: 1; padding-right: 2px;
  transition: opacity 0.12s;
}
.todo-row:hover .todo-drag-handle { opacity: 0.7; }
.todo-drag-handle:active { cursor: grabbing; }

/* ── Maßnahmen ── */

.massnahmen-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.massnahmen-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.massnahmen-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.massnahmen-card-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.massnahmen-todos {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ── Monthly scroll ── */

.month-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 5 * 12px) / 6);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.month-scroll::-webkit-scrollbar        { height: 4px; }
.month-scroll::-webkit-scrollbar-track  { background: transparent; }
.month-scroll::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 99px; }

.month-card {
  scroll-snap-align: start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.month-card.month-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.month-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.month-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.month-card-year {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.month-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent);
  color: #fff;
  padding: 2px 5px;
  border-radius: 4px;
}

.month-badge-inline {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0,0,0,0.07);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.month-title-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.06);
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 6px;
}

/* ── Inactive sidebar items ── */

.nav-item.nav-inactive .nav-label { color: var(--text-muted); }
.nav-item.nav-inactive .nav-chevron { color: var(--text-muted); }
.nav-item.nav-inactive:hover { background: var(--bg-hover); }

.nav-item.nav-locked { opacity: 0.45; }
.nav-item.nav-locked .nav-label { color: var(--text-muted); }
body:not(.is-admin) .nav-item.nav-locked { cursor: default; }
.nav-lock {
  margin-left: auto;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Settings pane ── */

.settings-section { margin-bottom: 28px; }

.settings-section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.settings-add-btn {
  font-size: 12px; font-weight: 600; color: var(--accent); background: none; border: none;
  cursor: pointer; padding: 0; transition: opacity 0.15s;
}
.settings-add-btn:hover { opacity: 0.7; }
.settings-gear-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--text-muted); display: flex; align-items: center;
  border-radius: var(--radius-sm); transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.settings-gear-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

.settings-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.settings-list { display: flex; flex-direction: column; gap: 4px; }

.settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: default;
  user-select: none;
}
.settings-item.dragging { opacity: 0.4; }

.drag-handle {
  font-size: 16px;
  color: var(--text-muted);
  cursor: grab;
  line-height: 1;
  flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }

.settings-item-link {
  color: var(--text-primary); text-decoration: none; transition: color 0.12s;
}
.settings-item-link:hover { color: var(--accent); text-decoration: underline; }

.settings-item-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Admin pane */
.admin-section { margin-bottom: 28px; }
.admin-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 8px;
}
.admin-info-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.admin-info-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.admin-info-row:last-child { border-bottom: none; }
.admin-info-label { font-size: 12px; color: var(--text-muted); width: 80px; flex-shrink: 0; }
.admin-info-value { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.admin-user-row {
  display: flex; align-items: center; gap: 12px; flex: 1;
}
.admin-user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #111;
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.admin-user-name { font-size: 13px; font-weight: 600; }
.admin-user-role { font-size: 11px; color: var(--text-muted); }
.admin-user-badge {
  margin-left: auto; padding: 2px 10px; border-radius: 99px;
  background: #111; color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em;
}

/* Toggle switch */
.toggle-sw { display: flex; align-items: center; flex-shrink: 0; cursor: pointer; }
.toggle-sw input { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  transition: background 0.18s;
}
.toggle-sw input:checked + .toggle-track { background: var(--accent); }

.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-sw input:checked + .toggle-track .toggle-thumb { transform: translateX(16px); }

/* ── Empty State ── */

.empty-state {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Sidebar Footer ── */

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

/* ── View Dropdown ── */

.view-dropdown {
  position: relative;
}

.view-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
}

.view-dropdown-trigger:hover {
  background: rgba(0,0,0,0.03);
  border-color: #ccc;
}

.view-dropdown-trigger.open {
  border-color: #aaa;
}

.view-dropdown-chevron {
  margin-left: auto;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.view-dropdown-trigger.open .view-dropdown-chevron {
  transform: rotate(180deg);
}

.view-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  padding: 4px;
  z-index: 100;
}

.view-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-align: left;
}

.view-menu-item:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text-primary);
}

.view-menu-item.active {
  background: rgba(0,0,0,0.07);
  color: var(--text-primary);
  font-weight: 600;
}

.view-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

/* ── Sidebar Avatar ── */

.sidebar-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  margin-top: 2px;
  cursor: default;
}

.sidebar-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-avatar-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-avatar-role {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-avatar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sidebar-icon-btn:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text-primary);
}

/* ── Login Overlay ── */
#login-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 130px;
  z-index: 9999;
}
#login-overlay.visible {
  display: flex;
}
#login-box {
  width: 400px;
  max-width: calc(100vw - 48px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
#login-logo {
  width: 220px;
  margin: 0 auto 28px;
  display: block;
}
#login-box input {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 20px;
  border: 1px solid #484848;
  border-radius: 12px;
  background: #242424;
  color: #ececec;
  font-size: 1rem;
}
#login-box input::placeholder { color: #777; }
#login-box input:focus { outline: none; border-color: #666; }
#login-btn {
  width: 100%;
  padding: 16px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  letter-spacing: 0.01em;
}
#login-btn:hover { background: #e8e8e8; }
#login-btn:disabled { opacity: 0.4; cursor: default; }
#login-forgot {
  text-align: center;
  margin-top: 4px;
}
#login-forgot a {
  color: #7e7e7e;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
#login-forgot a:hover { color: #aaa; }
#login-error { color: #e74c3c; font-size: 0.82rem; min-height: 18px; margin: 0; text-align: center; }

/* ── Set password overlay (password reset flow) ── */
#set-pw-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 130px;
  z-index: 9999;
}
#set-pw-box {
  width: 400px;
  max-width: calc(100vw - 48px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
#set-pw-box img { width: 220px; margin: 0 auto 28px; display: block; }
#set-pw-box input {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 20px;
  border: 1px solid #383838;
  border-radius: 12px;
  background: #1c1c1c;
  color: #e0e0e0;
  font-size: 1rem;
}
#set-pw-box input::placeholder { color: #666; }
#set-pw-box input:focus { outline: none; border-color: #555; }
#set-pw-btn {
  width: 100%;
  padding: 16px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}
#set-pw-btn:hover { background: #e8e8e8; }
#set-pw-btn:disabled { opacity: 0.4; cursor: default; }
#set-pw-error { color: #e74c3c; font-size: 0.82rem; min-height: 18px; margin: 0; text-align: center; }

#login-footer {
  position: fixed;
  bottom: 32px;
  left: 0; right: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 0 24px;
}
#login-overlay.visible #login-footer { display: flex; }
#login-footer-text {
  color: #aaa;
  font-size: 0.87rem;
  line-height: 1.5;
  max-width: 420px;
}
#login-footer-links {
  display: flex;
  gap: 20px;
  align-items: center;
}
#login-footer-links a {
  color: #999;
  font-size: 0.84rem;
  text-decoration: none;
}
#login-footer-links a:hover { color: #ccc; text-decoration: underline; }
#login-footer-sep {
  color: #555;
  font-size: 0.84rem;
}

/* ── Erledigungen ── */

.erl-section { margin-bottom: 32px; }
.erl-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 10px;
}
.erl-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-height: 40px; }
.erl-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; user-select: none;
}
.erl-item.dragging { opacity: 0.35; }
.erl-item.erl-done { background: rgba(24,185,106,0.04); border-color: rgba(24,185,106,0.2); }

.erl-check {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border);
  background: none; cursor: pointer; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; transition: border-color 0.15s, background 0.15s;
  padding: 0;
}
.erl-check:hover { border-color: #18B96A; }
.erl-check.erl-check-on { background: #18B96A; border-color: #18B96A; }

.erl-item-text {
  flex: 1; font-size: 13px; outline: none; min-width: 0;
  border-bottom: 1px solid transparent; transition: border-color 0.12s, color 0.15s;
}
.erl-item-text:focus { border-bottom-color: var(--accent); }
.erl-text-done { text-decoration: line-through; color: #18B96A; opacity: 0.7; }

.erl-sessions-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.erl-session-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.erl-card-title {
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.erl-session-card .erl-list { min-height: 32px; }
.erl-session-card .erl-add-row { margin-top: auto; }

.erl-done-section { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--border); }
.erl-done-title { color: #18B96A !important; }
.erl-done-section .erl-item { cursor: default; }
.erl-done-section .drag-handle { display: none; }
.erl-item-del {
  background: none; border: none; cursor: pointer; font-size: 15px;
  color: var(--text-muted); padding: 0 2px; flex-shrink: 0; line-height: 1;
  transition: color 0.12s;
}
.erl-item-del:hover { color: #E8401C; }
.erl-add-row { display: flex; gap: 8px; }
.erl-add-input {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 12px; font-size: 13px; outline: none; background: var(--bg);
  transition: border-color 0.15s;
}
.erl-add-input:focus { border-color: var(--accent); }
.erl-add-btn {
  padding: 7px 14px; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); font-size: 16px; font-weight: 700;
  cursor: pointer; transition: opacity 0.15s;
}
.erl-add-btn:hover { opacity: 0.8; }

/* ── Roadmap ── */

.rm-heading { font-size: 20px; font-weight: 800; color: var(--text-primary); margin-bottom: 14px; }
.rm-section-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.04em; margin-bottom: 8px; }
.rm-goals-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.rm-goal-row { display: flex; align-items: center; gap: 10px; padding: 2px 0; }
.rm-goal-icon { color: #e74c3c; flex-shrink: 0; }
.rm-goal-text { font-size: 15px; font-weight: 600; color: #155d36; flex: 1; cursor: text; }
.rm-goal-del {
  background: none; border: none; cursor: pointer; font-size: 14px; color: var(--text-muted);
  opacity: 0; padding: 0 2px; line-height: 1; transition: opacity 0.12s;
}
.rm-goal-row:hover .rm-goal-del { opacity: 0.4; }
.rm-goal-del:hover { opacity: 1 !important; color: #e74c3c; }
.rm-goal-add-row { display: flex; flex-direction: column; gap: 6px; min-height: 24px; }
.rm-goal-add-btn {
  align-self: flex-start; background: none; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--text-muted); padding: 0;
  opacity: 0; transition: opacity 0.12s;
}
.rm-goal-add-row:hover .rm-goal-add-btn { opacity: 1; }
.rm-goal-add-btn:hover { color: #155d36; }
.rm-goal-input {
  border: 1px solid #18B96A; border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 14px; outline: none; background: #fff;
  color: #155d36; font-weight: 600; width: 100%; max-width: 480px;
}

.rm-modules {
  display: flex; gap: 10px; flex-wrap: wrap; width: 70%; margin-bottom: 24px;
}
.rm-module {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
}
.rm-module-active {
  background: #eaf7f0; border-color: #b6e8c8; color: #155d36;
}
.rm-module-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--border); flex-shrink: 0;
}
.rm-module-active .rm-module-dot { background: #18B96A; }

.rm-modules-note { font-size: 12px; color: var(--text-muted); margin-top: 6px; margin-bottom: 0; }

.rm-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rm-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  min-height: 280px; padding: 20px; display: flex; flex-direction: column; gap: 0;
}
.rm-box-header { margin-bottom: 14px; }
.rm-box-title { font-size: 15px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.01em; }

.rm-doc-month-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rm-doc-month-label { font-size: 11px; font-weight: 700; color: var(--text-muted); white-space: nowrap; letter-spacing: 0.04em; }
.rm-doc-month-line { flex: 1; height: 1px; background: var(--border); }

.rm-doc-list { display: flex; flex-direction: column; }
.rm-doc-item { display: flex; align-items: stretch; gap: 0; cursor: default; }
.rm-doc-item.rm-dragging { opacity: 0.35; }

.rm-doc-timeline {
  display: flex; flex-direction: column; align-items: center;
  width: 28px; flex-shrink: 0;
}
.rm-doc-half-line { width: 2px; flex: 1; min-height: 10px; background: var(--border); }
.rm-doc-half-line.rm-line-green { background: #18B96A; }
.rm-doc-half-line.rm-line-hidden { background: transparent; }

.rm-doc-circle {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.rm-doc-circle:hover { border-color: #18B96A; }
.rm-doc-circle-done { background: #18B96A; border-color: #18B96A; }

.rm-doc-content {
  display: flex; align-items: center; gap: 6px;
  flex: 1; padding: 6px 0 6px 10px; min-height: 36px;
}
.rm-doc-text { flex: 1; font-size: 13px; color: var(--text-primary); cursor: text; line-height: 1.4; }
.rm-doc-text-done { text-decoration: line-through; color: var(--text-muted); }
.rm-doc-drag { font-size: 13px; color: var(--text-muted); opacity: 0.3; cursor: grab; flex-shrink: 0; }
.rm-doc-item:hover .rm-doc-drag { opacity: 0.7; }
.rm-doc-del {
  background: none; border: none; cursor: pointer; font-size: 14px; color: var(--text-muted);
  opacity: 0; padding: 0 2px; flex-shrink: 0; transition: opacity 0.12s;
}
.rm-doc-item:hover .rm-doc-del { opacity: 0.4; }
.rm-doc-del:hover { opacity: 1 !important; color: #e74c3c; }
.rm-doc-input {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 3px 7px; font-size: 13px; outline: none; background: var(--bg);
}
.rm-doc-input:focus { border-color: var(--accent); }

.rm-doc-add-row { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.rm-doc-add-btn {
  align-self: flex-start; background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--text-muted); padding: 0; opacity: 0;
  transition: opacity 0.12s; margin-left: 4px;
}
.rm-doc-add-row:hover .rm-doc-add-btn { opacity: 1; }
.rm-doc-add-btn:hover { color: #18B96A; }
.rm-drag-over { background: var(--bg-hover); border-radius: var(--radius-sm); }


.rm-backlog-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted);
  flex-shrink: 0; margin: 10px 10px 0 4px; opacity: 0.4; align-self: flex-start;
}

/* Baustein block */
.rm-block { display: flex; align-items: stretch; gap: 0; }
.rm-block.rm-dragging { opacity: 0.3; }
.rm-block.rm-drag-over { background: var(--bg-hover); border-radius: var(--radius-sm); }
.rm-block-circle {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.rm-block-circle.rm-doc-circle-done { background: #18B96A; border-color: #18B96A; }
.rm-block-body { flex: 1; padding: 4px 0 4px 10px; }
.rm-block-header {
  display: flex; align-items: center; gap: 6px; min-height: 30px;
}
.rm-block-toggle {
  background: none; border: none; cursor: pointer; font-size: 9px;
  color: var(--text-muted); padding: 0 2px; flex-shrink: 0; line-height: 1;
}
.rm-block-title {
  flex: 1; font-size: 13px; font-weight: 600; color: var(--text-primary); cursor: text;
}
.rm-block-title.rm-doc-text-done { text-decoration: line-through; color: var(--text-muted); }
.rm-block-progress {
  font-size: 11px; color: var(--text-muted); background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: 10px; padding: 1px 6px; flex-shrink: 0;
}
.rm-block-done .rm-block-progress { color: #18B96A; border-color: #b6e8c8; background: #eaf7f0; }
.rm-block-del {
  background: none; border: none; cursor: pointer; font-size: 14px;
  color: var(--text-muted); opacity: 0; padding: 0 2px; flex-shrink: 0; transition: opacity 0.12s;
}
.rm-block:hover .rm-block-del { opacity: 0.4; }
.rm-block-del:hover { opacity: 1 !important; color: #e74c3c; }

/* Subtodos */
.rm-block-subtodos { padding: 4px 0 4px 4px; display: flex; flex-direction: column; gap: 2px; }
.rm-subtodo { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.rm-subtodo-circle {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: border-color 0.12s;
}
.rm-subtodo-circle:hover { border-color: #18B96A; }
.rm-subtodo-circle.rm-subtodo-done { border-color: #18B96A; background: #eaf7f0; }
.rm-subtodo-text { flex: 1; font-size: 12px; color: var(--text-primary); cursor: text; }
.rm-subtodo-del {
  background: none; border: none; cursor: pointer; font-size: 12px;
  color: var(--text-muted); opacity: 0; padding: 0 2px; flex-shrink: 0; transition: opacity 0.12s;
}
.rm-subtodo:hover .rm-subtodo-del { opacity: 0.4; }
.rm-subtodo-del:hover { opacity: 1 !important; color: #e74c3c; }
.rm-subtodo-add-row { padding-top: 2px; }
.rm-subtodo-add-btn {
  background: none; border: none; cursor: pointer; font-size: 11px;
  color: var(--text-muted); padding: 2px 0;
}
.rm-subtodo-add-btn:hover { color: #18B96A; }

.rm-doc-add-row .rm-block-add-btn {
  background: none; border: none; cursor: pointer; font-size: 12px;
  color: var(--text-muted); padding: 4px 0; opacity: 0; transition: opacity 0.12s;
}
.rm-doc-add-row:hover .rm-block-add-btn { opacity: 1; }
.rm-block-add-btn:hover { color: var(--accent); }

/* ── Firmendaten ── */

.fd-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.fd-subtitle { font-size: 12px; color: var(--text-muted); }
.fd-edit-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; color: var(--text-primary);
  transition: background 0.12s;
}
.fd-edit-btn:hover { background: var(--bg-hover); }
.fd-section {
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
}
.fd-section-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: var(--bg-secondary);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.fd-address-block { padding: 14px 16px 8px; line-height: 1.7; font-size: 14px; border-bottom: 1px solid var(--border); }
.fd-row {
  display: grid; grid-template-columns: 220px 1fr;
  padding: 9px 16px; font-size: 13px; border-bottom: 1px solid var(--border);
}
.fd-row:last-child { border-bottom: none; }
.fd-row-label { color: var(--text-muted); }
.fd-row-value { color: var(--text-primary); }

.fd-form { display: flex; flex-direction: column; gap: 12px; }
.fd-form-section { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fd-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.fd-form-field { display: flex; flex-direction: column; gap: 4px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.fd-form-field:nth-last-child(-n+2) { border-bottom: none; }
.fd-form-field.full { grid-column: 1 / -1; }
.fd-form-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.04em; }
.fd-form-input {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 10px; font-size: 13px; outline: none; background: var(--bg);
  color: var(--text-primary); transition: border-color 0.15s;
}
.fd-form-input:focus { border-color: var(--accent); }
.fd-form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.fd-save-btn { padding: 8px 18px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; }
.fd-save-btn:hover { opacity: 0.85; }
.fd-cancel-btn { padding: 8px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; color: var(--text-primary); }
.fd-cancel-btn:hover { background: var(--bg-hover); }

/* ── Wunschkunden ── */

.wk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wk-box {
  border-radius: var(--radius); border: 1.5px solid; overflow: hidden;
}
.wk-box-wunsch { border-color: #b6e8c8; background: #f2fbf5; }
.wk-box-anti   { border-color: #f0b8b8; background: #fdf4f4; }

.wk-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-bottom: 1.5px solid;
}
.wk-box-wunsch .wk-header { border-color: #b6e8c8; }
.wk-box-anti   .wk-header { border-color: #f0b8b8; }

.wk-avatar {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.wk-header-info { flex: 1; }
.wk-header-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.wk-header-role { font-size: 12px; margin-top: 2px; }
.wk-box-wunsch .wk-header-role { color: #1a9952; }
.wk-box-anti   .wk-header-role { color: #c0392b; }

.wk-icon-circle {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wk-icon-circle-green { background: #18B96A; }
.wk-icon-circle-red   { background: #e74c3c; }

.wk-fields { padding: 4px 0; }
.wk-field-row {
  display: grid; grid-template-columns: 160px 1fr;
  padding: 8px 18px; font-size: 13px; border-bottom: 1px solid;
  align-items: center;
}
.wk-box-wunsch .wk-field-row { border-color: #d4f0e0; }
.wk-box-anti   .wk-field-row { border-color: #f5d0d0; }
.wk-field-row:last-child { border-bottom: none; }
.wk-field-label { color: var(--text-muted); font-size: 12px; }
.wk-field-value { color: var(--text-primary); }

.wk-footer { display: flex; justify-content: flex-end; padding: 10px 18px; border-top: 1px solid; }
.wk-box-wunsch .wk-footer { border-color: #b6e8c8; }
.wk-box-anti   .wk-footer { border-color: #f0b8b8; }
.wk-edit-btn {
  padding: 6px 13px; font-size: 12px; border-radius: var(--radius-sm);
  border: 1.5px solid; cursor: pointer; background: transparent;
  display: flex; align-items: center; gap: 5px; transition: opacity 0.12s;
}
.wk-box-wunsch .wk-edit-btn { border-color: #18B96A; color: #1a9952; }
.wk-box-anti   .wk-edit-btn { border-color: #e74c3c; color: #c0392b; }
.wk-edit-btn:hover { opacity: 0.7; }

.wk-form { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.wk-form-field { display: flex; flex-direction: column; gap: 3px; }
.wk-form-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.04em; }
.wk-form-input {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 13px; outline: none;
  background: var(--bg); color: var(--text-primary); transition: border-color 0.15s;
}
.wk-box-wunsch .wk-form-input:focus { border-color: #18B96A; }
.wk-box-anti   .wk-form-input:focus { border-color: #e74c3c; }
.wk-form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.wk-save-btn-green { padding: 7px 16px; background: #18B96A; color: #fff; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; }
.wk-save-btn-red   { padding: 7px 16px; background: #e74c3c; color: #fff; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; }
.wk-save-btn-green:hover, .wk-save-btn-red:hover { opacity: 0.85; }
.wk-cancel-btn { padding: 7px 14px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; color: var(--text-primary); }
.wk-cancel-btn:hover { background: var(--bg-hover); }


/* ── Notizen ── */

.nz-table {
  border-collapse: collapse; width: 100%; font-size: 13px;
  table-layout: fixed;
}
.nz-col-head {
  background: var(--bg-secondary); border: 1px solid var(--border);
  padding: 5px 8px; font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-align: center; letter-spacing: 0.06em; width: calc((100% - 40px) / 5);
  user-select: none;
}
.nz-row-num {
  width: 40px; background: var(--bg-secondary); border: 1px solid var(--border);
  padding: 0 6px; font-size: 11px; color: var(--text-muted); text-align: right;
  user-select: none; vertical-align: middle;
}
.nz-cell {
  border: 1px solid var(--border); padding: 0; vertical-align: top;
  height: 28px;
}
.nz-cell:focus-within { border-color: #1877F2; box-shadow: inset 0 0 0 1px #1877F2; z-index: 1; position: relative; }
.nz-cell-inner {
  width: 100%; height: 100%; min-height: 28px; padding: 4px 6px;
  outline: none; white-space: pre-wrap; word-break: break-word;
  color: var(--text-primary); line-height: 1.4;
}

/* ── Prozess ── */

.prozess-mod-cards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.prozess-mod-card {
  background: #111;
  color: #fff;
  border-radius: 10px;
  padding: 16px 18px;
  min-width: 180px;
  max-width: 260px;
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prozess-mod-card-name {
  font-size: 15px;
  font-weight: 600;
  outline: none;
  border-bottom: 1px solid transparent;
}
.prozess-mod-card-name:focus { border-bottom-color: rgba(255,255,255,0.3); }

.prozess-mod-card-desc,
.prozess-mod-card-price {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  outline: none;
  border-bottom: 1px solid transparent;
}
.prozess-mod-card-desc:focus,
.prozess-mod-card-price:focus { border-bottom-color: rgba(255,255,255,0.3); color: #fff; }

.prozess-mod-card-price {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  margin-top: 4px;
}

[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: rgba(255,255,255,0.3);
  pointer-events: none;
}

.prozess-toolbar {
  margin-bottom: 20px;
}

.btn-add-module {
  padding: 7px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-add-module:hover { opacity: 0.8; }

.prozess-module-section {
  margin-bottom: 24px;
}

.prozess-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.prozess-gesamt-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.module-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.module-name-el {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  border-radius: 3px;
  padding: 1px 4px;
  min-width: 60px;
}
.module-name-el:focus { background: rgba(0,0,0,0.05); }

.module-del-btn {
  margin-left: auto;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.module-del-btn:hover { color: #e00; border-color: #e00; }

/* Board grid — 6 columns visible */
.prozess-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 5px) / 6);
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  scroll-snap-type: x mandatory;
}
.prozess-board::-webkit-scrollbar       { height: 4px; }
.prozess-board::-webkit-scrollbar-track { background: transparent; }
.prozess-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.prozess-col {
  scroll-snap-align: start;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 80px;
}
.prozess-col:last-child { border-right: none; }

.prozess-col-head {
  padding: 7px 10px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.prozess-col-body {
  padding: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Gesamtprozess items */
.gesamt-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.gesamt-mod-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 2px;
  letter-spacing: 0.04em;
}

.gesamt-item {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 1px 4px;
  word-break: break-word;
}

/* Module board items */
.prozess-item-row {
  display: flex;
  align-items: flex-start;
  gap: 3px;
}

.prozess-item-txt {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  outline: none;
  border-radius: 3px;
  padding: 2px 4px;
  word-break: break-word;
  line-height: 1.4;
  min-height: 20px;
}
.prozess-item-txt:focus { background: rgba(0,0,0,0.05); }

.prozess-item-del {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  border-radius: 3px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
}
.prozess-item-row:hover .prozess-item-del { opacity: 1; }
.prozess-item-del:hover { color: #e00; }

.prozess-add-item {
  align-self: flex-start;
  margin-top: 4px;
  width: 20px;
  height: 20px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}
.prozess-add-item:hover { border-color: #aaa; color: var(--text-primary); }

/* ── Zugänge ── */

.zg-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.zg-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.zg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}

.zg-info { flex: 1; min-width: 0; }
.zg-name { font-weight: 600; font-size: .95rem; }
.zg-email { color: var(--text-muted); font-size: .8rem; margin-top: 2px; }

.zg-brands {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  align-items: center;
}

.zg-brand-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
}

.zg-badge-admin { font-size: .78rem; color: #18B96A; font-weight: 600; }

.zg-edit-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  font-size: .83rem;
  white-space: nowrap;
  color: var(--text-primary);
}
.zg-edit-btn:hover { background: var(--bg-secondary); border-color: #aaa; }

.zg-add-btn {
  padding: 9px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
}
.zg-add-btn:hover { opacity: .88; }

/* ── Scrollbar ── */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
