/* ══════════════════════════════════════════════════════════════
   Collrd — Layout & Core Components
   Page-Header, Cards, Buttons, Tabs, Toasts, FAB, Modals (base)
   ══════════════════════════════════════════════════════════════ */

/* ── Seiten-Header ─────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Kategorie-Grid ────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── Routine Category Card v3 ─────────────────────────── */
.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
  transition: border-color 0.3s, box-shadow 0.4s, background 0.3s, transform 0.25s;
}

.category-card:hover {
  border-color: color-mix(in srgb, var(--cat-color, var(--gold)) 50%, var(--border-strong));
  box-shadow: 0 0 24px color-mix(in srgb, var(--cat-color, var(--gold)) 18%, transparent),
              0 8px 24px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
  background: var(--bg-elevated);
  transform: translateY(-2px);
}

/* Inner Glow: subtiler Kategorie-Farb-Gradient oben */
.category-card-glow {
  position: absolute; top: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cat-color, var(--gold)) 6%, transparent) 0%, transparent 100%);
  pointer-events: none;
  transition: opacity 0.3s;
}
.category-card:hover .category-card-glow {
  background: linear-gradient(180deg, color-mix(in srgb, var(--cat-color, var(--gold)) 12%, transparent) 0%, transparent 100%);
}

.category-card-body {
  padding: 18px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.category-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.category-name {
  font-size: var(--type-heading-md);
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.3;
}

.category-actions {
  display: flex;
  gap: 4px;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

/* F6b: Hover-reveal nur auf Geräten mit Maus */
@media (hover: hover) {
  .category-actions {
    opacity: 0;
    transition: opacity 0.2s;
  }
  .category-card:hover .category-actions {
    opacity: 1;
  }
}
/* F6b: Touch-Geräte — Actions permanent sichtbar */
@media (hover: none) {
  .category-actions {
    opacity: 1;
  }
}

.category-actions .btn {
  background: rgba(0,0,0,0.5);
  border-radius: 6px;
}
.category-actions .btn:hover {
  background: rgba(255,255,255,0.12);
}

.category-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.meta-pill {
  font-family: var(--font-mono);
  font-size: var(--type-micro);
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-pill-error {
  background: rgba(255,77,106,0.12);
  color: var(--status-error);
  border-color: rgba(255,77,106,0.3);
}

.meta-pill-success {
  background: rgba(74,222,128,0.10);
  color: var(--status-success);
  border-color: rgba(74,222,128,0.3);
}

.meta-pill-muted {
  background: rgba(122,122,138,0.12);
  color: var(--text-secondary);
  border-color: rgba(122,122,138,0.3);
}

/* ── Routine Preview List (Status-Dots) ────────────────── */
.routine-preview-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.routine-preview-list li {
  font-size: var(--type-body-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.routine-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.routine-status-dot--due     { background: var(--gold); }
.routine-status-dot--booked  { background: var(--status-success); }
.routine-status-dot--idle    { background: var(--text-tertiary); }

.preview-more {
  color: var(--text-tertiary);
  font-size: var(--type-body-sm);
}

/* ── Category Card Footer ─────────────────────────────── */
.category-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.category-card-cta {
  font-family: var(--font-body);
  font-size: var(--type-body-sm);
  font-weight: 500;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.category-card:hover .category-card-cta { color: var(--text-primary); }
.category-card-cta i {
  font-size: 14px;
  transition: transform 0.2s;
}
.category-card:hover .category-card-cta i { transform: translateX(3px); }

.category-card-xp {
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  font-weight: 700;
  color: var(--gold);
}

.empty-hint {
  font-size: var(--type-body-sm);
  color: var(--text-tertiary);
}

/* ── Leerer Zustand ────────────────────────────────────── */
/* ── Empty States (unified) ───────────────────────────── */
.empty-state-page {
  text-align: center;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-state-icon {
  font-size: 48px;
  color: var(--text-tertiary);
}

.empty-state-page h2 {
  color: var(--text-primary);
  font-size: 20px;
}

.empty-state-page p {
  color: var(--text-secondary);
  font-size: 16px;
}

/* ── Error Pages (F5 STATE-L01) ───────────────────────── */
.error-page {
  text-align: center;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.error-page-icon {
  font-size: 48px;
  color: var(--neon-cyan);
  margin-bottom: 8px;
}

.error-page-icon--critical {
  color: var(--status-error);
}

.error-page-code {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  color: var(--text-tertiary);
  line-height: 1;
  margin: 0;
}

.error-page-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.error-page-text {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 16px;
}

/* ── Formular ──────────────────────────────────────────── */
/* ── Cards (Design System §6.2) ───────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}

.card-accent::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-color, var(--neon-magenta));
  box-shadow: 0 0 12px var(--accent-glow, var(--neon-magenta-glow));
}

.card-gold::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}

.card-interactive {
  transition: border-color 0.2s;
}
.card-interactive:hover {
  border-color: var(--border-strong);
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 600px;
}


.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field-hint {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 3px;
  display: block;
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="color"] {
  width: 40px;
  height: 36px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-elevated);
  cursor: pointer;
  padding: 2px;
}

.category-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-left: 4px solid var(--neon-violet);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 16px;
  color: var(--text-primary);
  transition: border-left-color 0.2s;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border-default);
}

/* ── Buttons ergänzen ──────────────────────────────────── */
.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-danger {
  background: transparent;
  color: var(--status-error);
  border: 1px solid var(--status-error);
}

.btn-danger:hover {
  background: rgba(255,77,106,0.1);
}

.btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-danger-filled {
  background: var(--status-error);
  color: var(--text-primary);
  border: 1px solid var(--status-error);
}

.btn-danger-filled:hover {
  background: #e6435c;
  box-shadow: 0 0 16px rgba(255,77,106,0.3);
}

.btn-danger-filled:active {
  transform: scale(0.98);
}

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

.btn-success:hover {
  background: rgba(74,222,128,0.08);
  border-color: rgba(74,222,128,0.5);
}

.btn-freeze {
  background: transparent;
  color: var(--neon-cyan);
  border: 1px solid rgba(0,229,255,0.3);
}

.btn-freeze:hover {
  background: var(--neon-cyan-soft);
  border-color: rgba(0,229,255,0.5);
  box-shadow: 0 0 12px var(--neon-cyan-glow);
}

.btn-gold {
  background: var(--gold);
  color: var(--bg-void);
  border: 1px solid var(--gold);
  font-weight: 700;
}

.btn-gold:hover {
  background: #d4b45a;
  box-shadow: 0 0 12px var(--gold-glow);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-icon i { font-size: 18px; }

.btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}
.btn-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.btn-close:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
}
.btn-close i { font-size: 18px; }

.btn-danger-hover:hover {
  color: var(--status-error);
  border-color: rgba(255,77,106,0.4);
}

/* ── Modal (see unified system below) ─────────────────── */

/* ── Reiter ────────────────────────────────────────────── */
/* ── Tabs (Standard) ──────────────────────────────────── */
.tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 0;
}

/* F6d: Tabs-Container (Desktop: transparent, Mobile: scrollbar) */
.tab-bar-scroll {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 8px 16px;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s, border-color 0.2s;
}

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

.tab-btn.active {
  color: var(--neon-magenta);
  border-bottom-color: var(--neon-magenta);
}

.tab-btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  padding: 1px 7px;
  margin-left: 4px;
  color: var(--text-secondary);
}

.tab-count-gold {
  background: var(--gold);
  color: var(--bg-void);
  border-color: var(--gold);
}

/* ── Filter-Buttons (kompakt) ────────────────────────── */
.filter-btn,
.severity-filter-btn,
.reschedule-tab {
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover,
.severity-filter-btn:hover,
.reschedule-tab:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.filter-btn.active,
.severity-filter-btn.active,
.reschedule-tab.active {
  border-color: var(--neon-violet);
  background: rgba(168,85,247,0.12);
  color: var(--neon-violet);
}

/* ── Archivierte Karte ─────────────────────────────────── */
.archived-card {
  opacity: 0.6;
}

.archived-card:hover {
  opacity: 1;
}

/* ── Zurück-Link ───────────────────────────────────────── */
.back-link {
  display: inline-block;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 6px;
}

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

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Routine-Karte ─────────────────────────────────────── */
.routine-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.routine-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s;
}

.routine-card:hover {
  border-color: var(--border-strong);
}

/* Erledigt: gedimmt + Titel durchgestrichen */
.routine-card--done {
  opacity: 0.5;
}

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

/* Task heute bereits erledigt */
.task-item--done {
  opacity: 0.5;
}

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

/* Nicht fällig heute: leicht gedimmt */
.routine-card--not-due {
  opacity: 0.55;
}

.routine-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.routine-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.routine-title {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 600;
}

.xp-badge {
  font-size: 14px;
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 20px;
  padding: 2px 10px;
}

.routine-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.routine-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.routine-items-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 2px solid var(--border-default);
  padding-left: 14px;
}

.routine-items-list li {
  font-size: 14px;
  color: var(--text-secondary);
}

.routine-comment {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  border-top: 1px solid var(--border-default);
  padding-top: 10px;
}
/* ── Rhythmus-Selector ─────────────────────────────────── */
.frequency-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.freq-option input {
  display: none;
}

.freq-card {
  display: block;
  padding: 8px 16px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.freq-card:hover {
  border-color: var(--text-tertiary);
  color: var(--text-secondary);
}

.freq-option input:checked + .freq-card {
  border-color: var(--neon-violet);
  background: rgba(168,85,247,0.12);
  color: var(--neon-violet);
}

/* ── Wochentag-Selector ────────────────────────────────── */
.weekday-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.weekday-option input {
  display: none;
}

.weekday-card {
  display: block;
  width: 40px;
  text-align: center;
  padding: 8px 0;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.weekday-card:hover {
  border-color: var(--text-tertiary);
  color: var(--text-secondary);
}

.weekday-option input:checked + .weekday-card {
  border-color: var(--neon-magenta);
  background: var(--neon-magenta-soft);
  color: var(--gold);
}

.weekday-option input:disabled + .weekday-card {
  border-color: var(--border-default);
  background: var(--gold-soft);
  color: var(--gold);
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Bestandteile ──────────────────────────────────────── */
.item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  padding: 6px 10px;
}

.drag-handle {
  color: var(--border-strong);
  cursor: grab;
  font-size: 16px;
  padding: 0 4px;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.item-row input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  padding: 4px 0;
}

.drag-ghost {
  opacity: 0.4;
  background: var(--border-default);
}

.add-item-btn {
  margin-top: 4px;
}

/* ── Textarea ──────────────────────────────────────────── */
textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 10px 12px;
  width: 100%;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}

textarea:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px var(--neon-cyan-soft);
}

/* ── Page Header Actions ───────────────────────────────── */
.page-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Modal Checklist ───────────────────────────────────── */
.modal-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: -8px;
}

.modal-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  max-height: 300px;
  overflow-y: auto;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s;
}

.checklist-item:hover {
  border-color: var(--border-strong);
}

.checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--neon-magenta);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 10px;
}

