@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* ---- Heyde brand tokens ---- */
  --heyde-purple-900: #2E1748;
  --heyde-purple-800: #41216A;
  --heyde-purple-700: #4A2578;
  --heyde-purple:     #582F89;
  --heyde-purple-500: #6F45A0;
  --heyde-purple-400: #9B88BD;
  --heyde-purple-200: #C9BEDD;
  --heyde-purple-100: #E7E0F0;
  --heyde-purple-50:  #F4F1F9;

  --heyde-ink:    #2B2C2E;
  --heyde-gray:   #57595B;
  --heyde-gray-500: #656565;
  --heyde-gray-400: #767676;
  --heyde-gray-300: #C7C8CA;
  --heyde-gray-200: #D3D4D7;
  --heyde-gray-100: #EEEEF0;
  --heyde-gray-50:  #F7F7F8;
  --heyde-white:  #FFFFFF;

  --heyde-orange: #E86B24;
  --heyde-orange-hover: #D55D18;
  --heyde-green:  #5A9F2F;
  --heyde-green-soft:  #EAF3E2;
  --heyde-teal:   #249BBA;
  --heyde-red: #C0392B;
  --heyde-red-soft: #FBEAE8;

  --heyde-gradient: linear-gradient(115deg, #41216A 0%, #582F89 45%, #9B88BD 100%);

  /* billable / non-billable */
  --billable-bg: #EAF3E2;
  --billable-border: #CDE4BB;
  --nonbillable-bg: #FFFFFF;
  --nonbillable-border: #D3D4D7;

  --text-strong:  var(--heyde-ink);
  --text-body:    var(--heyde-gray);
  --text-muted:   var(--heyde-gray-400);
  --text-brand:   var(--heyde-purple);

  --border-subtle: var(--heyde-gray-200);
  --border-brand:  var(--heyde-purple-200);

  --accent-primary: var(--heyde-purple);
  --accent-hover:   var(--heyde-purple-700);
  --accent-active:  var(--heyde-purple-800);
  --accent-cta:     var(--heyde-orange);

  --font-display: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono:    "DM Sans", ui-monospace, monospace;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(43, 24, 72, 0.07);
  --shadow-sm: 0 3px 8px rgba(43, 24, 72, 0.12), 0 1px 3px rgba(43, 24, 72, 0.07);
  --shadow-md: 0 6px 18px rgba(43, 24, 72, 0.10);
  --shadow-lg: 0 16px 40px rgba(43, 24, 72, 0.14);

  --ease-standard: cubic-bezier(0.4, 0.0, 0.2, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;

  --sidebar-w: 232px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--heyde-gray-50);
  font-family: var(--font-body);
  color: var(--text-body);
  overflow: hidden;
}

body { display: flex; flex-direction: column; }

/* ---------------- Custom titlebar (frameless window) ---------------- */

.titlebar {
  flex: none;
  height: 34px;
  background: var(--heyde-purple-900);
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-app-region: drag;
  user-select: none;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  color: rgba(255,255,255,0.68);
  font-size: 0.75rem;
  font-weight: 500;
}

.titlebar-icon { width: 15px; height: 15px; flex: none; }

.window-controls {
  display: flex;
  align-items: stretch;
  height: 100%;
  -webkit-app-region: no-drag;
}

.window-controls button {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.65);
  width: 46px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}

.window-controls button svg { width: 10px; height: 10px; }

.window-controls button:hover { background: rgba(255,255,255,0.12); color: var(--heyde-white); }
.window-controls button.win-close:hover { background: #E81123; color: var(--heyde-white); }

/* ---------------- App body (sidebar + main, below titlebar) ---------------- */

.app-body {
  flex: 1;
  min-height: 0;
  display: flex;
}

/* ---------------- Sidebar ---------------- */

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--heyde-purple-900);
  background-image: linear-gradient(180deg, var(--heyde-purple-900) 0%, #24123B 100%);
  color: var(--heyde-white);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  height: 100%;
}

.sidebar * { -webkit-app-region: no-drag; }

.sidebar .logo-wrap {
  padding: 4px 8px 24px;
}

.sidebar .logo-wrap img {
  height: 22px;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.72);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
  user-select: none;
}

.nav-item .icon { width: 17px; height: 17px; flex: none; }

.nav-item:hover { background: rgba(255,255,255,0.08); color: var(--heyde-white); }

.nav-item.active {
  background: rgba(255,255,255,0.14);
  color: var(--heyde-white);
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}

.sidebar-user-block:hover { background: rgba(255,255,255,0.08); }
.sidebar-user-block:hover .sidebar-user-gear { opacity: 1; }

.sidebar-user-gear {
  margin-left: auto;
  color: rgba(255,255,255,0.55);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-standard);
  flex: none;
}

