/* ============================================================
   TaskFlow v0.0.12 — assets/css/app.css
   Helles Design + vollständig responsiv
   ============================================================ */

/* ── Variables ──────────────────────────────────────────── */
:root {
  --bg:          #f5f7fa;
  --bg-2:        #ffffff;
  --bg-3:        #f0f2f6;
  --border:      #e2e6ef;
  --border-2:    #d0d6e4;
  --text:        #1a1d2e;
  --text-2:      #4a5068;
  --text-3:      #8b92aa;
  --accent:      #4f6ef7;
  --accent-2:    #3a5be8;
  --accent-light: rgba(79,110,247,.1);
  --accent-glow: rgba(79,110,247,.2);
  --success:     #16a34a;
  --success-bg:  rgba(22,163,74,.1);
  --warning:     #d97706;
  --warning-bg:  rgba(217,119,6,.1);
  --danger:      #dc2626;
  --danger-bg:   rgba(220,38,38,.1);
  --info:        #0891b2;
  --info-bg:     rgba(8,145,178,.1);
  --header-h:    58px;
  --sidebar-w:   240px;
  --footer-h:    48px;
  --mobile-nav-h: 60px;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 4px 24px rgba(0,0,0,.08);
  --shadow-sm:   0 1px 4px rgba(0,0,0,.07);
  --shadow-md:   0 4px 16px rgba(0,0,0,.1);
  --font:        'Space Grotesk', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
  --transition:  .16s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-3); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── TOP HEADER ─────────────────────────────────────────── */
.tf-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.tf-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: calc(var(--sidebar-w) - 16px);
}

.tf-logo-icon { width: 32px; height: 32px; flex-shrink: 0; }
.tf-logo-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--text);
}

/* Hamburger (nur mobile/tablet) */
.tf-hamburger {
  display: none;
  width: 38px; height: 38px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: background var(--transition);
  flex-shrink: 0;
}
.tf-hamburger:hover { background: var(--bg-3); }
.tf-hamburger svg { width: 22px; height: 22px; }

.tf-header__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.tf-header__nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.tf-header__nav-link:hover { color: var(--text); background: var(--bg-3); }
.tf-header__nav-link.active { color: var(--accent); background: var(--accent-light); font-weight: 600; }

.tf-header__right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.tf-header__icon-btn {
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--transition);
  text-decoration: none;
}
.tf-header__icon-btn svg { width: 18px; height: 18px; }
.tf-header__icon-btn:hover { background: var(--bg-3); color: var(--text); }
.tf-header__logout:hover { color: var(--danger); }

.tf-header__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .75rem;
  color: #fff;
  overflow: hidden;
  border: 2px solid var(--border);
  transition: border-color var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}
.tf-header__avatar:hover { border-color: var(--accent); }
.tf-header__avatar img { width: 100%; height: 100%; object-fit: cover; }

.tf-header__user-info { display: flex; flex-direction: column; gap: 1px; }
.tf-header__username { font-size: .8rem; font-weight: 600; color: var(--text); line-height: 1; }

.tf-role-badge {
  display: inline-block;
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--rc, #6b7280) 15%, transparent);
  color: var(--rc, #6b7280);
  border: 1px solid color-mix(in srgb, var(--rc, #6b7280) 30%, transparent);
  line-height: 1.4;
  letter-spacing: .3px;
  text-transform: uppercase;
}

/* ── LAYOUT ─────────────────────────────────────────────── */
.tf-layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
}

/* ── SIDEBAR ────────────────────────────────────────────── */
.tf-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: var(--footer-h);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  z-index: 900;
}

/* Sidebar-Overlay (Mobile) */
.tf-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 899;
}
.tf-sidebar-overlay.active { display: block; }

.tf-sidebar.collapsed { width: 56px; }
.tf-sidebar.collapsed .tf-sidebar__section-title,
.tf-sidebar.collapsed .tf-sidebar__link span,
.tf-sidebar.collapsed .tf-sidebar__link > *:not(svg) { display: none; }
.tf-sidebar.collapsed .tf-sidebar__link { padding: 10px; justify-content: center; }

.tf-sidebar__nav { flex: 1; padding: 12px 0; }
.tf-sidebar__section { margin-bottom: 8px; }

.tf-sidebar__section-title {
  display: block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 16px 4px;
}

