/* ==========================================================================
   mps.agency Agenturmanager – Design System CSS
   Based on mps-agency_Styleguide_Design-System.md v1.0
   ========================================================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@200;300;400;600;700&display=swap');

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */
:root {
  /* Background */
  --bg-dark: #0a0a0f;
  --bg-card: rgba(255,255,255,0.05);
  --bg-card-hover: rgba(255,255,255,0.08);
  --bg-glass: rgba(255,255,255,0.03);

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: rgba(255,255,255,0.82);
  --text-muted: rgba(255,255,255,0.55);

  /* Accent */
  --accent-blue: #4f6df5;
  --accent-violet: #8b5cf6;
  --accent-light-violet: #c084fc;
  --accent-gradient: linear-gradient(135deg, #4f6df5 0%, #8b5cf6 50%, #a855f7 100%);
  --accent-gradient-h: linear-gradient(90deg, #4f6df5 0%, #8b5cf6 50%, #a855f7 100%);

  /* Semantic */
  --danger: #f87171;
  --success: #4ade80;
  --warning: #fbbf24;

  /* Borders */
  --border-subtle: rgba(255,255,255,0.08);
  --border-accent: rgba(139,92,246,0.2);
  --border-accent-strong: rgba(139,92,246,0.35);

  /* Spacing */
  --sidebar-width: 260px;
  --header-height: 64px;

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 100px;
}

/* ==========================================================================
   Light Theme
   ========================================================================== */
[data-theme="light"] {
  --bg-dark: #f5f5fa;
  --bg-card: rgba(0,0,0,0.03);
  --bg-card-hover: rgba(0,0,0,0.06);
  --bg-glass: rgba(0,0,0,0.02);

  --text-primary: #1a1a2e;
  --text-secondary: rgba(0,0,0,0.72);
  --text-muted: rgba(0,0,0,0.48);

  --border-subtle: rgba(0,0,0,0.1);
  --border-accent: rgba(139,92,246,0.2);
  --border-accent-strong: rgba(139,92,246,0.4);

  /* Accent-Farben für Light Mode dunkler – sonst helle Schrift auf hellem Hintergrund */
  --accent-blue: #4f46e5;
  --accent-violet: #7c3aed;
  --accent-light-violet: #7c3aed;

  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
}
[data-theme="light"] body {
  background: #f5f5fa;
  color: #1a1a2e;
}
[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right-color: rgba(0,0,0,0.08);
  box-shadow: 2px 0 12px rgba(0,0,0,0.04);
}
[data-theme="light"] .sidebar-logo span {
  color: #1a1a2e;
}
.sidebar-logo svg {
  color: #f0f0f5;
}
[data-theme="light"] .sidebar-logo svg {
  color: #1a1a2e;
}
[data-theme="light"] .sidebar-section-title {
  color: rgba(0,0,0,0.4);
}
[data-theme="light"] .nav-item {
  color: rgba(0,0,0,0.6);
}
[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-item.active {
  background: rgba(139,92,246,0.08);
  color: #7c3aed;
}
[data-theme="light"] .page-header {
  background: #ffffff;
  border-bottom-color: rgba(0,0,0,0.06);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
[data-theme="light"] .page-header h1,
[data-theme="light"] .page-header h2 {
  color: #1a1a2e;
}
[data-theme="light"] .card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.06);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
[data-theme="light"] .card-header {
  border-bottom-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
  background: #f8f8fc;
  border-color: rgba(0,0,0,0.12);
  color: #1a1a2e;
}
[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-textarea:focus {
  background: #ffffff;
  border-color: #8b5cf6;
}
[data-theme="light"] .form-input::placeholder,
[data-theme="light"] .form-textarea::placeholder {
  color: rgba(0,0,0,0.35);
}
[data-theme="light"] .data-table thead {
  background: rgba(0,0,0,0.03);
}
[data-theme="light"] .data-table th {
  color: rgba(0,0,0,0.5);
  border-bottom-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .data-table td {
  border-bottom-color: rgba(0,0,0,0.05);
  color: #1a1a2e;
}
[data-theme="light"] .data-table tbody tr:hover {
  background: rgba(139,92,246,0.04);
}
[data-theme="light"] .btn-ghost {
  color: rgba(0,0,0,0.6);
  border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] .btn-ghost:hover {
  background: rgba(0,0,0,0.05);
  color: #1a1a2e;
}
[data-theme="light"] .btn-secondary {
  background: rgba(139,92,246,0.1);
  color: #7c3aed;
}
[data-theme="light"] .tag {
  border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .text-muted {
  color: rgba(0,0,0,0.48) !important;
}
[data-theme="light"] .divider {
  background: rgba(0,0,0,0.06);
}
[data-theme="light"] .detail-info-grid .label {
  color: rgba(0,0,0,0.45);
}
[data-theme="light"] .detail-info-grid .value {
  color: #1a1a2e;
}
[data-theme="light"] .search-box .form-input {
  background: rgba(0,0,0,0.04);
  color: #1a1a2e;
}
[data-theme="light"] .toast {
  background: #ffffff;
  color: #1a1a2e;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
[data-theme="light"] .sidebar-footer {
  border-top-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .stat-card,
[data-theme="light"] .stat-value {
  color: #1a1a2e;
}
[data-theme="light"] .empty-state {
  color: rgba(0,0,0,0.4);
}
/* Kanban Board light */
[data-theme="light"] .kanban-column {
  background: rgba(0,0,0,0.02);
}
[data-theme="light"] .kanban-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
/* Modal hat hardcoded dunkles Background → im Light Mode überschreiben */
[data-theme="light"] .modal {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
[data-theme="light"] .modal-close {
  border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .modal-close:hover {
  background: rgba(0,0,0,0.05);
}
/* Gradient-Text im Light Mode kräftiger, sonst zu hell */
[data-theme="light"] .gradient-text {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6d28d9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* Section-Titles in pages (inline styled) – Farbe via --text-muted,
   aber einige nutzen feste rgba-Werte; wir forcieren lesbare Farbe */
[data-theme="light"] .tm-section-title,
[data-theme="light"] .ob-section-title {
  color: rgba(0,0,0,0.55);
}
/* Badge-counts und aktive Tabs: --accent-light-violet war hardcoded hell */
[data-theme="light"] .badge-count {
  background: rgba(139,92,246,0.12);
  color: #7c3aed;
}
[data-theme="light"] .tab-nav a.active {
  color: #7c3aed;
  border-bottom-color: #7c3aed;
}
/* Timer-Widget-Panel-Titel im Light Mode */
[data-theme="light"] .timer-panel-title,
[data-theme="light"] #timer-time,
[data-theme="light"] .timer-alert-title,
[data-theme="light"] .timer-summary-item .val {
  color: #1a1a2e;
}
[data-theme="light"] .timer-panel-header {
  background: rgba(79,109,245,0.06);
}
[data-theme="light"] #timer-panel {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}
[data-theme="light"] .timer-display {
  background: rgba(0,0,0,0.03);
}
/* Inline-Edit Input Feld */
[data-theme="light"] .inline-edit:focus {
  background: rgba(0,0,0,0.03);
  border-color: rgba(139,92,246,0.4);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Titillium Web', sans-serif;
  font-weight: 300;
  background: var(--bg-dark);
  color: var(--text-secondary);
  line-height: 1.72;
  min-height: 100vh;
  overflow-x: hidden;
}

strong, b {
  font-weight: 600;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-light-violet);
}

img {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1 {
  font-size: clamp(2.4rem, 4.2vw, 3.6rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.12;
  letter-spacing: -0.5px;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

p, li {
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  font-weight: 300;
  line-height: 1.72;
}

.text-muted {
  color: var(--text-muted);
}

.text-primary {
  color: var(--text-primary);
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.label {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ==========================================================================
   Layout – App Shell
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

.sidebar-logo img {
  height: 24px;
}

.sidebar-logo .tagline {
  font-size: 0.75rem;
  color: var(--accent-light-violet);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 6px;
  display: block;
}

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

.sidebar-section {
  margin-bottom: 2px;
}

/* Section-Titel: immer sichtbar, mit Chevron */
.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 10px 12px 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
  user-select: none;
}

/* Chevron-Icon */
.section-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0.6;
  transition: transform 0.22s ease, opacity 0.2s;
  transform: rotate(-90deg); /* zeigt rechts = eingeklappt */
}

/* Items-Container: standardmäßig eingeklappt */
.sidebar-section-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

/* Hover: nur dezente Titel-Hervorhebung – Aufklappen erfolgt per Klick (app.js) */
.sidebar-section:hover .section-chevron {
  opacity: 1;
}
.sidebar-section:hover .sidebar-section-title {
  color: var(--text-secondary);
}

/* Aktive Sektion: immer aufgeklappt (auch ohne Hover) */
.sidebar-section.open .sidebar-section-items {
  max-height: 400px;
}
.sidebar-section.open .section-chevron {
  transform: rotate(0deg);
  opacity: 1;
}
.sidebar-section.open .sidebar-section-title {
  color: var(--text-secondary);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(139,92,246,0.15);
  color: var(--accent-light-violet);
  border: 1px solid rgba(139,92,246,0.2);
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  opacity: 0.8;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.sidebar-icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}
.sidebar-icon-btn.active {
  color: var(--accent-light-violet);
  border-color: var(--border-accent-strong);
  background: rgba(139,92,246,0.1);
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  position: relative;
}

/* Header */
.top-header {
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

[data-theme="light"] .top-header {
  background: rgba(255,255,255,0.9);
}

/* Header Zonen */
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-center {
  text-align: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.page-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* Header Page Actions (vom jeweiligen Seitentemplate) */
.header-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Wetter-Widget */
.header-weather {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: default;
  white-space: nowrap;
}
.weather-icon { font-size: 1rem; }
.weather-temp { font-weight: 600; color: var(--text-primary); }
.weather-city { color: var(--text-muted); font-size: 0.78rem; }

/* Datum & Uhrzeit */
.header-datetime {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.header-date { color: var(--text-secondary); }
.header-sep { color: var(--text-muted); }
.header-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

/* Begrüßungstext */
.header-greeting {
  font-size: 0.88rem;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 400;
}

/* Logout-Button */
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  padding: 0;
  flex-shrink: 0;
}
.logout-btn:hover {
  color: var(--danger);
  border-color: rgba(248,113,113,0.3);
  background: rgba(248,113,113,0.08);
}

/* Notification Bell */
.notif-bell {
  position: relative;
}
.notif-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}
.notif-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}
.notif-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  backdrop-filter: blur(20px);
  z-index: 200;
  overflow: hidden;
  display: none;
  animation: fadeSlideDown 0.18s ease;
}
.notif-dropdown.open { display: block; }

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.notif-header {
  padding: 14px 16px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom: 1px solid var(--border-subtle);
}
.notif-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.notif-group {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.notif-group:last-child { border-bottom: none; }
.notif-group-title {
  padding: 4px 16px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.notif-item {
  display: block;
  padding: 7px 16px;
  font-size: 0.87rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* Passwort-Änderungs-Overlay */
.pw-change-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pw-change-modal {
  background: var(--bg-dark);
  border: 1px solid var(--border-accent-strong);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.pw-change-icon { font-size: 2.5rem; margin-bottom: 16px; }
.pw-change-modal h2 { font-size: 1.3rem; font-weight: 600; margin-bottom: 8px; }
.pw-change-modal p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.pw-change-modal .form-group { text-align: left; }

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

/* Page Content */
.page-content {
  padding: 32px;
  max-width: 1400px;
  position: relative;
}

/* ==========================================================================
   Blur Orbs (Background Decoration)
   ========================================================================== */
.blur-orbs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blur-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
}

.blur-orb-1 {
  width: 600px;
  height: 600px;
  background: var(--accent-blue);
  top: -200px;
  right: -100px;
}

.blur-orb-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-violet);
  bottom: -150px;
  left: -100px;
}

.blur-orb-3 {
  width: 400px;
  height: 400px;
  background: #a855f7;
  top: 40%;
  left: 40%;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

/* Karten-Hover bewusst minimal: kein Hintergrundwechsel mehr,
   nur ein dezenter Rahmen-Akzent. Zeilen-Hover (.task-row, Tabellen)
   bleibt als gezieltes Feedback erhalten. */
.card:hover {
  border-color: var(--border-accent);
}

/* Listen-Cards: kein Hover auf dem ganzen Block, nur auf der einzelnen Zeile */
.card.no-hover:hover {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}
[data-theme="light"] .card.no-hover:hover {
  background: #ffffff;
  border-color: rgba(0,0,0,0.06);
}
.task-row {
  transition: background 0.15s ease;
}
/* Markierungs-Checkbox (Aufgaben + Projektlisten), im Stil des Status-Toggles */
.task-select,
.row-select {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.task-select:hover,
.row-select:hover {
  border-color: var(--accent-light-violet);
}
.task-select:checked,
.row-select:checked {
  background: var(--accent-light-violet);
  border-color: var(--accent-light-violet);
}
.task-select:checked::after,
.row-select:checked::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  line-height: 1;
}
/* Status-Badge als Klick-Toggle (offen → in Arbeit → erledigt) */
.task-status-toggle {
  font-family: inherit;
  cursor: pointer;
  border-radius: 99px;
  font-size: 0.68rem;
  padding: 2px 9px;
  line-height: 1.5;
  transition: filter 0.15s;
}
.task-status-toggle:hover {
  filter: brightness(1.25);
}
.task-row:hover {
  background: var(--bg-card-hover);
}
[data-theme="light"] .task-row:hover {
  background: rgba(90,86,239,0.05);
}

.card-accent {
  background: linear-gradient(135deg, rgba(79,109,245,0.1), rgba(139,92,246,0.1));
  border: 1px solid rgba(139,92,246,0.25);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-body {
  color: var(--text-secondary);
}

/* ==========================================================================
   Glass Panel
   ========================================================================== */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
}

/* ==========================================================================
   KPI Boxes
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.kpi-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  transition: all 0.3s ease;
}

.kpi-box:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin: 0 auto 12px;
}

.kpi-icon.violet { background: rgba(139,92,246,0.15); }
.kpi-icon.blue { background: rgba(79,109,245,0.15); }
.kpi-icon.green { background: rgba(74,222,128,0.15); }
.kpi-icon.red { background: rgba(248,113,113,0.15); }
.kpi-icon.yellow { background: rgba(251,191,36,0.15); }

.kpi-value {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

/* ==========================================================================
   Tags / Badges
   ========================================================================== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 15px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag-accent {
  background: rgba(139,92,246,0.15);
  color: var(--accent-light-violet);
  border: 1px solid rgba(139,92,246,0.3);
}

.tag-success {
  background: rgba(74,222,128,0.15);
  color: var(--success);
  border: 1px solid rgba(74,222,128,0.3);
}

.tag-danger {
  background: rgba(248,113,113,0.15);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.3);
}

.tag-warning {
  background: rgba(251,191,36,0.15);
  color: var(--warning);
  border: 1px solid rgba(251,191,36,0.3);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap; /* Icon + Text nie umbrechen (feste Control-Höhen) */
  flex-shrink: 0;
  font-family: 'Titillium Web', sans-serif;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  padding: 12px 28px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.95rem;
  box-shadow: 0 4px 24px rgba(139,92,246,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(139,92,246,0.5);
  color: white;
}

.btn-secondary {
  padding: 10px 22px;
  background: rgba(139,92,246,0.15);
  border: 1px solid var(--border-accent-strong);
  border-radius: var(--radius-sm);
  color: var(--accent-light-violet);
  font-size: 0.95rem;
}

.btn-secondary:hover {
  background: rgba(139,92,246,0.25);
  border-color: rgba(139,92,246,0.6);
  color: var(--accent-light-violet);
}

.btn-ghost {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.btn-ghost:hover {
  background: var(--bg-card);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: 1rem;
  backdrop-filter: blur(20px);
}

.btn-icon:hover {
  background: var(--bg-card);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

/* ==========================================================================
   Tables
   ========================================================================== */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 5px;
}

.data-table th {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 12px 14px;
  font-size: 0.95rem;
  background: var(--bg-card);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr td:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.data-table tr td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.data-table tbody tr {
  transition: all 0.3s ease;
}

.data-table tbody tr:hover td {
  background: var(--bg-card-hover);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Titillium Web', sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* Search Input */
.search-box {
  position: relative;
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box .form-input {
  padding-left: 42px;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

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

.modal {
  background: #13131a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-size: 1.15rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Divider
   ========================================================================== */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,92,246,0.3), transparent);
  margin: 18px 0;
}

/* ==========================================================================
   Grid Layouts
   ========================================================================== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
}
/* Formular-Raster kompakt: die vertikale Luft kommt aus .form-group (20px),
   nicht zusätzlich aus dem Grid-Gap — sonst entstehen riesige Lücken */
.grid-2:has(> .form-group),
.grid-3:has(> .form-group) {
  gap: 4px 28px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

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

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* ==========================================================================
   Status Dot
   ========================================================================== */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot.online { background: var(--success); box-shadow: 0 0 8px rgba(74,222,128,0.5); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 8px rgba(248,113,113,0.5); }
.status-dot.entwicklung { background: var(--warning); box-shadow: 0 0 8px rgba(251,191,36,0.5); }

/* ==========================================================================
   Password Toggle
   ========================================================================== */
.password-field {
  font-family: monospace;
  letter-spacing: 2px;
}

.password-hidden {
  color: var(--text-muted);
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ==========================================================================
   Toast / Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--text-primary);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: slideInRight 0.3s ease;
  max-width: 400px;
}

.toast-success {
  background: rgba(74,222,128,0.15);
  border: 1px solid rgba(74,222,128,0.3);
}

.toast-error {
  background: rgba(248,113,113,0.15);
  border: 1px solid rgba(248,113,113,0.3);
}

.toast-info {
  background: rgba(79,109,245,0.15);
  border: 1px solid rgba(79,109,245,0.3);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Animations
   ========================================================================== */
.fade-in {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeIn 0.5s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Lexoffice Import
   ========================================================================== */
.import-list {
  max-height: 400px;
  overflow-y: auto;
}

.import-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.import-item:hover {
  background: var(--bg-card);
}

.import-item.selected {
  background: rgba(139,92,246,0.1);
  border-color: rgba(139,92,246,0.3);
}

.import-item input[type="checkbox"] {
  accent-color: var(--accent-violet);
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Scrollbar
   ========================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* ==========================================================================
   Mobile Toggle
   ========================================================================== */
.mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-toggle {
    display: flex;
  }

  .grid-2 { grid-template-columns: 1fr; gap: 26px; }
  .grid-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }

  .page-content { padding: 20px; }

  .data-table { font-size: 0.85rem; }
  .data-table th, .data-table td { padding: 10px; }
}

/* ==========================================================================
   Project Cards View
   ========================================================================== */
.project-card {
  position: relative;
  overflow: hidden;
}

.project-card .project-status {
  position: absolute;
  top: 14px;
  right: 14px;
}

.project-card .project-domain {
  font-size: 0.9rem;
  color: var(--accent-blue);
  word-break: break-all;
}

.project-card .project-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   View Toggle
   ========================================================================== */
.view-toggle {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle button {
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.view-toggle button.active {
  background: rgba(139,92,246,0.15);
  color: var(--accent-light-violet);
}

/* ==========================================================================
   Detail Page
   ========================================================================== */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-field {
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.detail-field .label {
  font-size: 0.78rem;
  margin-bottom: 4px;
  display: block;
}

.detail-field .value {
  font-size: 0.98rem;
  color: var(--text-primary);
  font-weight: 400;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}

.pagination button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'Titillium Web', sans-serif;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.pagination button:hover {
  background: var(--bg-card);
}

.pagination button.active {
  background: rgba(139,92,246,0.15);
  border-color: rgba(139,92,246,0.3);
  color: var(--accent-light-violet);
}

/* ==========================================================================
   Tabs
   ========================================================================== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: 'Titillium Web', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  color: var(--accent-light-violet);
  border-bottom-color: var(--accent-violet);
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-violet);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--text-muted);
}

/* =====================================================
   OPERATIONS MODULE – KANBAN BOARD
   ===================================================== */
.kanban-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 400px;
}
.kanban-column {
  min-width: 280px;
  max-width: 320px;
  flex: 1;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}
.kanban-column-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.kanban-column-header .count {
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 400;
}
.kanban-cards {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 600px;
}
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.kanban-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(139,92,246,0.3);
  transform: translateY(-1px);
}
.kanban-card .task-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.kanban-card .task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.kanban-card .task-prio {
  font-size: 0.82rem;
  font-weight: 600;
}

/* =====================================================
   TIME TRACKER
   ===================================================== */
.timer-widget {
  background: linear-gradient(135deg, rgba(79,109,245,0.15), rgba(139,92,246,0.15));
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.timer-display {
  font-size: 2rem;
  font-weight: 600;
  font-family: 'Titillium Web', monospace;
  color: var(--text-primary);
  min-width: 140px;
  letter-spacing: 0.02em;
}
.timer-display.running {
  color: var(--success);
}
.timer-controls {
  display: flex;
  gap: 8px;
}
.timer-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.15s;
}
.timer-btn.start {
  background: var(--success);
  color: #000;
}
.timer-btn.stop {
  background: var(--danger);
  color: #fff;
}
.timer-btn:hover {
  transform: scale(1.1);
}
.time-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.time-grid .day-header {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 4px;
}
.time-grid .day-cell {
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  padding: 8px;
  min-height: 60px;
  font-size: 0.82rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}
.time-grid .day-cell:hover {
  background: rgba(139,92,246,0.1);
}
.time-grid .day-cell .hours {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.time-grid .day-cell.today {
  border: 1px solid rgba(139,92,246,0.4);
}

/* =====================================================
   PLANNING / RESOURCE VIEW
   ===================================================== */
.planning-grid {
  display: grid;
  grid-template-columns: 200px repeat(5, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.planning-grid .pg-header {
  background: rgba(255,255,255,0.06);
  padding: 10px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.planning-grid .pg-cell {
  background: rgba(255,255,255,0.02);
  padding: 8px;
  min-height: 60px;
  position: relative;
}
.planning-grid .pg-member {
  background: rgba(255,255,255,0.04);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}
.planning-bar {
  background: rgba(139,92,246,0.3);
  border: 1px solid rgba(139,92,246,0.5);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.72rem;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.planning-bar.overbooked {
  background: rgba(239,68,68,0.3);
  border-color: rgba(239,68,68,0.5);
  color: var(--danger);
}

/* =====================================================
   UTILITY ADDITIONS
   ===================================================== */
.inline-edit {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: inherit;
  width: 100%;
  transition: border-color 0.15s;
}
.inline-edit:focus {
  border-color: rgba(139,92,246,0.4);
  background: rgba(255,255,255,0.05);
  outline: none;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
}
.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
@media (max-width: 900px) {
  .grid-5, .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .kanban-container { flex-direction: column; }
  .kanban-column { max-width: 100%; min-width: 100%; }
  .planning-grid { grid-template-columns: 140px repeat(5, 1fr); }
}

.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab-nav a {
  padding: 10px 18px;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab-nav a:hover { color: var(--text-primary); }
.tab-nav a.active {
  color: var(--accent-light-violet);
  border-bottom-color: var(--accent-light-violet);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: rgba(139,92,246,0.2);
  color: var(--accent-light-violet);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0 6px;
}

/* ==========================================================================
   Filter-Dropdown mit Mehrfachauswahl (z.B. Status bei Aufgaben)
   ========================================================================== */
.filter-dropdown {
  position: relative;
  display: inline-block;
}
.filter-dropdown > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  white-space: nowrap;
}
.filter-dropdown > summary::-webkit-details-marker { display: none; }
.filter-dropdown > summary::after {
  content: '▾';
  font-size: 0.7rem;
  opacity: .6;
}
.filter-dropdown[open] > summary,
.filter-dropdown > summary:hover {
  border-color: var(--border-accent-strong);
  color: var(--text-primary);
}
.filter-dropdown-panel {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 60;
  min-width: 220px;
  padding: 10px;
  background: #171b26;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0,0,0,.45);
}
[data-theme="light"] .filter-dropdown-panel {
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(0,0,0,.14);
}
.filter-dropdown-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.filter-dropdown-panel label:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.filter-dropdown-panel input[type="checkbox"] {
  accent-color: var(--accent-light-violet);
}
.filter-dropdown-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Sektions-Kopfzeile (Projekt-Gruppen) + Massen-Aktionsleiste
   ========================================================================== */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--sec-tint, transparent);
  border-bottom: 1px solid var(--border-subtle);
}
.section-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sec-color, var(--text-muted));
  flex-shrink: 0;
}
.section-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 7px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sec-color, var(--text-muted));
  background: rgba(128,128,128,0.16); /* Fallback für Browser ohne color-mix */
  background: color-mix(in srgb, var(--sec-color, #888) 16%, transparent);
}
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  flex-wrap: wrap;
}
[data-theme="light"] .bulk-bar { background: rgba(0,0,0,0.02); }

/* ==========================================================================
   Einheitliche Control-Höhen (Buttons, Inputs, Selects)
   Ein Token statt vieler Paddings — Felder und Buttons stehen damit
   in jeder Zeile exakt gleich hoch nebeneinander.
   ========================================================================== */
:root {
  --control-h: 42px;
  --control-h-sm: 34px;
}

.form-input,
.form-select {
  height: var(--control-h);
  padding-top: 0;
  padding-bottom: 0;
  line-height: normal;
}
.form-textarea {
  padding-top: 10px;
  padding-bottom: 10px;
}
/* Datums-/Zeitfelder: Chrome rendert sie sonst niedriger als Textfelder */
.form-input[type="date"],
.form-input[type="time"],
.form-input[type="datetime-local"],
.form-input[type="month"] {
  height: var(--control-h);
}

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
  height: var(--control-h);
  padding-top: 0;
  padding-bottom: 0;
  border-radius: var(--radius-sm);
}
.btn-primary { padding-left: 24px; padding-right: 24px; }
.btn-secondary { padding-left: 20px; padding-right: 20px; }
.btn-ghost { padding-left: 16px; padding-right: 16px; }

.btn-sm,
.btn-primary.btn-sm,
.btn-secondary.btn-sm,
.btn-ghost.btn-sm {
  height: var(--control-h-sm);
  padding: 0 14px;
  border-radius: 8px;
  font-size: 0.85rem;
}
.btn-icon {
  width: var(--control-h);
  height: var(--control-h);
  padding: 0;
}
.btn-icon.btn-sm {
  width: var(--control-h-sm);
  height: var(--control-h-sm);
}
/* Kleine Selects in Filter-/Aktionsleisten auf Button-Höhe bringen */
.bulk-bar .form-select,
.filter-dropdown > summary {
  height: var(--control-h-sm);
}

/* Status-Select direkt in Listenzeilen (Farbe kommt inline vom Status) */
.status-select {
  appearance: none;
  -webkit-appearance: none;
  height: 28px;
  padding: 0 26px 0 10px;
  border-radius: 99px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  max-width: 165px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  transition: filter .15s;
}
.status-select:hover { filter: brightness(1.2); }
.status-select:focus { outline: 2px solid var(--accent-violet); outline-offset: 1px; }
.status-select option { color: #1a1a2e; background: #fff; font-weight: 400; }

/* ==========================================================================
   Projekt-Übersicht: flache Faktenliste + KPI-Kacheln
   ========================================================================== */
.pj-facts {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.pj-fact {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 0.88rem;
}
.pj-fact > .pj-label {
  flex-shrink: 0;
  width: 130px;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.pj-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.pj-kpi {
  border: 1px solid rgba(128,128,128,0.25); /* Fallback ohne color-mix */
  background: rgba(128,128,128,0.06);
  border: 1px solid color-mix(in srgb, var(--kpi-color, #888) 25%, transparent);
  background: color-mix(in srgb, var(--kpi-color, #888) 7%, transparent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.pj-kpi-head {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--kpi-color);
  margin-bottom: 6px;
}
.pj-kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.pj-kpi-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.pj-kpi-bar {
  height: 5px;
  border-radius: 99px;
  background: rgba(128,128,128,0.18);
  overflow: hidden;
  margin-top: 8px;
}
.pj-kpi-bar > div {
  height: 100%;
  border-radius: 99px;
}

/* Inline-Bearbeitung der Projekt-Fakten */
.pj-editable { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.pj-edit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 2px 4px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity .15s, color .15s;
  font-family: inherit;
}
.pj-fact:hover .pj-edit-btn,
.pj-editable:hover .pj-edit-btn { opacity: 1; }
.pj-edit-btn:hover { color: var(--accent-light-violet); }
.pj-edit-form { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }

/* Randlose Karten (Tabellen laufen bis zur Kante): Header/Fuß behalten Innenabstand */
.card-flush {
  padding: 0;
  overflow: hidden;
}
.card-flush > .card-header {
  padding: 16px 22px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
  flex-wrap: wrap;
}
.card-flush > .card-body {
  padding: 16px 22px;
}

/* ==========================================================================
   Projekt-Timeline (Gantt): links Aufgaben-Sidebar, rechts Tagesachse
   ========================================================================== */
.gantt-scroll {
  overflow-x: auto;
  overflow-y: hidden;
}
.gantt {
  display: grid;
  align-items: stretch;
}
.gantt-side {
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 44px;
}
[data-theme="light"] .gantt-side { background: #ffffff; }
.gantt-side-kopf { min-height: 76px; }
.gantt-gruppe {
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}
.gantt-pfeil { color: var(--text-muted); font-size: 0.75rem; width: 12px; }
.gantt-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid var(--border-accent-strong);
  color: var(--accent-light-violet);
  text-decoration: none;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.gantt-plus:hover { background: rgba(139,92,246,0.12); }
.gantt-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
}
.gantt-check:hover { border-color: var(--success); }
.gantt-check.checked { background: var(--success); border-color: var(--success); }
.gantt-titel {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 600;
}
.gantt-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
}
.gantt-badge.overdue { color: var(--danger); border-color: rgba(220,60,60,.4); font-weight: 600; }
.gantt-zelle {
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  min-height: 44px;
}
.gantt-gruppe-zelle { background-color: rgba(128,128,128,0.04) !important; }
.gantt-achse-kopf {
  position: relative;
  min-height: 76px;
  border-bottom: 1px solid var(--border-subtle);
}
.gantt-monat-zeile { position: relative; height: 24px; }
.gantt-kw-zeile { position: relative; height: 24px; }
.gantt-kw {
  position: absolute;
  top: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-left: 6px;
  border-left: 1px solid var(--border-subtle);
  height: 47px;
}
.gantt-monat {
  position: absolute;
  top: 4px;
  height: 20px;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
}
.gantt-tage-zeile { position: relative; height: 28px; }
.gantt-tag {
  position: absolute;
  top: 3px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.gantt-tag.heute {
  background: var(--warning);
  color: #1a1a2e;
  border-radius: 50%;
  font-weight: 700;
  width: 22px !important;
  margin-left: 6px;
}
.gantt-chip {
  position: absolute;
  top: 7px;
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--chip-color, var(--accent-violet));
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  z-index: 2;
}
[data-theme="light"] .gantt-chip { background: #ffffff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.gantt-chip:hover { border-color: var(--chip-color, var(--accent-violet)); z-index: 3; }
.gantt-chip.erledigt { opacity: .55; text-decoration: line-through; }
.gantt-chip.overdue { border-color: rgba(220,60,60,.55); border-left-color: var(--danger); }
.gantt-raute {
  position: absolute;
  top: 10px;
  transform: translateX(-50%);
  color: var(--accent-light-violet);
  font-size: 1rem;
  z-index: 2;
}
.gantt-raute.erledigt { opacity: .5; }

/* Pill-Radio-Gruppen (Status/Priorität im Aufgaben-Formular) */
.pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pill-group input[type="radio"] { display: none; }
.pill-group label {
  padding: 5px 13px;
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.pill-group label:hover {
  border-color: var(--pill-color, var(--accent-violet));
  color: var(--text-primary);
}
.pill-group input:checked + label {
  background: color-mix(in srgb, var(--pill-color, #8b5cf6) 18%, transparent);
  border-color: var(--pill-color, #8b5cf6);
  color: var(--pill-color, #8b5cf6);
}