.sidebar-status {
  padding: 14px 12px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.sidebar-status .ss-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}

.sidebar-status .ss-timer {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.375rem;
  color: var(--heyde-white);
}

.sidebar-status .ss-sub {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
}

.sidebar-status .ss-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--heyde-gray-300);
  margin-right: 6px;
}
.sidebar-status.running .ss-dot { background: #8FD65C; box-shadow: 0 0 0 0 rgba(143,214,92,.6); animation: pulse 1.6s infinite; }
.sidebar-status.paused .ss-dot { background: var(--heyde-orange); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(143,214,92,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(143,214,92,0); }
  100% { box-shadow: 0 0 0 0 rgba(143,214,92,0); }
}

/* ---------------- Main area ---------------- */

.main {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 32px 40px 60px;
}

.view { display: none; max-width: 1120px; margin: 0 auto; }
.view.active { display: block; }

.page-head { margin-bottom: 24px; }

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--heyde-purple);
  margin: 0 0 6px;
}

h1.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  margin: 0;
}

.page-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 6px 0 0;
}

.card {
  background: var(--heyde-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 28px 26px;
  margin-bottom: 20px;
  position: relative;
}

.card.accent::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--heyde-gradient);
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text-strong);
  margin: 0 0 4px;
}

.card .card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 18px;
}

/* Stat cards */
.stat-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 1100px) {
  .stat-row { grid-template-columns: repeat(3, 1fr); }
}

.stat-card {
  background: var(--heyde-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}

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

.stat-card .stat-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-strong);
}

.stat-card.positive .stat-value { color: var(--heyde-green); }
.stat-card.negative .stat-value { color: var(--heyde-red); }
.stat-card.brand .stat-value { color: var(--heyde-purple); }

/* Forms */

.field-row {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 6px;
}

.field input, .field select, .field textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--heyde-gray-300);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-strong);
  background: var(--heyde-white);
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}

.field select { cursor: pointer; }

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--heyde-purple-400);
  box-shadow: 0 0 0 3px rgba(155, 136, 189, 0.35);
}

.field.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  margin-top: auto;
}

.field.checkbox-field input {
  width: 18px; height: 18px; padding: 0; accent-color: var(--heyde-purple);
}

.field.checkbox-field label { margin: 0; font-weight: 500; }

/* Buttons */

button.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  height: 44px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  transition: background var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              opacity var(--duration-base) var(--ease-standard);
}

button.btn:active:not(:disabled) { transform: translateY(1px); }
button.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent-primary);
  color: var(--heyde-white);
  border: 1px solid var(--accent-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: var(--shadow-sm); }

.btn-secondary {
  background: var(--heyde-white);
  color: var(--heyde-purple);
  border: 1px solid var(--border-brand);
}
.btn-secondary:hover:not(:disabled) { background: var(--heyde-purple-50); box-shadow: var(--shadow-sm); }

.btn-cta {
  background: var(--accent-cta);
  color: var(--heyde-white);
  border: 1px solid var(--accent-cta);
}
.btn-cta:hover:not(:disabled) { background: var(--heyde-orange-hover); border-color: var(--heyde-orange-hover); box-shadow: var(--shadow-sm); }

.btn-ghost {
  background: transparent;
  color: var(--heyde-purple);
  border: 1px solid transparent;
  height: 36px;
  padding: 0 12px;
  font-size: 0.8125rem;
}
.btn-ghost:hover:not(:disabled) { background: var(--heyde-purple-50); }

.btn-danger {
  background: var(--heyde-white);
  color: var(--heyde-red);
  border: 1px solid #F0C6C0;
  height: 36px;
  padding: 0 12px;
  font-size: 0.8125rem;
}
.btn-danger:hover:not(:disabled) { background: var(--heyde-red-soft); }

.btn-sm { height: 34px; padding: 0 14px; font-size: 0.8125rem; }
.icon { width: 16px; height: 16px; flex: none; }

.button-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Tracker view */

.tracker-controls {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr;
  gap: 14px;
  margin-bottom: 20px;
}

.timer-display {
  text-align: center;
  padding: 8px 0 26px;
}

.timer-display .timer {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 3.25rem;
  color: var(--text-strong);
  line-height: 1.1;
}

.timer-display .timer-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--heyde-gray-100);
  color: var(--text-muted);
  margin-bottom: 14px;
}

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--heyde-gray-300); }
.status-badge.running { background: var(--heyde-green-soft); color: #3F7A1F; }
.status-badge.running .status-dot { background: var(--heyde-green); }
.status-badge.paused { background: #FCEDE3; color: #A6501A; }
.status-badge.paused .status-dot { background: var(--heyde-orange); }

.tracker-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* Tables */

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table.data-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

table.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--heyde-gray-100);
  color: var(--text-body);
  vertical-align: middle;
}

