/* ============================================================================
   Components — Mobile-First (v11 — Rewrite)
   KEIN backdrop-filter, KEIN card::before Noise, KEIN module-tile::before
   Alle ::before/::after auf interaktiven Elementen entfernt
   ============================================================================ */

/* --- Card --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
  transition: transform var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease,
              border-color var(--duration-fast) ease;
}

/* KEIN .card::before (Noise-Overlay entfernt) */

.card-featured {
  background: var(--gradient-card);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.card-featured:hover {
  box-shadow: var(--shadow-glow-strong), var(--shadow-lg);
}

/* Status-Streifen links */
.card[data-status="done"]     { border-left: 3px solid var(--text-muted); }
.card[data-status="archived"] { border-left: 3px solid var(--text-muted); opacity: 0.6; }
.card[data-status="active"] {
  border-left: 3px solid var(--status-ok);
  background: linear-gradient(135deg, rgba(63, 185, 80, 0.04) 0%, var(--bg-surface) 40%);
}
.card[data-status="paused"] {
  border-left: 3px solid var(--status-warn);
  background: linear-gradient(135deg, rgba(210, 153, 34, 0.04) 0%, var(--bg-surface) 40%);
}
.card[data-status="blocked"] {
  border-left: 3px solid var(--status-critical);
  background: linear-gradient(135deg, rgba(248, 81, 73, 0.04) 0%, var(--bg-surface) 40%);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.card-compact {
  padding: var(--space-3);
}
.card-compact .card-title { font-size: var(--text-sm); }
.card-compact .card-body  { font-size: var(--text-xs); }
.card-compact .card-header { margin-bottom: var(--space-2); }
.card-compact .card-footer { margin-top: var(--space-2); padding-top: var(--space-2); }

.card-featured .card-title {
  font-size: var(--text-lg);
  font-weight: 700;
}

/* Desktop: Card Hover */
@media (hover: hover) {
  .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--border-active);
    border-color: var(--border-active);
  }
}

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  min-height: 44px;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-color: var(--accent-primary);
}
.btn-primary:hover {
  background: var(--accent-primary-lt);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--border-active);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-danger {
  background: transparent;
  color: var(--status-critical);
  border-color: var(--status-critical);
}
.btn-danger:hover {
  background: var(--status-critical-bg);
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  min-height: 32px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--border-radius-full);
  white-space: nowrap;
  font-feature-settings: 'tnum' on, 'lnum' on;
}

.badge-ok       { background: var(--status-ok-bg); color: var(--status-ok); }
.badge-warn     { background: var(--status-warn-bg); color: var(--status-warn); }
.badge-critical { background: var(--status-critical-bg); color: var(--status-critical); }
.badge-info     { background: var(--status-info-bg); color: var(--status-info); }
.badge-neutral  { background: var(--bg-elevated); color: var(--text-secondary); }
.badge-accent   { background: rgba(240,136,62,0.1); color: var(--accent-primary); }

/* --- Input --- */
.input {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-recessed);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  min-height: 40px;
}

.input:hover {
  border-color: var(--border-active);
}

.input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

textarea.input {
  resize: vertical;
  min-height: 80px;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* --- Tag / Chip --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--border-radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  min-height: 36px;
  touch-action: manipulation;
}

.tag:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.tag.active {
  background: rgba(240, 136, 62, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: var(--text-sm);
  max-width: 400px;
  margin: 0 auto var(--space-4);
}

/* --- Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: var(--z-modal);
  animation: backdropFade 0.2s ease;
  display: none;
  pointer-events: none;
}

.modal-backdrop.active {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-xl);
  padding: var(--space-4);
  width: 95%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalIn 0.25s var(--ease-out);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  touch-action: manipulation;
}

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

.modal-body {
  /* Platzhalter fuer View-spezifische Inhalte */
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

/* Desktop Modal */
@media (min-width: 768px) {
  .modal {
    padding: var(--space-6);
    width: 90%;
    max-height: 85vh;
  }
}

/* --- Global Mobile Overflow Fixes --- */
.page-header {
  max-width: 100%;
  overflow: hidden;
}

.card {
  max-width: 100%;
  overflow: hidden;
  word-break: break-word;
}

/* Alle flex-Zeilen wrappen auf Mobile */
.activity-input-row,
.form-row {
  max-width: 100%;
}

.activity-input-row > *,
.form-row > * {
  min-width: 0 !important;
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s var(--ease-out);
}

.toast.toast-exit {
  animation: slideOutRight 0.2s ease forwards;
}

.toast-ok       { border-left: 3px solid var(--status-ok); }
.toast-warn     { border-left: 3px solid var(--status-warn); }
.toast-error    { border-left: 3px solid var(--status-critical); }
.toast-info     { border-left: 3px solid var(--status-info); }

/* --- Toolbar (Filter-Leiste) --- */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: unset;
  width: 100%;
}

