/* ═══════════════════════════════════════════════════════════════════════════
   Kanban Board — Stylesheet
   Modernes Design mit Dark Mode, vollständig responsiv
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Reset & Custom Properties ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --c-bg:         #f1f5f9;
  --c-surface:    #ffffff;
  --c-surface2:   #f8fafc;
  --c-border:     #e2e8f0;
  --c-border2:    #cbd5e1;
  --c-text:       #0f172a;
  --c-text2:      #475569;
  --c-text3:      #94a3b8;
  --c-primary:    #4f46e5;
  --c-primary-h:  #4338ca;
  --c-danger:     #ef4444;
  --c-success:    #10b981;
  --c-warning:    #f59e0b;
  --c-sidebar-bg: #1e1b4b;
  --c-sidebar-t:  rgba(255,255,255,0.85);
  --c-sidebar-t2: rgba(255,255,255,0.5);
  --c-header-bg:  #ffffff;
  --c-col:        #f1f5f9;
  --c-col-h:      #e2e8f0;
  --c-card:       #ffffff;
  --c-card-h:     #f8fafc;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:       0 4px 12px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:    0 20px 40px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.1);
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    16px;
  --transition:   0.15s ease;
  --col-width:    300px;
  --header-h:     56px;
  --sidebar-w:    260px;
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}

[data-theme="dark"] {
  --c-bg:         #0f172a;
  --c-surface:    #1e293b;
  --c-surface2:   #253148;
  --c-border:     #334155;
  --c-border2:    #475569;
  --c-text:       #f1f5f9;
  --c-text2:      #94a3b8;
  --c-text3:      #64748b;
  --c-sidebar-bg: #0f172a;
  --c-header-bg:  #1e293b;
  --c-col:        #1e293b;
  --c-col-h:      #253148;
  --c-card:       #253148;
  --c-card-h:     #2d3d56;
  --shadow:       0 4px 12px rgba(0,0,0,.3);
  --shadow-lg:    0 20px 40px rgba(0,0,0,.5);
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

button { cursor: pointer; border: none; background: none; }

/* ─── Loader ──────────────────────────────────────────────────────────────── */
#app-loader {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #1e1b4b, #312e81, #1e40af);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.loader-content { text-align: center; color: white; }
.loader-logo { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1rem; }
.loader-logo svg { width: 48px; height: 48px; }
.loader-text { font-size: 1.75rem; font-weight: 800; margin-bottom: 1.5rem; }
.loader-spinner {
  width: 32px; height: 32px; margin: 0 auto;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Auth Screen ─────────────────────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e40af 100%);
  padding: 1.5rem;
}
.auth-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 2rem;
}
.auth-logo-icon {
  width: 52px; height: 52px; flex-shrink: 0;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.auth-logo-icon svg { width: 32px; height: 32px; }
.auth-logo h1 { font-size: 1.4rem; font-weight: 800; color: var(--c-text); }
.auth-logo p  { font-size: .875rem; color: var(--c-text2); }
.auth-tabs { display: flex; border-bottom: 2px solid var(--c-border); margin-bottom: 1.5rem; }
.auth-tab {
  flex: 1; padding: .625rem; font-weight: 600; color: var(--c-text2);
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: var(--transition);
  font-size: .9rem;
}
.auth-tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.auth-form .field { margin-bottom: .875rem; }
.auth-form label  { display: block; font-size: .85rem; font-weight: 600; color: var(--c-text); margin-bottom: .375rem; }
.auth-form input  {
  width: 100%; padding: .625rem .875rem;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  transition: border-color var(--transition);
  outline: none;
}
.auth-form input:focus { border-color: var(--c-primary); }
.input-eye { position: relative; }
.input-eye input { padding-right: 2.5rem; }
.eye-btn { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); color: var(--c-text2); padding: .25rem; }
.auth-error { padding: .625rem .875rem; background: #fef2f2; color: #991b1b; border-radius: var(--radius-sm); font-size: .875rem; margin-bottom: .875rem; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .875rem;
  transition: all var(--transition); cursor: pointer;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--c-primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--c-primary-h); }