.checklist-title {
  font-size: 16px;
  color: var(--text-secondary);
}

.modal-total {
  text-align: right;
  font-size: 14px;
  color: var(--text-secondary);
  padding-top: 12px;
  border-top: 1px solid var(--border-default);
  margin-bottom: 4px;
}

.modal-total strong {
  color: var(--gold);
  font-size: 16px;
}
/* ── Toast Container ───────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  pointer-events: all;
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-hiding {
  opacity: 0;
  transform: translateY(-8px);
}

/* Toast Typen */
.toast-success {
  border-left: 3px solid var(--status-success);
}

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

.toast-warning {
  border-left: 3px solid var(--status-warning);
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--status-success); }
.toast-error   .toast-icon { color: var(--status-error); }
.toast-warning .toast-icon { color: var(--status-warning); }

.toast-message {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.2s;
}

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

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
  #toast-container {
    top: 16px;      /* NEU */
    right: 16px;
    left: 16px;
  }

  .toast {
    min-width: unset;
    max-width: unset;
    width: 100%;
  }
}
/* ── Inline Toast (kontextbezogen) ────────────────────── */
#inline-toast-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  pointer-events: none;
}

.inline-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  pointer-events: all;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.inline-toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.inline-toast-hiding {
  opacity: 0;
  transform: translateY(-6px);
}