@media (min-width: 768px) {
  .toolbar { gap: var(--space-3); }
  .search-input { min-width: 200px; width: auto; }
}

/* --- Kanban Board --- */
.kanban {
  display: block;
}

.kanban-column {
  display: none;
  width: 100%;
  background: var(--bg-recessed);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: var(--space-4);
  min-height: 300px;
}

.kanban-column.active {
  display: block;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.kanban-column-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.kanban-column-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
  font-feature-settings: 'tnum' on, 'lnum' on;
}

.kanban-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 100px;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: var(--space-3);
  cursor: grab;
  transition: all var(--duration-fast) ease;
}

.kanban-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-sm);
}

.kanban-card:active {
  cursor: grabbing;
  transform: rotate(1deg);
  box-shadow: var(--shadow-md);
}

.kanban-card-title {
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Kanban Priority Colors */
.kanban-card[data-priority="critical"] {
  border-left: 3px solid var(--status-critical);
  background: linear-gradient(135deg, rgba(248, 81, 73, 0.06) 0%, var(--bg-surface) 40%);
}
.kanban-card[data-priority="high"] {
  border-left: 3px solid var(--status-warn);
  background: linear-gradient(135deg, rgba(210, 153, 34, 0.04) 0%, var(--bg-surface) 40%);
}
.kanban-card[data-priority="normal"] {
  border-left: 3px solid var(--border-subtle);
}
.kanban-card[data-priority="low"] {
  opacity: 0.75;
}

/* Kanban Tabs (Mobile) */
.kanban-tabs {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-1);
  scrollbar-width: none;
}
.kanban-tabs::-webkit-scrollbar { display: none; }

.kanban-tab {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--border-radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  min-height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  touch-action: manipulation;
}

.kanban-tab.active {
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-color: var(--accent-primary);
}

.kanban-load-more {
  width: 100%;
  padding: var(--space-2);
  margin-top: var(--space-2);
  background: var(--bg-elevated);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--border-radius-md);
  color: var(--text-muted);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  touch-action: manipulation;
}

.kanban-load-more:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.kanban-filter-screen {
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.kanban-filter-screen .section-title {
  justify-content: center;
}

.kanban-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-4);
}

/* Desktop Kanban: 4 Spalten Grid */
@media (min-width: 768px) {
  .kanban-tabs {
    display: none;
  }

  .kanban {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    min-height: 400px;
  }

  .kanban-column {
    display: block;
    min-width: 0;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .kanban {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: var(--space-6);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-subtle);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-5);
}

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-6) + 6px);
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-base);
}

.timeline-time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.timeline-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: var(--space-2) var(--space-3);
}

@media (min-width: 768px) {
  .timeline-content {
    padding: var(--space-3) var(--space-4);
  }
}

/* --- Action Grid --- */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  text-align: center;
  touch-action: manipulation;
}

@media (hover: hover) {
  .action-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
  }
}

.action-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  background: var(--bg-elevated);
  color: var(--accent-primary);
  font-size: 24px;
}

.action-card-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
}

.action-card-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.action-card-ghost {
  opacity: 0.3;
  border: 2px dashed var(--accent-primary);
}

.action-card .action-card-menu {
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
}

.action-card:hover .action-card-menu {
  opacity: 1;
}

@media (min-width: 768px) {
  .action-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
  }
  .action-card {
    padding: var(--space-6) var(--space-4);
  }
}