.btn-ghost { background: transparent; color: var(--c-text2); border: 1.5px solid var(--c-border); }
.btn-ghost:hover { background: var(--c-surface2); color: var(--c-text); }
.btn-ghost.active { background: var(--c-surface2); color: var(--c-primary); border-color: var(--c-primary); }
.btn-danger { background: var(--c-danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-link { background: none; color: var(--c-primary); font-size: .8rem; padding: .25rem; }
.btn-link:hover { text-decoration: underline; }
.btn-link.xs { font-size: .75rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: .375rem .75rem; font-size: .8rem; }
.btn-xs { padding: .25rem .5rem; font-size: .75rem; }

.btn-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--c-text2);
  transition: all var(--transition); position: relative;
}
.btn-icon:hover { background: var(--c-surface2); color: var(--c-text); }
.btn-icon.xs  { width: 24px; height: 24px; font-size: .75rem; }
.btn-icon.danger:hover { background: #fef2f2; color: var(--c-danger); }

/* ─── Header ──────────────────────────────────────────────────────────────── */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--c-header-bg);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: .5rem;
  padding: 0 1rem;
  box-shadow: var(--shadow-sm);
}
.header-left  { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.header-center { flex: 1; max-width: 480px; margin: 0 auto; }
.header-right { display: flex; align-items: center; gap: .25rem; flex: 0 0 auto; margin-left: auto; }
.sidebar-toggle { display: none; }

.app-brand {
  display: flex; align-items: center; gap: .5rem;
  cursor: pointer; padding: .375rem .5rem;
  border-radius: var(--radius-sm);
  font-weight: 800; font-size: 1rem; color: var(--c-primary);
  transition: background var(--transition);
}
.app-brand:hover { background: var(--c-surface2); }
.app-brand svg { width: 20px; height: 20px; fill: var(--c-primary); }

.breadcrumb { display: flex; align-items: center; gap: .5rem; }
.breadcrumb-sep { color: var(--c-text3); font-size: .75rem; }
.breadcrumb-board { font-weight: 600; color: var(--c-text); font-size: .9rem; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Search */
.search-box {
  position: relative;
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: 20px;
  display: flex; align-items: center; gap: .5rem;
  padding: .375rem .75rem;
  transition: all var(--transition);
}
.search-box.active { border-color: var(--c-primary); background: var(--c-surface); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.search-icon { color: var(--c-text3); font-size: .8rem; flex-shrink: 0; }
.search-input {
  background: none; border: none; outline: none;
  width: 100%; color: var(--c-text); font-size: .875rem;
}
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 300px; overflow-y: auto;
  z-index: 200;
}
.search-result {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .625rem .875rem; cursor: pointer;
  transition: background var(--transition);
}
.search-result:hover { background: var(--c-surface2); }
.search-result-title { font-size: .875rem; font-weight: 600; color: var(--c-text); }
.search-result-meta  { font-size: .75rem; color: var(--c-text2); }
.search-empty, .search-loading { padding: 1rem; text-align: center; color: var(--c-text2); font-size: .875rem; }
.priority-dot { margin-top: 3px; font-size: .7rem; flex-shrink: 0; }

/* Notifications */
.notif-wrap  { position: relative; }
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 340px; background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200; max-height: 400px;
  overflow-y: auto;
}
.notif-header {
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700;
}
.notif-item {
  display: flex; gap: .75rem;
  padding: .75rem 1rem;
  transition: background var(--transition);
}
.notif-item.unread { background: rgba(79,70,229,.05); }
.notif-item:hover { background: var(--c-surface2); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-primary); margin-top: 6px; flex-shrink: 0; }
.notif-item:not(.unread) .notif-dot { background: var(--c-text3); }
.notif-title { font-weight: 600; font-size: .875rem; }
.notif-msg   { font-size: .8rem; color: var(--c-text2); }
.notif-time  { font-size: .75rem; color: var(--c-text3); }
.notif-empty { padding: 2rem; text-align: center; color: var(--c-text2); font-size: .875rem; }

/* Badge */
.badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--c-danger); color: white;
  font-size: .65rem; font-weight: 800;
  min-width: 18px; height: 18px;
  border-radius: 9px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--c-header-bg);
}

/* User Menu */
.user-menu-wrap { position: relative; }
.user-avatar-btn { padding: .25rem; border-radius: 50%; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 260px; background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 200;
}
.user-menu-header {
  display: flex; gap: .875rem; align-items: center;
  padding: 1rem;
}
.user-menu-name  { font-weight: 700; font-size: .9rem; }
.user-menu-email { font-size: .8rem; color: var(--c-text2); }
.user-menu-role  { font-size: .75rem; color: var(--c-primary); font-weight: 600; margin-top: 2px; }
.user-menu-divider { height: 1px; background: var(--c-border); margin: .25rem 0; }
.user-menu-item {
  width: 100%; padding: .625rem 1rem;
  text-align: left; display: flex; align-items: center; gap: .75rem;
  font-size: .875rem; color: var(--c-text);
  transition: background var(--transition);
}
.user-menu-item:hover { background: var(--c-surface2); }
.user-menu-item.danger { color: var(--c-danger); }
.user-menu-item i { width: 16px; text-align: center; }

/* ─── Layout ──────────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  padding-top: var(--header-h);
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--c-sidebar-bg);
  overflow-y: auto;
  transition: width var(--transition), transform var(--transition);
  display: flex; flex-direction: column;
  padding: 1rem .75rem;
  gap: .25rem;
}

.app-layout.sidebar-closed .sidebar {
  width: 0;
  overflow: hidden;
  padding: 0;
}

.main-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Sidebar */
.sidebar-section { margin-bottom: .75rem; }
.sidebar-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--c-sidebar-t2);
  padding: .5rem .75rem .375rem;
}
.sidebar-new-board {
  width: 100%; padding: .625rem .875rem;
  border-radius: var(--radius-sm);
  color: white; font-weight: 600; font-size: .875rem;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; gap: .625rem;
  transition: background var(--transition);
}
.sidebar-new-board:hover { background: rgba(255,255,255,.2); }
.sidebar-board-item {
  width: 100%; padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: .625rem;
  color: var(--c-sidebar-t);
  transition: background var(--transition);
  font-size: .875rem;
}
.sidebar-board-item:hover { background: rgba(255,255,255,.1); }
.sidebar-board-item.active { background: rgba(255,255,255,.15); color: white; }
.sidebar-board-color { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.sidebar-board-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-board-count {
  font-size: .7rem; background: rgba(255,255,255,.2);
  padding: 1px 6px; border-radius: 10px; color: white;
}

/* ─── Dashboard ───────────────────────────────────────────────────────────── */
.dashboard {
  padding: 2rem 2.5rem;
  overflow-y: auto;
  height: 100%;
}
.dashboard-header { margin-bottom: 2rem; }
.dashboard-header h2 { font-size: 1.75rem; font-weight: 800; }
.dashboard-header p { color: var(--c-text2); }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.section-title h3 { font-size: 1rem; font-weight: 700; }

.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.board-card {
  border-radius: var(--radius);
  min-height: 120px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.board-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.board-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.1), rgba(0,0,0,.5));
  padding: 1rem;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.board-card-title { font-size: 1rem; font-weight: 800; color: white; margin-bottom: .375rem; }