.tf-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}
.tf-sidebar__link svg { width: 18px; height: 18px; flex-shrink: 0; }
.tf-sidebar__link:hover { color: var(--text); background: var(--bg-3); }
.tf-sidebar__link.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}
.tf-sidebar__link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.tf-sidebar__toggle {
  margin: 12px auto;
  width: 32px; height: 32px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--transition);
}
.tf-sidebar__toggle svg { width: 16px; height: 16px; }
.tf-sidebar__toggle:hover { color: var(--text); border-color: var(--border-2); }

/* ── MAIN CONTENT ───────────────────────────────────────── */
.tf-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 24px 24px calc(var(--footer-h) + 24px);
  min-width: 0;
  transition: margin-left var(--transition);
}

body.sidebar-collapsed .tf-content { margin-left: 56px; }

/* ── FOOTER ─────────────────────────────────────────────── */
.tf-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  z-index: 800;
}
.tf-footer__inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 20px;
  gap: 16px;
}
.tf-footer__left { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.tf-footer__brand { font-weight: 700; color: var(--text); font-size: .875rem; }
.tf-footer__version { font-size: .7rem; color: var(--text-3); font-family: var(--font-mono); }
.tf-footer__links { display: flex; gap: 16px; flex: 1; justify-content: center; }
.tf-footer__links a { font-size: .8rem; color: var(--text-3); transition: color var(--transition); }
.tf-footer__links a:hover { color: var(--text); }
.tf-footer__right { font-size: .75rem; color: var(--text-3); min-width: 200px; text-align: right; }

/* ── MOBILE BOTTOM NAV ──────────────────────────────────── */
.tf-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  z-index: 1000;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.tf-mobile-nav__inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 100%;
}
.tf-mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: .65rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
  padding: 6px 0;
}
.tf-mobile-nav__item svg { width: 22px; height: 22px; }
.tf-mobile-nav__item.active { color: var(--accent); }
.tf-mobile-nav__item:hover { color: var(--text-2); }
.tf-mobile-nav__item .tf-badge-unread {
  position: absolute;
  top: 4px; right: calc(50% - 18px);
}

/* ── FLASH MESSAGES ─────────────────────────────────────── */
.tf-flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 15px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid;
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

.tf-flash--success { background: var(--success-bg); border-color: rgba(22,163,74,.25); color: var(--success); }
.tf-flash--error   { background: var(--danger-bg);  border-color: rgba(220,38,38,.25);  color: var(--danger); }
.tf-flash--warning { background: var(--warning-bg); border-color: rgba(217,119,6,.25); color: var(--warning); }
.tf-flash--info    { background: var(--info-bg);    border-color: rgba(8,145,178,.25);  color: var(--info); }

.tf-flash__close {
  background: none; border: none; cursor: pointer; color: inherit; opacity: .6;
  font-size: 1.1rem; line-height: 1; padding: 0 4px;
}
.tf-flash__close:hover { opacity: 1; }

/* ── BADGES ─────────────────────────────────────────────── */
.tf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--bg-3);
  color: var(--text-2);
  border-radius: 100px;
  font-size: .65rem;
  font-weight: 700;
  border: 1px solid var(--border);
}
.tf-badge-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  border-radius: 100px;
  font-size: .65rem;
  font-weight: 700;
}

/* ── CARDS ──────────────────────────────────────────────── */
.tf-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.tf-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.tf-card__title { font-size: 1rem; font-weight: 600; color: var(--text); }

/* ── PAGE HEADER ────────────────────────────────────────── */
.tf-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.tf-page-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.5px;
}
.tf-page-subtitle { font-size: .875rem; color: var(--text-2); margin-top: 2px; }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font);
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; box-shadow: 0 2px 8px var(--accent-glow); }
.btn-secondary { background: var(--bg-3); color: var(--text); border: 1px solid var(--border-2); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.btn-danger    { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(220,38,38,.25); }
.btn-danger:hover { background: rgba(220,38,38,.2); }
.btn-success   { background: var(--success-bg); color: var(--success); border: 1px solid rgba(22,163,74,.25); }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-xs { padding: 3px 8px; font-size: .75rem; }
.btn-icon { padding: 7px; }

/* ── FORMS ──────────────────────────────────────────────── */
.tf-form-group { margin-bottom: 16px; }
.tf-label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; letter-spacing: .2px; }
.tf-label .required { color: var(--danger); margin-left: 2px; }