/* --- Form Group --- */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-row > * {
  flex: 1;
}

@media (min-width: 768px) {
  .form-row {
    flex-direction: row;
  }
}

/* ============================================================================
   Dashboard Components
   ============================================================================ */

/* --- Hero KPI Grid --- */
.kpi-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.kpi-hero-card {
  padding: var(--space-4);
  border-radius: var(--border-radius-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.kpi-hero-card--primary {
  background: linear-gradient(135deg,
    rgba(240, 136, 62, 0.15) 0%,
    rgba(88, 166, 255, 0.08) 100%
  );
  border: 1px solid rgba(240, 136, 62, 0.2);
  box-shadow: 0 0 40px rgba(240, 136, 62, 0.08);
}

.kpi-hero-card--secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.kpi-hero-card--status {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

@media (hover: hover) {
  .kpi-hero-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border-active);
  }
}

.kpi-hero-value {
  font-size: var(--text-2xl);
  font-family: var(--font-mono);
  font-weight: 800;
  font-feature-settings: 'tnum' on, 'lnum' on;
  line-height: 1;
  margin-bottom: var(--space-2);
  animation: countUp 0.6s var(--ease-out);
}

.kpi-hero-card--primary .kpi-hero-value {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.kpi-hero-card--secondary .kpi-hero-value {
  color: var(--text-primary);
}

.kpi-hero-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 600;
}

.kpi-hero-sublabel {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

@media (min-width: 768px) {
  .kpi-hero-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }
  .kpi-hero-card {
    padding: var(--space-5) var(--space-6);
  }
  .kpi-hero-value {
    font-size: var(--text-4xl);
  }
  .kpi-hero-label {
    font-size: var(--text-xs);
  }
}

/* --- Dashboard Hero (Greeting) --- */
.dashboard-hero {
  margin-bottom: var(--space-4);
}

.dashboard-greeting {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.dashboard-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .dashboard-hero { margin-bottom: var(--space-5); }
  .dashboard-greeting { font-size: var(--text-3xl); }
  .dashboard-subtitle { font-size: var(--text-base); }
}

/* --- Passkey Banner --- */
.passkey-banner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-secondary);
  border-radius: var(--border-radius-lg);
}

.passkey-banner .btn { width: 100%; }

.passkey-banner-text { flex: 1; }
.passkey-banner-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-bottom: 2px;
}
.passkey-banner-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  .passkey-banner {
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
  }
  .passkey-banner .btn { width: auto; }
}

/* --- Dashboard Urgent --- */
.dashboard-urgent {
  margin-top: var(--space-4);
}

@media (min-width: 768px) {
  .dashboard-urgent { margin-top: var(--space-6); }
}

/* --- Module Grid (Startseiten-Kacheln) --- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.module-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-xl);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
  min-height: 100px;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* KEIN ::before — stattdessen border-top fuer Farbe */
  border-top: 3px solid var(--tile-color, var(--accent-primary));
}

/* KEIN .module-tile::before (entfernt) */