.board-card-meta  { display: flex; gap: 1rem; font-size: .75rem; color: rgba(255,255,255,.8); }
.board-card-meta span { display: flex; align-items: center; gap: .375rem; }
.board-card-new {
  border: 2px dashed var(--c-border2);
  background: none !important;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; color: var(--c-text2); font-size: .875rem; font-weight: 600;
}
.board-card-new:hover { border-color: var(--c-primary); color: var(--c-primary); background: rgba(79,70,229,.04) !important; }
.board-card-new i { font-size: 1.5rem; }

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--c-text2);
}
.empty-icon { font-size: 4rem; color: var(--c-text3); margin-bottom: 1.5rem; display: block; }
.empty-state h3 { font-size: 1.25rem; font-weight: 700; color: var(--c-text); margin-bottom: .5rem; }
.empty-state p  { margin-bottom: 1.5rem; }

/* ─── Board View ──────────────────────────────────────────────────────────── */
.board-view {
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
}

.board-toolbar {
  padding: .875rem 1.25rem;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-shrink: 0;
}
.board-toolbar-left  { display: flex; align-items: center; gap: .75rem; }
.board-toolbar-right { display: flex; align-items: center; gap: .625rem; }
.board-title { font-size: 1.1rem; font-weight: 800; color: var(--c-text); }

/* Filter */
.filter-wrap { position: relative; }
.filter-panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  width: 240px; background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .875rem; z-index: 150;
}
.filter-row { margin-bottom: .75rem; }
.filter-row label { display: block; font-size: .8rem; font-weight: 600; color: var(--c-text2); margin-bottom: .375rem; }
.filter-row select { width: 100%; padding: .375rem .625rem; border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-text); font-size: .85rem; }
.filter-actions { text-align: right; padding-top: .375rem; border-top: 1px solid var(--c-border); }
.filter-badge { display: inline-block; width: 8px; height: 8px; background: var(--c-warning); border-radius: 50%; margin-left: 4px; vertical-align: middle; }

.member-stack { display: flex; align-items: center; gap: -4px; }
.member-stack .avatar { margin-right: -6px; border: 2px solid var(--c-surface); }

/* ─── Columns ─────────────────────────────────────────────────────────────── */
.board-columns-wrap {
  flex: 1; overflow-x: auto; overflow-y: hidden;
  padding: 1rem 1.25rem 1.5rem;
}
.board-columns {
  display: flex; gap: .875rem;
  height: 100%;
  align-items: flex-start;
  min-width: max-content;
}

.column {
  width: var(--col-width);
  flex-shrink: 0;
  background: var(--c-col);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  max-height: 100%;
  transition: box-shadow var(--transition);
}
.column.column-new {
  background: rgba(0,0,0,.04);
  border: 2px dashed var(--c-border);
}
[data-theme="dark"] .column.column-new { background: rgba(255,255,255,.03); }

.column-header {
  padding: .625rem .75rem;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: var(--radius) var(--radius) 0 0;
  border-top: 3px solid transparent;
  flex-shrink: 0;
}
.column-header-left { display: flex; align-items: center; gap: .5rem; flex: 1; overflow: hidden; }
.column-title { font-weight: 700; font-size: .9rem; color: var(--c-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: default; }
.column-count {
  font-size: .75rem; background: var(--c-surface);
  padding: 1px 7px; border-radius: 10px; color: var(--c-text2);
  font-weight: 600; flex-shrink: 0;
}
.wip-warning { color: var(--c-warning); font-size: .8rem; }
.column-actions { flex-shrink: 0; }
.col-title-input {
  font-weight: 700; font-size: .9rem; color: var(--c-text);
  background: var(--c-surface); border: 1.5px solid var(--c-primary);
  border-radius: 4px; padding: .125rem .375rem; outline: none;
  width: 100%;
}

.column-tasks {
  flex: 1; overflow-y: auto;
  padding: .375rem .5rem;
  min-height: 48px;
  display: flex; flex-direction: column; gap: .5rem;
}
.column-tasks::-webkit-scrollbar { width: 4px; }
.column-tasks::-webkit-scrollbar-thumb { background: var(--c-border2); border-radius: 2px; }

.col-add-task {
  padding: .5rem .75rem;
  color: var(--c-text2); font-size: .8rem; font-weight: 600;
  display: flex; align-items: center; gap: .5rem;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.col-add-task:hover { background: var(--c-col-h); color: var(--c-text); }

/* Quick-Add */
.quick-add-form { padding: .375rem 0; }
.quick-add-input {
  width: 100%; padding: .5rem .625rem;
  border: 1.5px solid var(--c-primary);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  resize: none; outline: none;
  font-size: .875rem;
}
.quick-add-actions { display: flex; gap: .375rem; margin-top: .375rem; }

/* New Column */
.new-col-form { padding: .75rem; }
.new-col-input {
  width: 100%; padding: .5rem .75rem;
  border: 1.5px solid var(--c-primary);
  border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-text);
  margin-bottom: .5rem; outline: none;
}
.new-col-actions { display: flex; gap: .375rem; }
.add-column-btn {
  width: 100%; padding: .75rem; color: var(--c-text2);
  font-size: .875rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  transition: all var(--transition);
}
.add-column-btn:hover { background: rgba(79,70,229,.08); color: var(--c-primary); }

/* ─── Task Cards ──────────────────────────────────────────────────────────── */
.task-card {
  background: var(--c-card);
  border-radius: var(--radius-sm);
  padding: .625rem .75rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-border);
  transition: box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
  user-select: none;
}
.task-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  border-color: var(--c-border2);
}
.task-card.completed { opacity: .6; }
.task-card.overdue { border-left: 3px solid var(--c-danger); }