table.data-table tr.row-billable td { background: var(--billable-bg); }
table.data-table tr.row-nonbillable td { background: var(--nonbillable-bg); }
table.data-table tr.row-billable td:first-child { border-left: 3px solid var(--heyde-green); }
table.data-table tr.row-nonbillable td:first-child { border-left: 3px solid transparent; }

table.data-table tr.total-row td {
  font-weight: 700;
  color: var(--text-strong);
  border-top: 2px solid var(--border-subtle);
  border-bottom: none;
  background: var(--heyde-gray-50);
}

table.data-table td.num { font-variant-numeric: tabular-nums; text-align: right; }
table.data-table td.over-pos { color: var(--heyde-green); font-weight: 600; }
table.data-table td.over-neg { color: var(--heyde-red); font-weight: 600; }

.legend-row { display: flex; gap: 18px; margin: 4px 0 18px; font-size: 0.8125rem; color: var(--text-muted); }
.legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend-swatch.billable { background: var(--billable-bg); border: 1px solid var(--billable-border); }
.legend-swatch.nonbillable { background: var(--nonbillable-bg); border: 1px solid var(--nonbillable-border); }

.filter-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-row .field { min-width: 160px; margin: 0; }

.empty-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
}

.divider { height: 1px; background: var(--border-subtle); margin: 24px 0; }

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* Master data list rows */

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.list-row .lr-main { display: flex; flex-direction: column; gap: 2px; }
.list-row .lr-name { font-weight: 600; color: var(--text-strong); font-size: 0.9375rem; }
.list-row .lr-sub { font-size: 0.75rem; color: var(--text-muted); }
.list-row .lr-actions { display: flex; gap: 8px; align-items: center; }

.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
}
.badge-pill.billable { background: var(--billable-bg); color: #3F7A1F; }
.badge-pill.nonbillable { background: var(--heyde-gray-100); color: var(--text-muted); }

.toast {
  position: fixed;
  bottom: 24px;
  right: 32px;
  background: var(--heyde-ink);
  color: var(--heyde-white);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard);
  z-index: 50;
}
.toast.visible { opacity: 1; transform: translateY(0); }

/* Weekly grid (Vertec-style) */

table.data-table th.today-col, table.data-table td.today-col,
table.data-table tr.today-col td {
  background: var(--heyde-purple-50);
}

/* Wochenübersicht: Excel-artig direkt bearbeitbare Zellen */
table.data-table td.week-cell-editable {
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
table.data-table td.week-cell-editable:hover {
  background: var(--heyde-purple-100);
  box-shadow: inset 0 0 0 1px var(--heyde-purple-400);
}
.week-cell-input {
  width: 100%;
  height: 26px;
  border: 1px solid var(--heyde-purple-400);
  border-radius: 4px;
  padding: 0 6px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  box-shadow: 0 0 0 2px rgba(155, 136, 189, 0.3);
}

table.data-table th.week-total-col, table.data-table td.week-total-col {
  border-left: 2px solid var(--border-subtle);
  font-weight: 700;
}

table.data-table tr.foot-soll td { color: var(--text-muted); font-size: 0.8125rem; border-bottom: none; background: var(--heyde-gray-50); }
table.data-table tr.foot-diff td { font-weight: 700; border-top: none; background: var(--heyde-gray-50); }
table.data-table tr.foot-diff td.over-pos { color: var(--heyde-green); }
table.data-table tr.foot-diff td.over-neg { color: var(--heyde-red); }

/* Asana task list + sidebar avatar */

.demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--heyde-gray-100);
  color: var(--text-muted);
  margin-left: 8px;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--heyde-white);
  font-weight: 700;
  font-size: 0.8125rem;
  flex: none;
}