.tf-input, .tf-select, .tf-textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: .875rem;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.tf-input:focus, .tf-select:focus, .tf-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-2);
}
.tf-input::placeholder, .tf-textarea::placeholder { color: var(--text-3); }
.tf-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.tf-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tf-form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── TABLES ─────────────────────────────────────────────── */
.tf-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tf-table th {
  background: var(--bg-3);
  color: var(--text-2);
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
.tf-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.tf-table tr:last-child td { border-bottom: none; }
.tf-table tr:hover td { background: var(--bg-3); }

/* Responsive table wrapper */
.tf-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── PRIORITY / STATUS BADGES ───────────────────────────── */
.priority-low    { color: var(--text-3); }
.priority-medium { color: var(--info); }
.priority-high   { color: var(--warning); }
.priority-urgent { color: var(--danger); font-weight: 700; }

.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 100px;
  font-size: .72rem; font-weight: 600;
}
.status-open        { background: rgba(100,116,139,.12); color: var(--text-2); border: 1px solid var(--border-2); }
.status-in_progress { background: var(--accent-light);   color: var(--accent);  border: 1px solid rgba(79,110,247,.25); }
.status-review      { background: var(--warning-bg);     color: var(--warning); border: 1px solid rgba(217,119,6,.25); }
.status-done        { background: var(--success-bg);     color: var(--success); border: 1px solid rgba(22,163,74,.25); }
.status-cancelled   { background: var(--danger-bg);      color: var(--danger);  border: 1px solid rgba(220,38,38,.25); }

/* ── MODAL ──────────────────────────────────────────────── */
.tf-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.tf-modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-md);
  animation: modalSlide .15s ease;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes modalSlide { from { transform: scale(.97) translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

.tf-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-2);
}
.tf-modal__title { font-size: 1rem; font-weight: 700; color: var(--text); }
.tf-modal__close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 1.4rem; line-height: 1;
  padding: 0 4px; transition: color var(--transition);
  flex-shrink: 0;
}
.tf-modal__close:hover { color: var(--text); }
.tf-modal__body { padding: 20px; }
.tf-modal__footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: var(--bg-2);
}

/* ── TABS ───────────────────────────────────────────────── */
.tf-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tf-tabs::-webkit-scrollbar { display: none; }

.tf-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: .875rem; font-weight: 500;
  font-family: var(--font);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.tf-tab:hover { color: var(--text); }
.tf-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tf-tab-panel { display: none; }
.tf-tab-panel.active { display: block; }

/* ── GRID LAYOUTS ───────────────────────────────────────── */
.tf-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tf-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.tf-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── STAT CARDS ─────────────────────────────────────────── */
.tf-stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}
.tf-stat__label { font-size: .72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; }
.tf-stat__value { font-size: 1.7rem; font-weight: 700; color: var(--text); letter-spacing: -1px; }
.tf-stat__delta { font-size: .8rem; color: var(--text-2); }

/* ── CHANGELOG ──────────────────────────────────────────── */
.tf-changelog-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.tf-changelog-entry__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--bg-2);
  cursor: pointer;
  user-select: none;
  gap: 12px;
}
.tf-changelog-entry__header:hover { background: var(--bg-3); }
.tf-changelog-entry__ver { font-family: var(--font-mono); font-weight: 700; color: var(--accent); font-size: .875rem; }
.tf-changelog-entry__date { font-size: .8rem; color: var(--text-3); }
.tf-changelog-entry__toggle { width: 18px; height: 18px; color: var(--text-3); transition: transform var(--transition); flex-shrink: 0; }
.tf-changelog-entry.open .tf-changelog-entry__toggle { transform: rotate(180deg); }
.tf-changelog-entry__body {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
  background: var(--bg);
}
.tf-changelog-entry.open .tf-changelog-entry__body {
  max-height: 9999px;
  padding: 16px;
  border-top: 1px solid var(--border);
}
.tf-changelog-entry__body ul { padding-left: 18px; }
.tf-changelog-entry__body li { margin-bottom: 6px; color: var(--text-2); font-size: .875rem; }
.tf-changelog-entry__body li::marker { color: var(--accent); }

.tf-changelog-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: .68rem;
  font-weight: 700;
  margin-right: 4px;
  text-transform: uppercase;
}
.tf-changelog-tag--new     { background: var(--success-bg); color: var(--success); }
.tf-changelog-tag--fix     { background: var(--danger-bg);  color: var(--danger); }
.tf-changelog-tag--change  { background: var(--warning-bg); color: var(--warning); }
.tf-changelog-tag--security{ background: var(--info-bg);    color: var(--info); }