.task-cover { height: 36px; margin: -.625rem -.75rem .625rem; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }

.task-labels { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: .375rem; }
.task-label  {
  height: 8px; min-width: 36px; border-radius: 4px;
  opacity: .85;
}

.task-title {
  font-size: .875rem; font-weight: 600; color: var(--c-text);
  line-height: 1.4; margin-bottom: .375rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-card.completed .task-title { text-decoration: line-through; }

.task-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  font-size: .75rem;
}
.task-due {
  display: flex; align-items: center; gap: .25rem;
  background: var(--c-surface2);
  padding: .125rem .5rem; border-radius: 10px; color: var(--c-text2);
}
.task-due.overdue { background: #fef2f2; color: var(--c-danger); }
.task-due.soon    { background: #fffbeb; color: var(--c-warning); }
[data-theme="dark"] .task-due.overdue { background: rgba(239,68,68,.2); }
[data-theme="dark"] .task-due.soon    { background: rgba(245,158,11,.2); }
.task-checklist, .task-comments, .task-attach {
  display: flex; align-items: center; gap: .25rem;
  color: var(--c-text2);
}
.task-checklist.done { color: var(--c-success); }
.task-assignees { display: flex; align-items: center; margin-left: auto; }
.task-assignees .avatar { margin-right: -5px; }
.avatar-more { font-size: .65rem; color: var(--c-text2); margin-left: 8px; }

/* Drag & Drop */
.task-ghost { opacity: .35; background: rgba(79,70,229,.15) !important; }
.task-chosen { box-shadow: var(--shadow-lg); }
.task-dragging { transform: rotate(2deg); box-shadow: var(--shadow-lg); }
.column-ghost { opacity: .35; }

/* ─── Avatars ─────────────────────────────────────────────────────────────── */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .7rem; color: white;
  flex-shrink: 0; text-transform: uppercase;
  border: 2px solid transparent;
}
.avatar.xs  { width: 22px; height: 22px; font-size: .6rem; }
.avatar.sm  { width: 28px; height: 28px; font-size: .65rem; }
.avatar.lg  { width: 40px; height: 40px; font-size: .85rem; }
.avatar.xl  { width: 56px; height: 56px; font-size: 1.1rem; }

/* ─── Modals ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 1rem;
  backdrop-filter: blur(2px);
  animation: fadeIn .15s ease;
}
.task-modal-overlay { align-items: flex-start; padding: 2rem 1rem; overflow-y: auto; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  animation: slideUp .15s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-lg { max-width: 720px; }
.modal-sm { max-width: 380px; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-header {
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--c-border);
}
.modal-header h3 { font-weight: 800; font-size: 1.05rem; }
.modal-close { color: var(--c-text2); padding: .25rem; border-radius: var(--radius-sm); }
.modal-close:hover { background: var(--c-surface2); color: var(--c-text); }
.modal-body   { padding: 1.25rem 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: flex-end; gap: .625rem;
}

/* Settings Tabs */
.settings-tabs {
  display: flex; border-bottom: 1px solid var(--c-border);
  padding: 0 1.5rem;
}
.settings-tab {
  padding: .625rem .875rem; font-size: .875rem; font-weight: 600;
  color: var(--c-text2); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all var(--transition);
}
.settings-tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--c-text); margin-bottom: .375rem; }
.field label .required { color: var(--c-danger); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: .5625rem .875rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  transition: border-color var(--transition);
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--c-primary); }
.field textarea { resize: vertical; }

.field-row { display: flex; gap: .625rem; align-items: flex-end; }
.field-row input, .field-row select { flex: 1; padding: .5rem .75rem; border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-text); outline: none; }
.field-row input:focus, .field-row select:focus { border-color: var(--c-primary); }

/* Background Presets */
.bg-presets { display: flex; flex-wrap: wrap; gap: .5rem; }
.bg-preset {
  width: 36px; height: 36px; border-radius: 8px;
  border: 3px solid transparent;
  transition: all var(--transition);
}
.bg-preset:hover { transform: scale(1.1); }
.bg-preset.active { border-color: var(--c-primary); box-shadow: 0 0 0 2px white, 0 0 0 4px var(--c-primary); }

/* Danger Zone */
.danger-zone {
  margin-top: 1.5rem; padding: 1rem;
  border: 1.5px solid #fecaca;
  border-radius: var(--radius); background: #fef2f2;
}
[data-theme="dark"] .danger-zone { border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.08); }
.danger-zone h4 { color: var(--c-danger); font-size: .875rem; font-weight: 700; margin-bottom: .75rem; }
.danger-zone .btn + .btn { margin-left: .5rem; }