.inline-toast-success {
  border-left: 3px solid var(--status-success);
}

.inline-toast-error {
  border-left: 3px solid var(--status-error);
}

.inline-toast .toast-icon {
  font-size: 16px;
  flex-shrink: 0;
  color: var(--status-success);
}

.inline-toast-error .toast-icon {
  color: var(--status-error);
}

.inline-toast .toast-message {
  flex: 1;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.inline-toast .toast-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.2s;
}

.inline-toast .toast-close:hover {
  color: var(--text-secondary);
}
/* ══════════════════════════════════════════════════════════
   FLOATING ACTION BUTTON
══════════════════════════════════════════════════════════ */

.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--neon-magenta);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 0 20px var(--neon-magenta-glow);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
  background: #ff4590;
  transform: scale(1.08);
  box-shadow: 0 0 28px var(--neon-magenta-glow);
}

.fab-icon {
  font-size: 26px;
  line-height: 1;
  display: block;
  transition: transform 0.3s ease;
}

.fab-rotated {
  transform: rotate(45deg);
}

/* FAB im aktiven Zustand — Modal ist offen */
.fab-active {
  background: #e0266b;
  box-shadow: 0 0 0 3px var(--neon-magenta-glow);
}

/* ══════════════════════════════════════════════════════════
   FAB OVERLAY & MODAL
══════════════════════════════════════════════════════════ */