@media (max-width: 900px) {
  .tracker-controls { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}

/* ---------------- Kategorien (verrechenbar / anrechenbar / travel / intern) ---------------- */

:root {
  --kat-verrechenbar-bg: var(--billable-bg);
  --kat-verrechenbar-border: var(--billable-border);
  --kat-verrechenbar-accent: var(--heyde-green);
  --kat-anrechenbar-bg: #E5F4F7;
  --kat-anrechenbar-border: #BEE2E9;
  --kat-anrechenbar-accent: var(--heyde-teal);
  --kat-travel-bg: #FCEDE3;
  --kat-travel-border: #F4CDAE;
  --kat-travel-accent: var(--heyde-orange);
  --kat-intern-bg: var(--nonbillable-bg);
  --kat-intern-border: var(--nonbillable-border);
  --kat-intern-accent: var(--heyde-gray-300);
}

table.data-table tr.row-verrechenbar td { background: var(--kat-verrechenbar-bg); }
table.data-table tr.row-anrechenbar td { background: var(--kat-anrechenbar-bg); }
table.data-table tr.row-travel td { background: var(--kat-travel-bg); }
table.data-table tr.row-intern td { background: var(--kat-intern-bg); }

table.data-table tr.row-verrechenbar td:first-child { border-left: 3px solid var(--kat-verrechenbar-accent); }
table.data-table tr.row-anrechenbar td:first-child { border-left: 3px solid var(--kat-anrechenbar-accent); }
table.data-table tr.row-travel td:first-child { border-left: 3px solid var(--kat-travel-accent); }
table.data-table tr.row-intern td:first-child { border-left: 3px solid transparent; }

.legend-swatch.verrechenbar { background: var(--kat-verrechenbar-bg); border: 1px solid var(--kat-verrechenbar-border); }
.legend-swatch.anrechenbar { background: var(--kat-anrechenbar-bg); border: 1px solid var(--kat-anrechenbar-border); }
.legend-swatch.travel { background: var(--kat-travel-bg); border: 1px solid var(--kat-travel-border); }
.legend-swatch.intern { background: var(--kat-intern-bg); border: 1px solid var(--kat-intern-border); }
.legend-swatch.chart-over { background: var(--heyde-green); border: 1px solid var(--heyde-green); }
.legend-swatch.chart-under { background: var(--heyde-gray-300); border: 1px solid var(--heyde-gray-300); }
.legend-swatch.chart-soll { background: var(--heyde-ink); border: 1px solid var(--heyde-ink); height: 3px; margin-bottom: 4px; }

.badge-pill.anrechenbar { background: var(--kat-anrechenbar-bg); color: #146A80; }
.badge-pill.travel { background: var(--kat-travel-bg); color: #A6501A; }
.badge-pill.intern { background: var(--heyde-gray-100); color: var(--text-muted); }

.btn-icon-danger {
  appearance: none;
  border: 1px solid #F0C6C0;
  background: var(--heyde-white);
  color: var(--heyde-red);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  line-height: 1;
}
.btn-icon-danger:hover { background: var(--heyde-red-soft); }

/* ---------------- Modal (Einstellungen) ---------------- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(24, 12, 40, 0.45);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal-panel {
  background: var(--heyde-gray-50);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 900px;
  width: 100%;
  padding: 32px 36px 40px;
  margin: 0 auto;
  max-height: none;
}

.modal-panel.view { display: block; }

/* ---------------- Code quick-entry / manual entry forms ---------------- */

.code-entry-row {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 18px;
}

.manual-entry-row {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1100px) {
  .manual-entry-row { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- Day chart (Ist vs. Soll) ---------------- */

#dayChartWrap { width: 100%; overflow-x: auto; }
#dayChart .bar-ist { transition: opacity var(--duration-fast) var(--ease-standard); }
#dayChart .bar-ist:hover { opacity: 0.85; }
#dayChart text { font-family: var(--font-body); fill: var(--text-muted); font-size: 11px; }
#dayChart .soll-tick { stroke: var(--heyde-ink); stroke-width: 2; }
#dayChart .grid-line { stroke: var(--heyde-gray-100); stroke-width: 1; }

/* ---------------- Zielerreichung ---------------- */

.ze-progress-track {
  width: 100%;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--heyde-gray-100);
  overflow: hidden;
  position: relative;
}

.ze-progress-fill {
  height: 100%;
  background: var(--heyde-gradient);
  border-radius: var(--radius-pill);
  transition: width var(--duration-base) var(--ease-standard);
}

.ze-progress-fill.over-goal { background: var(--heyde-green); }

.ze-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

table.data-table tr.ze-current-tier td {
  background: var(--heyde-purple-50);
  font-weight: 700;
}

/* ---------------- Master data: subprojects ---------------- */

.subproject-list {
  margin: 8px 0 0 0;
  padding: 10px 12px;
  background: var(--heyde-gray-50);
  border-radius: var(--radius-sm);
}

.subproject-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--heyde-white);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  margin: 0 6px 6px 0;
}

.subproject-chip button {
  appearance: none;
  border: none;
  background: none;
  color: var(--heyde-red);
  cursor: pointer;
  font-size: 0.8125rem;
  line-height: 1;
  padding: 0;
}

.subproject-chip button.chip-edit { color: var(--heyde-purple); }
.subproject-chip button.chip-save { color: var(--heyde-green); font-weight: 700; }

.subproject-chip-editing {
  background: var(--heyde-purple-50);
  gap: 4px;
}

.subproject-chip-editing input {
  height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid var(--heyde-gray-300);
  font-size: 0.75rem;
}

.subproject-add-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.subproject-add-row input {
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--heyde-gray-300);
  font-size: 0.8125rem;
}