/* Members */
.members-list  { margin-bottom: 1.5rem; }
.member-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .625rem 0;
  border-bottom: 1px solid var(--c-border);
}
.member-item:last-child { border-bottom: none; }
.member-info { flex: 1; overflow: hidden; }
.member-name  { font-weight: 600; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-email { font-size: .75rem; color: var(--c-text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-role  { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.member-role.admin { background: rgba(79,70,229,.1); color: var(--c-primary); }
.role-select { padding: .25rem .5rem; border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-text); font-size: .8rem; }

.add-member-form { border-top: 1px solid var(--c-border); padding-top: 1rem; }
.add-member-form h4 { font-size: .875rem; font-weight: 700; margin-bottom: .75rem; }

/* Labels */
.labels-list { margin-bottom: 1rem; }
.label-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .375rem 0;
  border-bottom: 1px solid var(--c-border);
}
.label-color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.label-name-input { flex: 1; border: 1.5px solid var(--c-border); border-radius: 4px; padding: .25rem .5rem; background: var(--c-surface); color: var(--c-text); font-size: .875rem; outline: none; }
.label-name-input:focus { border-color: var(--c-primary); }
.label-color-input { width: 32px; height: 28px; border: 1.5px solid var(--c-border); border-radius: 4px; padding: 2px; cursor: pointer; background: none; }
.add-label-form { display: flex; gap: .5rem; align-items: center; }
.add-label-form input[type="text"] { flex: 1; padding: .5rem .75rem; border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-text); outline: none; }
.add-label-form input[type="color"] { width: 36px; height: 36px; border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); cursor: pointer; padding: 2px; background: none; }

/* Activity */
.activity-list  { display: flex; flex-direction: column; gap: .75rem; }
.activity-item  { display: flex; gap: .75rem; align-items: flex-start; }
.activity-content { flex: 1; font-size: .875rem; }
.activity-user  { font-weight: 600; }
.activity-desc  { color: var(--c-text2); }
.activity-time  { font-size: .75rem; color: var(--c-text3); display: block; margin-top: 2px; }

/* ─── Task Modal ──────────────────────────────────────────────────────────── */
.modal-task {
  max-width: 860px;
  max-height: none;
  overflow-y: visible;
}
.task-modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
}
.task-status-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: .875rem; }
.task-modal-actions { display: flex; gap: .25rem; }
.task-status-badge {
  display: inline-block; font-size: .75rem; font-weight: 700;
  padding: .25rem .625rem; border-radius: 10px;
}
.task-status-badge.active    { background: rgba(79,70,229,.1); color: var(--c-primary); }
.task-status-badge.completed { background: rgba(16,185,129,.1); color: #059669; }
.task-status-badge.archived  { background: var(--c-surface2); color: var(--c-text2); }
.task-modal-title-wrap { position: relative; }

.task-modal-title {
  font-size: 1.25rem; font-weight: 800; line-height: 1.3;
  word-break: break-word;
  display: flex; align-items: flex-start; gap: .5rem;
}

.title-edit-btn {
  flex-shrink: 0;
  opacity: 0;
  background: none; border: none;
  color: var(--c-text2);
  font-size: .85rem;
  padding: .2rem .35rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: .15rem;
}
.title-edit-btn.text-white { color: rgba(255,255,255,.7); }
.task-modal-title:hover .title-edit-btn { opacity: 1; }
.title-edit-btn:hover { background: rgba(0,0,0,.1); color: var(--c-text); }
.title-edit-btn.text-white:hover { background: rgba(255,255,255,.2); color: white; }
.task-modal-sub { font-size: .8rem; color: var(--c-text2); margin-top: .375rem; }
.text-white      { color: white !important; text-shadow: 0 1px 3px rgba(0,0,0,.3); }
.text-white-soft { color: rgba(255,255,255,.8) !important; }
.title-edit {
  width: 100%; font-size: 1.25rem; font-weight: 800;
  background: rgba(255,255,255,.2); border: none;
  color: inherit; outline: none; border-radius: 4px;
  padding: .25rem .5rem; resize: none;
}

.task-modal-body {
  display: flex; gap: 1.25rem;
  padding: 1.25rem 1.5rem 1.5rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.task-main { flex: 1; overflow: hidden; }
.task-sidebar { width: 200px; flex-shrink: 0; }

.task-section { margin-bottom: 1.5rem; }
.task-section-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--c-text2);
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .625rem;
}
.task-section-title i { font-size: .85rem; }

/* Labels in Task */
.task-labels-wrap { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.label-badge {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .25rem .625rem; border-radius: 10px;
  color: white; font-size: .78rem; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.label-remove { background: none; border: none; color: rgba(255,255,255,.7); cursor: pointer; padding: 0 0 0 .25rem; font-size: .9rem; line-height: 1; }
.label-remove:hover { color: white; }
.label-picker-wrap { position: relative; }
.label-picker {
  position: absolute; top: calc(100% + 4px); left: 0;
  width: 200px; background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  z-index: 100; max-height: 200px; overflow-y: auto;
}
.label-picker-item {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem .875rem; cursor: pointer;
  font-size: .875rem; transition: background var(--transition);
}
.label-picker-item:hover { background: var(--c-surface2); }
.label-picker-item.selected { background: rgba(79,70,229,.06); }
.label-picker-item .fa-check { margin-left: auto; color: var(--c-primary); }
.label-picker-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.label-picker-empty { padding: .75rem .875rem; color: var(--c-text2); font-size: .825rem; }

/* Description */
.task-desc { cursor: text; }
.desc-content {
  font-size: .9rem; line-height: 1.6; color: var(--c-text);
  white-space: pre-wrap; word-break: break-word;
}
.desc-content code { background: var(--c-surface2); padding: .1em .35em; border-radius: 3px; font-family: monospace; font-size: .85em; }
.desc-placeholder { color: var(--c-text3); font-size: .875rem; padding: .5rem 0; font-style: italic; }
.desc-textarea {
  width: 100%; padding: .625rem .875rem;
  border: 1.5px solid var(--c-primary);
  border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-text);
  resize: vertical; outline: none; font-size: .9rem; line-height: 1.6;
}
.desc-actions { margin-top: .5rem; display: flex; gap: .5rem; }

/* Checklists */
.checklist-section .task-section-title { justify-content: flex-start; }
.checklist-title-input { flex: 1; border: 1.5px solid var(--c-border); border-radius: 4px; padding: .125rem .5rem; background: var(--c-surface); color: var(--c-text); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; outline: none; }
.checklist-progress { margin-left: auto; margin-right: .5rem; font-size: .75rem; color: var(--c-text3); }
.checklist-progress-bar { height: 5px; background: var(--c-border); border-radius: 3px; margin-bottom: .625rem; overflow: hidden; }
.checklist-progress-fill { height: 100%; background: var(--c-success); border-radius: 3px; transition: width .3s ease; }
.checklist-items { display: flex; flex-direction: column; gap: .375rem; }
.checklist-item { display: flex; align-items: center; gap: .625rem; }
.checkbox { width: 15px; height: 15px; border-radius: 3px; flex-shrink: 0; cursor: pointer; accent-color: var(--c-success); }
.checklist-text { flex: 1; font-size: .875rem; color: var(--c-text); }
.checklist-text.done { text-decoration: line-through; color: var(--c-text3); }
.add-checklist-item { display: flex; gap: .5rem; margin-top: .5rem; }
.checklist-new-input {
  flex: 1; padding: .375rem .625rem;
  border: 1.5px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-text);
  font-size: .85rem; outline: none;
}
.checklist-new-input:focus { border-color: var(--c-primary); }