.module-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-lg);
  background: color-mix(in srgb, var(--tile-color, var(--accent-primary)) 12%, transparent);
  color: var(--tile-color, var(--accent-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.module-tile-icon i {
  width: 22px;
  height: 22px;
}

.module-tile-text {
  flex: 1;
  min-width: 0;
}

.module-tile-name {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.module-tile-desc {
  display: none;
}

.module-tile-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  color: var(--tile-color, var(--accent-primary));
  background: color-mix(in srgb, var(--tile-color, var(--accent-primary)) 10%, transparent);
  padding: 1px 5px;
  border-radius: var(--border-radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Desktop Module Tiles */
@media (min-width: 768px) {
  .module-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }
  .module-tile {
    flex-direction: row;
    text-align: left;
    gap: var(--space-4);
    padding: var(--space-5);
    border-radius: var(--border-radius-lg);
    min-height: auto;
    justify-content: flex-start;
    border-top: none;
    border-left: 3px solid var(--tile-color, var(--accent-primary));
  }
  .module-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
  }
  .module-tile-icon i {
    width: 24px;
    height: 24px;
  }
  .module-tile-name {
    font-size: var(--text-base);
    font-weight: 700;
  }
  .module-tile-desc {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .module-tile-badge {
    position: static;
    font-size: var(--text-xs);
    padding: 2px 8px;
  }
}

@media (hover: hover) {
  .module-tile:hover {
    transform: translateY(-4px);
    border-color: var(--tile-color, var(--accent-primary));
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Section Title --- */
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-title::before {
  content: '';
  width: 3px;
  height: 1em;
  background: var(--gradient-hero);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: calc(-1 * var(--space-3));
  margin-bottom: var(--space-4);
  padding-left: calc(3px + var(--space-3));
}

/* --- Dashboard Split Layout --- */
.dashboard-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .dashboard-split {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Compact Task List (Dashboard) --- */
.task-list-compact {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.task-list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--border-radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all var(--duration-fast) ease;
  cursor: pointer;
  touch-action: manipulation;
}

.task-list-item:hover {
  border-color: var(--border-active);
  background: var(--bg-elevated);
}

.task-prio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.task-prio-dot--critical { background: var(--status-critical); box-shadow: 0 0 6px var(--status-critical); }
.task-prio-dot--high     { background: var(--status-warn); }
.task-prio-dot--normal   { background: var(--text-muted); }
.task-prio-dot--low      { background: var(--text-muted); opacity: 0.5; }

.task-list-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-list-project {
  display: none;
}

@media (min-width: 768px) {
  .task-list-project {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* --- Activity List Compact (Dashboard) --- */
.activity-list-compact {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.activity-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--border-radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.activity-list-time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 42px;
}

.activity-list-title {
  font-size: var(--text-sm);
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- "Alle anzeigen" Link --- */
.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--accent-primary);
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--space-2) 0;
  transition: color var(--duration-fast) ease;
  touch-action: manipulation;
}

.view-all-link:hover {
  color: var(--accent-primary-lt);
}

/* --- Pinned Projects --- */
.pinned-projects {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-6);
}

.pinned-projects .card-featured,
.pinned-projects .card {
  min-width: 260px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

@media (min-width: 768px) {
  .pinned-projects {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    overflow-x: visible;
    scroll-snap-type: none;
  }
  .pinned-projects .card-featured,
  .pinned-projects .card {
    min-width: 0;
  }
}

/* --- Bento Grid --- */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(120px, auto);
  gap: var(--space-4);
}

.bento-2x1 { grid-column: span 1; }
.bento-1x2 { grid-row: span 1; }
.bento-2x2 { grid-column: span 1; }
.bento-full { grid-column: 1 / -1; }

@media (min-width: 768px) and (max-width: 1023px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-2x1 { grid-column: span 2; }
  .bento-2x2 { grid-column: span 2; }
}

@media (min-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(4, 1fr); }
  .bento-2x1 { grid-column: span 2; }
  .bento-1x2 { grid-row: span 2; }
  .bento-2x2 { grid-column: span 2; grid-row: span 2; }
}

/* --- Gradient-Border Glow Cards --- */
.card-glow {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--border-radius-lg);
  background-clip: padding-box;
}

/* --- Collapsible Section --- */
.collapsible-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  touch-action: manipulation;
}

.collapsible-header:hover {
  background: var(--bg-elevated);
  border-color: var(--border-active);
}

.collapsible-header .chevron {
  transition: transform var(--duration-fast) ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.collapsible-header.open .chevron {
  transform: rotate(90deg);
}

.collapsible-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-left: auto;
}

.collapsible-body {
  display: none;
  padding-top: var(--space-3);
}

.collapsible-body.open {
  display: block;
  animation: fadeInUp 0.3s var(--ease-out);
}

/* --- Projekt-Task-Cards (Aufgaben-Seite) --- */
.project-task-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  touch-action: manipulation;
}
@media (min-width: 768px) {
  .project-task-header {
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
  }
}

.project-task-header:hover {
  background: var(--bg-elevated);
  border-color: var(--border-active);
}

.project-task-header.open {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}

.project-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.project-task-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
@media (min-width: 768px) {
  .project-task-name {
    font-size: var(--text-base);
  }
}

.project-task-counts {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Kategorie-Badge + erledigte Anzahl auf Mobile ausblenden */
.project-task-header .badge,
.project-task-done-count {
  display: none;
}
@media (min-width: 768px) {
  .project-task-header .badge,
  .project-task-done-count {
    display: inline;
  }
}

.project-task-header .chevron {
  transition: transform var(--duration-fast) ease;
  color: var(--text-muted);
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.project-task-header.open .chevron {
  transform: rotate(90deg);
}

.project-task-body {
  display: none;
  background: var(--bg-recessed);
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
  padding: var(--space-2);
}

.project-task-body.open {
  display: block;
  animation: fadeInUp 0.2s var(--ease-out);
}

/* Task Row (einzelne Aufgabe) */
.task-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--border-radius-sm);
  transition: background var(--duration-fast) ease;
  min-height: 40px;
}
@media (min-width: 768px) {
  .task-row {
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
  }
}

.task-row:hover {
  background: var(--bg-surface);
}

.task-row.task-done {
  opacity: 0.5;
}

.task-row.task-done .task-row-title {
  text-decoration: line-through;
}

/* Checkbox */
.task-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border-default);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast) ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: manipulation;
}