.fab-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 595;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.fab-overlay.fab-overlay-visible {
  opacity: 1;
  visibility: visible;
}

.fab-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  width: 95%;
  max-width: 460px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
  z-index: 596;
}

.fab-overlay.fab-overlay-visible .fab-modal {
  transform: translateY(0) scale(1);
}

/* ── Modal Header ──────────────────────────────────────── */
.fab-modal-header {
  display: flex;
  align-items: center;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-default);
  gap: 12px;
}

.fab-modal-title {
  flex: 1;
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 600;
}

/* DEPRECATED: .fab-modal-close → use .btn-close instead (F3) */
.fab-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}

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

.fab-back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  transition: color 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.fab-back-btn:hover {
  color: var(--text-primary);
}

/* ── Modal Body ────────────────────────────────────────── */
.fab-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.fab-scroll-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fab-loading {
  color: var(--text-tertiary);
  font-size: 14px;
  text-align: center;
  padding: 24px 0;
}

/* ── Typ-Auswahl Grid ──────────────────────────────────── */
.fab-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 20px;
}

.fab-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  color: inherit;
  text-decoration: none;
}

.fab-type-btn:hover:not(.fab-type-disabled) {
  border-color: var(--neon-violet);
  background: rgba(168,85,247,0.12);
}

.fab-type-disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.fab-type-icon {
  font-size: 24px;
  color: var(--text-secondary);
}

.fab-type-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

.fab-type-soon {
  position: absolute;
  top: 7px;
  right: 7px;
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--border-default);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.04em;
}

/* ── Modal Footer ──────────────────────────────────────── */
.fab-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border-default);
  gap: 12px;
}

.fab-xp-total {
  font-size: 14px;
  color: var(--text-secondary);
}

.fab-xp-total strong {
  color: var(--gold);
  font-size: 16px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .fab {
    bottom: 20px;
    right: 20px;
  }

  .fab-modal {
    width: 100%;
    max-width: 100%;
    border-radius: 14px 14px 0 0;
    position: fixed;
    bottom: calc(56px + env(safe-area-inset-bottom)); /* F6c: über der Bottom Bar */
    left: 0;
    right: 0;
    max-height: calc(85vh - 56px);
    max-height: calc(85dvh - 56px);
    overflow-y: auto; /* F6c: gesamtes Modal scrollbar */
  }

  .fab-step {
    overflow-y: auto; /* F6c: Step-Inhalt scrollbar statt abgeschnitten */
    min-height: 0; /* F6c: flex-child darf schrumpfen */
  }

  .fab-overlay {
    align-items: flex-end;
  }
}
/* ── FAB Kategorie-Item ────────────────────────────────── */
.fab-category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: left;
  width: 100%;
  color: var(--text-secondary);
  font-size: 16px;
}

.fab-category-item:hover {
  border-color: var(--neon-violet);
  background: rgba(168,85,247,0.08);
}

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

.fab-category-name {
  flex: 1;
  font-size: 16px;
}

.fab-category-meta {
  font-size: 14px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
/* ── FAB interner Toast ────────────────────────────────── */
.fab-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.fab-toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.fab-toast-error {
  background: rgba(255,77,106,0.10);
  border: 1px solid rgba(255,77,106,0.25);
  color: var(--status-error);
}

.fab-toast-success {
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.25);
  color: var(--status-success);
}
/* ── Strafen Liste ─────────────────────────────────────── */


/* ══════════════════════════════════════════════════════════════
   F6d — RESPONSIVE LAYOUTS (Layout)
   ══════════════════════════════════════════════════════════════ */

/* ── Tab-Bar: horizontal scroll statt abschneiden ────────── */
/* ── Tab-Bar: Tabs scrollbar, Actions wrappen ────────────── */
@media (max-width: 1024px) {
  .tab-bar {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  /* Tabs-Container: volle Breite → Actions wrappen in Zeile 2 */
  .tab-bar-scroll {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tab-bar-scroll::-webkit-scrollbar {
    display: none;
  }
  .tab-bar-scroll .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Action-Buttons: sichtbar in Zeile 2, links ausgerichtet */
  .tab-bar-action-first,
  .tab-bar-action,
  .tab-bar > .btn,
  .tab-bar > .ml-auto {
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 0; /* F6d: Links statt rechts auf Mobile */
  }
}

/* ── field-row: 2-col → 1-col auf Phone ──────────────────── */
@media (max-width: 480px) {
  .field-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ── Button-Gruppen wrappen ──────────────────────────────── */
@media (max-width: 480px) {
  .routine-card-actions {
    flex-wrap: wrap;
  }
}