/* Comments */
.comments-list { display: flex; flex-direction: column; gap: .875rem; margin-bottom: 1rem; }
.comment { display: flex; gap: .75rem; align-items: flex-start; }
.comment-content { flex: 1; background: var(--c-surface2); border-radius: var(--radius-sm); padding: .625rem .875rem; }
.comment-header { display: flex; align-items: center; gap: .625rem; margin-bottom: .375rem; flex-wrap: wrap; }
.comment-header strong { font-size: .875rem; }
.comment-time { font-size: .75rem; color: var(--c-text3); }
.comment-text { font-size: .875rem; color: var(--c-text); white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; gap: .75rem; align-items: flex-start; }
.comment-input-wrap { flex: 1; }
.comment-input-wrap textarea {
  width: 100%; padding: .5rem .75rem;
  border: 1.5px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-text);
  resize: none; outline: none; font-size: .875rem; display: block;
  margin-bottom: .375rem;
}
.comment-input-wrap textarea:focus { border-color: var(--c-primary); }

/* Task Sidebar */
.task-meta-block { margin-bottom: 1.25rem; }
.task-meta-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-text2); margin-bottom: .5rem; }
.assignees-list { display: flex; flex-direction: column; gap: .375rem; margin-bottom: .375rem; }
.assignee-item { display: flex; align-items: center; gap: .5rem; font-size: .8rem; }
.assignee-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-assignee select { width: 100%; padding: .375rem .625rem; border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-text); font-size: .8rem; outline: none; }
.date-input { width: 100%; padding: .375rem .625rem; border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-text); font-size: .8rem; outline: none; }
.date-input.overdue { border-color: var(--c-danger); color: var(--c-danger); }

/* Priority Select */
.priority-select { display: flex; flex-direction: column; gap: .25rem; }
.priority-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .375rem .625rem; border-radius: var(--radius-sm);
  font-size: .8rem; font-weight: 600; color: var(--c-text2);
  transition: all var(--transition); text-align: left;
}
.priority-btn:hover { background: var(--c-surface2); }
.priority-btn.active { background: color-mix(in srgb, var(--pcolor) 15%, transparent); color: var(--pcolor); }
.priority-btn i { color: var(--pcolor); width: 14px; }

/* Cover Colors */
.cover-colors { display: flex; flex-wrap: wrap; gap: .375rem; }
.cover-btn { width: 22px; height: 22px; border-radius: 4px; border: 2px solid transparent; transition: all var(--transition); }
.cover-btn:hover { transform: scale(1.15); }
.cover-btn.active { border-color: var(--c-text); }
.cover-btn.clear { background: var(--c-surface2) !important; border: 1.5px solid var(--c-border); display: flex; align-items: center; justify-content: center; font-size: .65rem; color: var(--c-text2); }