.task-checkbox:hover {
  border-color: var(--accent-primary);
}

.task-checkbox.checked {
  background: var(--status-ok);
  border-color: var(--status-ok);
}

.task-checkbox.checked::after {
  content: '\2713';
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.task-row-title {
  font-size: var(--text-sm);
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Activity Layout --- */
.activity-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 1024px) {
  .activity-layout {
    grid-template-columns: 1fr 320px;
  }
}

/* Activity Input Mobile */
.activity-input-row {
  flex-direction: column;
  gap: var(--space-2);
}
.activity-input-row > * {
  width: 100%;
  min-width: unset;
}
.activity-input-row .btn {
  min-height: 48px;
}

@media (min-width: 768px) {
  .activity-input-row {
    flex-direction: row;
    gap: var(--space-3);
  }
  .activity-input-row > * {
    width: auto;
    min-width: 0;
  }
}

/* --- Skeleton Placeholders --- */
.skeleton-kpi {
  height: 100px;
  border-radius: var(--border-radius-xl);
}

.skeleton-line {
  height: 44px;
  border-radius: var(--border-radius-md);
  margin-bottom: var(--space-2);
}

.skeleton-card {
  height: 140px;
  border-radius: var(--border-radius-lg);
}

/* --- Tabular Numbers --- */
.mono, .kpi-hero-value, .kanban-column-count {
  font-feature-settings: 'tnum' on, 'lnum' on;
}

/* ============================================================================
   Light Theme — Component Overrides
   ============================================================================ */

[data-theme="light"] .card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .card-featured {
  box-shadow: 0 2px 8px rgba(212, 112, 42, 0.08);
}

[data-theme="light"] .kpi-hero-card--primary {
  background: linear-gradient(135deg,
    rgba(212, 112, 42, 0.1) 0%,
    rgba(43, 111, 194, 0.06) 100%
  );
  border: 1px solid rgba(212, 112, 42, 0.2);
  box-shadow: 0 2px 12px rgba(212, 112, 42, 0.06);
}
[data-theme="light"] .kpi-hero-card--secondary {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .kpi-hero-card--status {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .module-tile {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .kanban-column {
  background: var(--bg-elevated);
}
[data-theme="light"] .kanban-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .timeline::before {
  background: var(--border-default);
}
[data-theme="light"] .timeline-dot {
  border-color: var(--bg-base);
}
[data-theme="light"] .timeline-content {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .input {
  background: var(--bg-surface);
  border-color: var(--border-default);
}
[data-theme="light"] .input:focus {
  box-shadow: 0 0 0 3px rgba(212, 112, 42, 0.12);
}

[data-theme="light"] .modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .toast {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .task-list-item {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .action-card {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .passkey-banner {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .project-task-header {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .project-task-body {
  background: var(--bg-elevated);
}

[data-theme="light"] .section-title::before {
  background: var(--gradient-hero);
}

/* ============================================================================
   Aufgaben-Cockpit (v12)
   ============================================================================ */

/* --- Heute-View --- */
.heute-view {
  max-width: 720px;
}

.heute-greeting {
  margin-bottom: var(--space-5);
}

.heute-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-1);
}

.heute-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.heute-count {
  color: var(--accent-primary);
  font-weight: 700;
  font-family: var(--font-mono);
}

.heute-overdue-count {
  color: var(--status-critical);
  font-weight: 600;
}

.heute-done-count {
  color: var(--status-ok);
  font-weight: 600;
}

.heute-inbox-count {
  color: var(--accent-secondary);
  font-weight: 600;
}

.heute-section {
  margin-bottom: var(--space-6);
}

.heute-overdue {
  border-left: 3px solid var(--status-critical);
  padding-left: var(--space-4);
  border-radius: 0;
}

.heute-empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--border-radius-md);
}

/* --- Quick-Add Input --- */
.heute-quickadd {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-6);
}

.btn-voice {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all var(--duration-fast) ease;
}
.btn-voice:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.btn-voice--active {
  border-color: #f85149;
  color: #f85149;
  background: rgba(248,81,73,0.1);
  animation: pulse 1s infinite;
}

.quickadd-input {
  flex: 1;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  min-height: 48px;
}

.quickadd-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

/* --- Task Row (Aufgaben-Cockpit) --- */
.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.task-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--border-radius-md);
  transition: background var(--duration-fast) ease;
  min-height: 44px;
}

.task-row:hover {
  background: var(--bg-elevated);
}

.task-check {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  flex-shrink: 0;
  transition: color var(--duration-fast) ease;
  touch-action: manipulation;
}

.task-check:hover {
  color: var(--status-ok);
}

.task-row-content {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.task-row-title {
  font-size: var(--text-sm);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-project {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  display: none;
}

@media (min-width: 768px) {
  .task-row-project { display: inline; }
}

.task-row-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.task-row-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.task-cat-badge {
  font-size: 12px;
  flex-shrink: 0;
}

.task-due {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.task-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Eskalations-Farben */
.due-overdue { color: var(--status-critical); font-weight: 600; }
.due-today { color: var(--accent-primary); font-weight: 600; }
.due-soon { color: var(--status-warn); }

.task-row.due-overdue {
  background: var(--status-critical-bg);
}

/* Priority Dots */
.prio-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.prio-critical { background: var(--status-critical); box-shadow: 0 0 4px var(--status-critical); }
.prio-high { background: var(--status-warn); }

.task-star {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  opacity: 0;
  transition: opacity var(--duration-fast) ease, color var(--duration-fast) ease;
  touch-action: manipulation;
}

.task-row:hover .task-star { opacity: 1; }

.task-star:hover { color: var(--accent-primary); }

.task-edit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  opacity: 0;
  transition: opacity var(--duration-fast) ease, color var(--duration-fast) ease, background var(--duration-fast) ease;
  touch-action: manipulation;
}

.task-edit-btn i { width: 18px !important; height: 18px !important; }

.task-row:hover .task-edit-btn { opacity: 1; }

.task-edit-btn:hover {
  color: var(--accent-primary);
  background: var(--bg-hover);
}

@media (max-width: 767px) {
  .task-edit-btn {
    min-width: 40px;
    min-height: 40px;
    padding: 10px;
  }
  .task-edit-btn i { width: 20px !important; height: 20px !important; }
}

/* Snooze-Button */
.task-snooze-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  transition: opacity var(--duration-fast) ease, color var(--duration-fast) ease, background var(--duration-fast) ease;
  touch-action: manipulation;
}

.task-snooze-btn i { width: 18px !important; height: 18px !important; }

.task-row:hover .task-snooze-btn { opacity: 1; }
.task-snooze-btn:hover {
  color: var(--accent-secondary);
  background: var(--bg-hover);
}

/* Snooze auf Mobile immer sichtbar + noch groesser */
@media (max-width: 767px) {
  .task-snooze-btn {
    opacity: 1;
    min-width: 40px;
    min-height: 40px;
    padding: 10px;
  }
  .task-snooze-btn i { width: 20px !important; height: 20px !important; }
}

/* Snooze-Popover */
.snooze-popover {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  min-width: 200px;
}

.snooze-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.snooze-preset {
  flex: 1 1 45%;
  text-align: center;
  padding: 6px 8px;
  font-size: 12px;
  touch-action: manipulation;
}

.snooze-preset:hover {
  background: var(--bg-hover);
  color: var(--accent-secondary);
}

.snooze-custom {
  display: flex;
  gap: 4px;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

.snooze-date-input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 4px 6px;
  font-size: 12px;
}

.snooze-apply {
  flex-shrink: 0;
}

/* Followup-Vorschlag */
.followup-suggest {
  text-align: center;
  padding: 8px 0;
}

.followup-suggest h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.followup-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.followup-input:focus {
  outline: none;
  border-color: var(--accent-orange);
}

.followup-due {
  color: var(--text-muted);
  font-size: 13px;
  margin: 4px 0 12px;
}

/* Timer-Button */
.task-timer {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  touch-action: manipulation;
  white-space: nowrap;
  min-height: auto;
  line-height: 1.4;
  flex-shrink: 0;
}

.task-timer--active {
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}

.task-timer:hover { background: color-mix(in srgb, var(--accent-primary) 20%, transparent); border-color: var(--accent-primary); color: var(--accent-primary); }

/* Mobile: immer sichtbar */
@media (max-width: 767px) {
  .task-star, .task-edit-btn { opacity: 1; }
}

/* --- Task Edit Dialog --- */
.task-edit-dialog {
  max-width: 100%;
}

.task-edit-form {
  margin-bottom: var(--space-4);
}

.task-edit-form .form-group {
  margin-bottom: var(--space-3);
}

.task-edit-form label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.task-edit-form input,
.task-edit-form textarea,
.task-edit-form select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-recessed);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  transition: border-color var(--duration-fast) ease;
  min-height: 40px;
}

.task-edit-form input:focus,
.task-edit-form textarea:focus,
.task-edit-form select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-half {
  flex: 1;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.modal-actions-right {
  display: flex;
  gap: var(--space-2);
}

/* --- Inbox-View --- */
.inbox-view {
  max-width: 720px;
}

.inbox-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
}

.inbox-sort-btn {
  flex-shrink: 0;
}

.task-del-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  transition: color var(--duration-fast) ease;
  touch-action: manipulation;
}

.task-del-btn:hover { color: var(--status-critical); }

/* --- Venue-View --- */
.venue-view {
  max-width: 720px;
}

.venue-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

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

.venue-check:hover { color: var(--status-ok); }

/* --- Done-View --- */
.done-view {
  max-width: 720px;
}

.done-stats {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.done-stat {
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  text-align: center;
  flex: 1;
}

.done-stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--status-ok);
  display: block;
}