/* ── KANBAN ─────────────────────────────────────────────── */
.tf-kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; min-height: 400px; -webkit-overflow-scrolling: touch; }
.tf-kanban-col {
  min-width: 272px; max-width: 290px; flex-shrink: 0;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.tf-kanban-col__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 13px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .875rem; background: var(--bg-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.tf-kanban-col__body { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 7px; min-height: 60px; }
.tf-kanban-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px;
  cursor: grab;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.tf-kanban-card:hover { border-color: var(--accent); box-shadow: 0 2px 10px var(--accent-glow); }
.tf-kanban-card.dragging { opacity: .5; }
.tf-kanban-card__title { font-size: .875rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.tf-kanban-card__meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* ── CALENDAR ───────────────────────────────────────────── */
.tf-cal { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.tf-cal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.tf-cal__title { font-size: 1.05rem; font-weight: 700; }
.tf-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.tf-cal__day-name {
  padding: 8px; text-align: center;
  font-size: .7rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.tf-cal__cell {
  min-height: 82px; padding: 5px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition);
}
.tf-cal__cell:hover { background: var(--bg-3); }
.tf-cal__cell:nth-child(7n) { border-right: none; }
.tf-cal__cell-num {
  font-size: .78rem; font-weight: 600; color: var(--text-2);
  display: inline-flex; width: 24px; height: 24px;
  align-items: center; justify-content: center;
  border-radius: 50%;
}
.tf-cal__cell.today .tf-cal__cell-num { background: var(--accent); color: #fff; }
.tf-cal__cell.other-month .tf-cal__cell-num { color: var(--border-2); }
.tf-cal__event {
  display: block; padding: 1px 5px;
  border-radius: 3px; font-size: .68rem;
  font-weight: 600; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--accent-light); color: var(--accent);
  border-left: 2px solid var(--accent);
}

/* ── CHAT ───────────────────────────────────────────────── */
.tf-chat {
  display: grid;
  grid-template-columns: 220px 1fr 180px;
  height: calc(100vh - var(--header-h) - var(--footer-h) - 48px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: var(--shadow-sm);
}
.tf-chat__sidebar {
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg-3);
}
.tf-chat__sidebar-header {
  padding: 13px 13px 10px;
  font-weight: 700; font-size: .875rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-2);
}
.tf-chat__channels { flex: 1; overflow-y: auto; padding: 6px 0; }
.tf-chat__channel {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; cursor: pointer; font-size: .875rem;
  color: var(--text-2); transition: all var(--transition);
}
.tf-chat__channel:hover { background: var(--bg-2); color: var(--text); }
.tf-chat__channel.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.tf-chat__channel-icon { width: 18px; height: 18px; flex-shrink: 0; }
.tf-chat__channel-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-chat__main { display: flex; flex-direction: column; overflow: hidden; }
.tf-chat__header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-weight: 600; display: flex; align-items: center; gap: 10px;
  background: var(--bg-2);
}
.tf-chat__messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.tf-chat__msg { display: flex; gap: 9px; }
.tf-chat__msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.tf-chat__msg-body { flex: 1; min-width: 0; }
.tf-chat__msg-meta { display: flex; align-items: baseline; gap: 7px; margin-bottom: 2px; }
.tf-chat__msg-name { font-weight: 700; font-size: .875rem; color: var(--text); }
.tf-chat__msg-time { font-size: .68rem; color: var(--text-3); }
.tf-chat__msg-text { font-size: .875rem; color: var(--text-2); line-height: 1.55; word-break: break-word; }
.tf-chat__input-area {
  padding: 10px 14px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--bg-2);
}
.tf-chat__input {
  flex: 1;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--font);
  font-size: .875rem;
  outline: none;
  resize: none;
  max-height: 120px;
  transition: border-color var(--transition);
}
.tf-chat__input:focus { border-color: var(--accent); background: var(--bg-2); }
.tf-chat__input::placeholder { color: var(--text-3); }
/* ── Chat: Mitglieder-Sidebar (rechts) ──────────────────── */
.tf-chat__members {
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-2);
}
.tf-chat__member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
  margin: 1px 6px;
  transition: background .12s;
}
.tf-chat__member-row:hover { background: var(--bg-3); }
.tf-chat__member-avatar {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .62rem;
  font-weight: 700;
  flex-shrink: 0;
}
.tf-chat__member-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-2);
  box-shadow: 0 0 0 1px var(--bg-2);
}
.tf-chat__member-status.online  { background: #22c55e; box-shadow: 0 0 0 1px var(--bg-2), 0 0 4px #22c55e88; }
.tf-chat__member-status.offline { background: #6b7280; opacity: .5; }
.tf-chat__member-name {
  font-size: .78rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}
.tf-chat__member-dm-icon {
  width: 12px;
  height: 12px;
  color: var(--text-3);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .12s;
}
.tf-chat__member-row:hover .tf-chat__member-dm-icon { opacity: 1; }


/* ── UTILITY ────────────────────────────────────────────── */
.text-muted   { color: var(--text-2); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-sm      { font-size: .82rem; }
.text-xs      { font-size: .72rem; }
.font-mono    { font-family: var(--font-mono); }
.flex         { display: flex; }
.flex-1       { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.p-0 { padding: 0; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-3); font-size: .9rem; }
.empty-state svg { width: 44px; height: 44px; margin-bottom: 10px; opacity: .35; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── PROGRESS BAR ───────────────────────────────────────── */
.tf-progress { height: 6px; background: var(--bg-3); border-radius: 100px; overflow: hidden; }
.tf-progress__bar { height: 100%; background: var(--accent); border-radius: 100px; transition: width .3s ease; }

/* ══ RESPONSIVE ═════════════════════════════════════════════ */

/* ── Tablet (≤ 960px) ────────────────────────────────────── */
@media (max-width: 960px) {
  .tf-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .tf-sidebar.mobile-open {
    transform: none;
    box-shadow: var(--shadow-md);
  }
  .tf-content { margin-left: 0 !important; }
  body.sidebar-collapsed .tf-content { margin-left: 0; }
  .tf-grid-3, .tf-grid-4 { grid-template-columns: 1fr 1fr; }
  .tf-header__nav { display: none; }
  .tf-hamburger { display: flex; }
  .tf-header__brand { min-width: 0; }
  .tf-header__user-info { display: none; }
  .tf-sidebar__toggle { display: none; }
}

/* ── Mobile (≤ 640px) ────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --header-h: 52px; }
  .tf-content { padding: 16px 14px calc(var(--mobile-nav-h) + 20px); }
  .tf-grid-2, .tf-grid-3, .tf-grid-4 { grid-template-columns: 1fr; }
  .tf-form-row, .tf-form-row-3 { grid-template-columns: 1fr; }
  .tf-page-title { font-size: 1.2rem; }
  .tf-footer { display: none; }
  .tf-mobile-nav { display: flex; flex-direction: column; }
  .tf-layout { min-height: calc(100vh - var(--header-h) - var(--mobile-nav-h)); }

  /* Chat auf Mobile: Sidebar versteckt, nur Main sichtbar */
  .tf-chat { grid-template-columns: 1fr; height: calc(100vh - var(--header-h) - var(--mobile-nav-h) - 32px); }
  .tf-chat__sidebar { display: none; }
  .tf-chat__sidebar.mobile-chat-open { display: flex; position: absolute; left: 0; top: 0; bottom: 0; width: 80%; z-index: 100; }
  .tf-chat__members { display: none; }
  #mobileChatBtn { display: flex !important; }

  /* Kalender: Ebenen-Sidebar unter Kalender auf Mobile */
  .tf-cal-layout { grid-template-columns: 1fr !important; }
  .tf-cal-layout > div:first-child { order: 2; display: flex; gap: 8px; flex-wrap: wrap; }
  .tf-cal-layout > div:first-child .tf-card:last-child { display: none; }

  /* Kalender-Zellen kleiner */
  .tf-cal__cell { min-height: 52px; }
  .tf-cal__cell-num { font-size: .72rem; width: 20px; height: 20px; }

  /* Tabellen scrollbar */
  .tf-card.p-0 { overflow-x: auto; }

  .tf-page-header { gap: 10px; }
  .tf-modal { max-height: 85vh; }
}

/* ── Sehr kleine Screens (≤ 380px) ──────────────────────── */
@media (max-width: 380px) {
  .tf-mobile-nav__item span { display: none; }
  .tf-mobile-nav__inner { grid-template-columns: repeat(5, 1fr); }
  .tf-mobile-nav__item svg { width: 24px; height: 24px; }
}