/* Task Actions */
.task-action-btn {
  width: 100%; padding: .4375rem .625rem;
  text-align: left; display: flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 600; color: var(--c-text2);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  margin-bottom: .25rem;
}
.task-action-btn:hover { background: var(--c-surface2); color: var(--c-text); }
.task-action-btn.danger { color: var(--c-danger); }
.task-action-btn.danger:hover { background: #fef2f2; }
[data-theme="dark"] .task-action-btn.danger:hover { background: rgba(239,68,68,.1); }
.task-action-btn i { width: 14px; text-align: center; }

.task-meta-info { border-top: 1px solid var(--c-border); padding-top: 1rem; }
.creator-info { display: flex; align-items: center; gap: .5rem; font-size: .8rem; margin-bottom: .25rem; }
.meta-date { font-size: .75rem; color: var(--c-text3); }

/* ─── Context Menu ────────────────────────────────────────────────────────── */
.context-menu {
  position: fixed; z-index: 600;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 180px; padding: .375rem 0;
  animation: fadeIn .1s ease;
}
.context-menu button {
  width: 100%; padding: .5rem 1rem;
  text-align: left; display: flex; align-items: center; gap: .625rem;
  font-size: .875rem; color: var(--c-text);
  transition: background var(--transition);
}
.context-menu button:hover { background: var(--c-surface2); }
.context-menu button.danger { color: var(--c-danger); }
.context-menu i { width: 16px; text-align: center; }
.context-divider { height: 1px; background: var(--c-border); margin: .25rem 0; }

/* ─── Admin Table ─────────────────────────────────────────────────────────── */
.admin-actions { margin-bottom: 1rem; }
.users-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.users-table th { padding: .625rem .875rem; text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c-text2); border-bottom: 2px solid var(--c-border); }
.users-table td { padding: .625rem .875rem; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.users-table tr:hover td { background: var(--c-surface2); }
.user-cell { display: flex; align-items: center; gap: .625rem; }
.users-table select { padding: .25rem .5rem; border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-text); font-size: .8rem; }
.status-badge { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.status-badge.active   { background: rgba(16,185,129,.1); color: #059669; }
.status-badge.inactive { background: rgba(239,68,68,.1);  color: var(--c-danger); }
.invite-result { background: var(--c-surface2); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: .875rem; font-size: .875rem; margin-top: 1rem; }
.invite-result code { background: rgba(79,70,229,.1); color: var(--c-primary); padding: .1em .35em; border-radius: 3px; font-family: monospace; }

/* ─── Profile ─────────────────────────────────────────────────────────────── */
.profile-avatar-wrap { text-align: center; margin-bottom: 1.25rem; }
.color-picker-wrap { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-top: .75rem; }
.color-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; transition: all var(--transition); }
.color-dot:hover { transform: scale(1.2); }
.color-dot.active { border-color: var(--c-text); box-shadow: 0 0 0 2px var(--c-surface), 0 0 0 4px var(--c-text); }
.divider { height: 1px; background: var(--c-border); margin: 1rem 0; }

/* ─── Toasts ──────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9000;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  display: flex; align-items: center; gap: .625rem;
  padding: .75rem 1.1rem;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: .875rem; font-weight: 600;
  animation: toastIn .25s ease, toastOut .25s ease 3.25s forwards;
  max-width: 340px;
}
.toast.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.toast.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.toast.info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
[data-theme="dark"] .toast.success { background: #064e3b; color: #a7f3d0; border-color: #065f46; }
[data-theme="dark"] .toast.error   { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
[data-theme="dark"] .toast.info    { background: #1e3a5f; color: #bfdbfe; border-color: #1e40af; }
@keyframes toastIn  { from { transform: translateX(100%); opacity: 0; } }
@keyframes toastOut { to   { transform: translateX(120%); opacity: 0; } }

/* ─── Overlay Dismiss ─────────────────────────────────────────────────────── */
.overlay-dismiss {
  position: fixed; inset: 0; z-index: 99;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar-toggle { display: flex; }
  .header-center { display: none; }

  .sidebar {
    position: fixed; left: 0; top: var(--header-h);
    height: calc(100vh - var(--header-h));
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .app-layout:not(.sidebar-closed) .sidebar {
    transform: translateX(0);
  }
  .app-layout.sidebar-closed .sidebar {
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
  }

  .board-columns-wrap { padding: .75rem; }
  --col-width: 260px;
  .task-modal-body { flex-direction: column; }
  .task-sidebar { width: 100%; }
  .modal { max-height: 95vh; }
  .breadcrumb-board { display: none; }
}

@media (max-width: 600px) {
  .dashboard { padding: 1.25rem 1rem; }
  .boards-grid { grid-template-columns: 1fr 1fr; }
  .board-toolbar { flex-direction: column; align-items: flex-start; }
  .board-toolbar-right { flex-wrap: wrap; }
  .modal { margin: .5rem; border-radius: var(--radius); }
  .task-modal-overlay { padding: .5rem; }
}

/* ─── Scrollbars ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-text3); }

/* ─── Selection ───────────────────────────────────────────────────────────── */
::selection { background: rgba(79,70,229,.2); }

/* ─── Attachments ─────────────────────────────────────────────────────────── */
.attachments-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }

.attachment-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .75rem;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.attachment-item:hover { background: var(--c-col-h); }
.attachment-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--c-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-primary); font-size: .9rem; flex-shrink: 0;
  border: 1px solid var(--c-border);
}
.attachment-info { flex: 1; overflow: hidden; }
.attachment-name {
  display: block; font-size: .85rem; font-weight: 600;
  color: var(--c-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attachment-name:hover { text-decoration: underline; }
.attachment-meta { font-size: .75rem; color: var(--c-text2); }

.attachment-upload-area {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .375rem;
  border: 2px dashed var(--c-border2);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  color: var(--c-text2);
  font-size: .875rem;
  position: relative;
  overflow: hidden;
}
.attachment-upload-area:hover, .attachment-upload-area.dragging {
  border-color: var(--c-primary);
  background: rgba(79,70,229,.04);
  color: var(--c-primary);
}
.attachment-upload-area i { font-size: 1.75rem; color: var(--c-text3); }
.attachment-upload-area:hover i, .attachment-upload-area.dragging i { color: var(--c-primary); }
.attachment-upload-area small { font-size: .75rem; color: var(--c-text3); }

.upload-progress-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--c-border);
}
.upload-progress-fill {
  height: 100%; background: var(--c-primary);
  transition: width .3s ease;
  border-radius: 2px;
}

/* ─── Cover Image ─────────────────────────────────────────────────────────── */
.cover-image-preview {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: .5rem;
  max-height: 120px;
}
.cover-image-preview img {
  width: 100%; height: 100px; object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}
.cover-img-remove {
  position: absolute; top: .375rem; right: .375rem;
  background: rgba(0,0,0,.5); color: white;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; cursor: pointer;
  transition: background var(--transition);
}
.cover-img-remove:hover { background: rgba(0,0,0,.75); }