.done-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.done-day {
  margin-bottom: var(--space-5);
}

.done-day-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.done-row {
  opacity: 0.7;
}

.done-title {
  text-decoration: line-through;
}

.task-done-check {
  color: var(--status-ok);
  flex-shrink: 0;
}

/* --- Review-View --- */
.review-view {
  max-width: 800px;
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.review-stat {
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  text-align: center;
}

.review-stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  display: block;
}

.review-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.review-section {
  margin-bottom: var(--space-6);
}

.review-alert {
  border-left: 3px solid var(--status-critical);
  padding-left: var(--space-4);
}

.review-cats {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.review-cat-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-surface);
  border-radius: var(--border-radius-sm);
}

.review-cat-count {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-primary);
}

.review-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
  margin-left: auto;
}

.review-open-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .heute-title { font-size: var(--text-3xl); }
  .review-summary { gap: var(--space-4); }
}

/* Board-Integration */
.board-link-group { margin-top: var(--space-2); }

.board-link-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.board-label-badge {
  background: rgba(88, 166, 255, 0.15);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: var(--accent-blue);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.board-link-btn {
  color: var(--accent-blue);
  font-size: 13px;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid rgba(88, 166, 255, 0.3);
  border-radius: 4px;
  white-space: nowrap;
  touch-action: manipulation;
}

.board-link-btn:hover { background: rgba(88, 166, 255, 0.1); }

.task-board-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-blue);
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}