.cover-upload-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .375rem .75rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: .8rem; font-weight: 600; color: var(--c-text2);
  cursor: pointer;
  transition: all var(--transition);
  width: 100%; justify-content: center;
}
.cover-upload-btn:hover { border-color: var(--c-primary); color: var(--c-primary); background: rgba(79,70,229,.04); }

/* Card Cover Image */
.task-card .task-cover-img {
  height: 80px;
  margin: -.625rem -.75rem .625rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  overflow: hidden;
}
.task-card .task-cover-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Task Modal Cover Image */
.task-modal-header.has-cover-img {
  padding-bottom: 2.5rem;
}

/* ─── Trello Import ───────────────────────────────────────────────────────── */
.trello-steps { margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: .875rem; }
.trello-step  {
  display: flex; gap: .875rem; align-items: flex-start;
  padding: .875rem; background: var(--c-surface2);
  border-radius: var(--radius-sm); border: 1px solid var(--c-border);
  font-size: .875rem; color: var(--c-text);
  line-height: 1.5;
}
.trello-step code {
  background: rgba(79,70,229,.1); color: var(--c-primary);
  padding: .1em .35em; border-radius: 3px; font-family: monospace;
}
.trello-step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--c-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .8rem; flex-shrink: 0; margin-top: 1px;
}

.trello-result { text-align: center; padding: .5rem 0; }
.trello-result h3 { color: var(--c-text); }
.trello-result-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .625rem;
  margin-top: 1.25rem;
}
.stat-item {
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: .75rem .5rem; text-align: center;
}
.stat-item strong { display: block; font-size: 1.5rem; font-weight: 800; color: var(--c-primary); }
.stat-item span   { font-size: .75rem; color: var(--c-text2); }

/* ─── Rich Text Editor ────────────────────────────────────────────────────── */
.rte-wrap {
  border: 1.5px solid var(--c-primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--c-surface);
}

.rte-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: .125rem;
  padding: .375rem .5rem;
  background: var(--c-surface2);
  border-bottom: 1px solid var(--c-border);
}

.rte-group {
  display: flex; align-items: center; gap: .125rem;
}

.rte-divider {
  width: 1px; height: 18px;
  background: var(--c-border2);
  margin: 0 .25rem;
  flex-shrink: 0;
}

.rte-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 4px;
  color: var(--c-text2);
  font-size: .8rem;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  border: none; background: none;
}
.rte-btn:hover {
  background: var(--c-border);
  color: var(--c-text);
}
.rte-btn:active {
  background: rgba(79,70,229,.15);
  color: var(--c-primary);
}

.rte-select {
  height: 28px;
  padding: 0 .375rem;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: var(--c-surface);
  color: var(--c-text);
  font-size: .78rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.rte-select:focus { border-color: var(--c-primary); }

.rte-color-btn {
  position: relative;
  overflow: visible;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1px;
  width: 28px; height: 28px;
  border-radius: 4px;
  color: var(--c-text2);
  font-size: .8rem;
  transition: all var(--transition);
}
.rte-color-btn:hover {
  background: var(--c-border);
  color: var(--c-text);
}
.rte-color-bar {
  display: block;
  width: 14px; height: 3px;
  border-radius: 2px;
  background: #000;
  transition: background .1s;
}

.rte-content {
  min-height: 120px;
  max-height: 400px;
  overflow-y: auto;
  padding: .625rem .875rem;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--c-text);
  outline: none;
  word-break: break-word;
}
.rte-content:empty::before {
  content: 'Beschreibung eingeben…';
  color: var(--c-text3);
  font-style: italic;
  pointer-events: none;
}
.rte-content h1 { font-size: 1.4rem; font-weight: 800; margin: .5rem 0 .25rem; }
.rte-content h2 { font-size: 1.15rem; font-weight: 700; margin: .5rem 0 .25rem; }
.rte-content h3 { font-size: 1rem; font-weight: 700; margin: .375rem 0 .25rem; }
.rte-content p  { margin: .25rem 0; }
.rte-content pre {
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: .5rem .75rem;
  font-family: 'Courier New', monospace;
  font-size: .85em;
  overflow-x: auto;
}
.rte-content ul, .rte-content ol { padding-left: 1.5rem; margin: .25rem 0; }
.rte-content li { margin: .125rem 0; }
.rte-content a { color: var(--c-primary); text-decoration: underline; }
.rte-content a:hover { color: var(--c-primary-h); }
.rte-content strong { font-weight: 700; }
.rte-content em { font-style: italic; }

.rte-hint {
  font-size: .75rem;
  color: var(--c-text3);
  margin-right: auto;
}

.rte-wrap .desc-actions {
  align-items: center;
  padding: .5rem .75rem;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface2);
  margin-top: 0;
}

/* Gerenderte HTML-Beschreibung (gespeicherter Inhalt) */
.desc-content h1 { font-size: 1.4rem; font-weight: 800; margin: .5rem 0 .25rem; }
.desc-content h2 { font-size: 1.15rem; font-weight: 700; margin: .5rem 0 .25rem; }
.desc-content h3 { font-size: 1rem; font-weight: 700; margin: .375rem 0 .25rem; }
.desc-content p  { margin: .25rem 0; }
.desc-content ul, .desc-content ol { padding-left: 1.5rem; margin: .25rem 0; }
.desc-content li { margin: .125rem 0; }
.desc-content a  { color: var(--c-primary); text-decoration: underline; }
.desc-content strong { font-weight: 700; }
.desc-content em { font-style: italic; }
.desc-content pre {
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: .5rem .75rem;
  font-family: 'Courier New', monospace;
  font-size: .85em;
  overflow-x: auto;
  margin: .25rem 0;
}
