/* ==========================================================================
   Flowerflow – Design Tokens
   ========================================================================== */
:root {
  --bg: #ffffff;
  --bg-subtle: #f7f5f1;
  --bg-hover: #f1eee9;
  --bg-active: #e8e4dd;
  --border: #e6e2dc;
  --border-strong: #d3cdc4;
  --text: #1a2533;
  --text-muted: #5f6670;
  --text-faint: #9a9ea4;

  --sidebar-bg: #f5f2ee;
  --sidebar-hover: #ece8e2;
  --sidebar-active: #e3ded6;
  --sidebar-text: #1a2533;
  --sidebar-muted: #6b6f75;

  --accent: #1c2b3b;
  --accent-hover: #2f4a66;
  --primary: #1c2b3b;
  --primary-hover: #2f4a66;
  --success: #5f8a6b;
  --success-bg: #e7eee4;
  --danger: #d1395a;
  --danger-bg: #fbe9ed;
  --warn: #c7841a;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(30, 31, 33, .06);
  --shadow: 0 2px 8px rgba(30, 31, 33, .08), 0 1px 2px rgba(30, 31, 33, .06);
  --shadow-lg: 0 12px 32px rgba(30, 31, 33, .16), 0 2px 6px rgba(30, 31, 33, .08);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 248px;
  --detail-w: 620px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--primary); }
.hidden { display: none !important; }

/* ==========================================================================
   Layout
   ========================================================================== */
.app { display: flex; height: 100vh; overflow: hidden; position: relative; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { flex: 1; overflow: auto; }

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; }
.brand-logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #f06a6a, #f8a65a);
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px;
}
.brand-name { font-weight: 600; font-size: 15px; }
.org-switch {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: var(--radius); text-align: left; color: var(--sidebar-text);
  margin-bottom: 8px;
}
.org-switch { background: #fff; border: 1px solid #dcd9d6; border-radius: 22px; padding: 6px 14px 6px 8px; }
.org-switch:hover { background: #fff; border-color: #c4c1be; box-shadow: var(--shadow-sm); }
.org-badge {
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg-active); color: var(--text-muted);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.org-switch .label { font-size: 11px; color: var(--sidebar-muted); line-height: 1.1; }
.org-switch .name { font-weight: 600; line-height: 1.2; }

.nav-item {
  display: flex; align-items: center; gap: 12px; position: relative;
  width: 100%; padding: 7px 10px; border-radius: 8px; font-size: 15px !important;
  color: var(--sidebar-text); text-align: left; text-decoration: none; font-size: 14px;
}
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active); }
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--sidebar-muted); stroke-width: 1.7; }
.nav-item.active { font-weight: 500; }
.nav-sep { height: 1px; background: #dcd9d6; margin: 10px 6px 4px; }
.nav-item[data-project-id] { cursor: pointer; }
.nav-item.dragging { opacity: .4; }
.nav-item.drop-target { background: #e4ecfb; box-shadow: inset 0 0 0 2px var(--primary); }
.nav-item.proj-drop-before::before, .nav-item.proj-drop-after::after {
  content: ""; position: absolute; left: 8px; right: 8px; height: 2px; background: var(--primary); border-radius: 2px;
}
.nav-item.proj-drop-before::before { top: -1px; }
.nav-item.proj-drop-after::after { bottom: -1px; }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--sidebar-muted); }
.nav-heading {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 10px 6px; font-size: 12px; color: var(--sidebar-muted); font-weight: 500;
}
.nav-heading button {
  color: var(--sidebar-muted); width: 22px; height: 22px; border-radius: 4px;
  display: grid; place-items: center;
}
.nav-heading button:hover { background: var(--sidebar-hover); color: var(--sidebar-text); }
.project-dot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.project-dot .pi { display: none; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .01em; line-height: 1; text-shadow: 0 1px 1px rgba(0,0,0,.12); }
.sidebar-footer { margin-top: auto; padding-top: 16px; }
.sidebar-hint { font-size: 11px; color: var(--sidebar-muted); padding: 8px 10px; line-height: 1.4; }

/* ==========================================================================
   Topbar
   ========================================================================== */
.topbar {
  height: 52px; flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; border-bottom: 1px solid var(--border);
}
.topbar .search {
  flex: 1; max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 14px; color: var(--text-muted);
}
.topbar .search input { border: 0; outline: 0; background: transparent; flex: 1; }
.topbar .search:focus-within { background: #fff; border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-create {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; padding: 6px 14px 6px 10px; border-radius: 20px; font-weight: 500;
}
.btn-create:hover { background: var(--accent-hover); }
.user-btn { border-radius: 50%; }
.user-btn:hover { box-shadow: 0 0 0 3px var(--bg-active); }

/* ==========================================================================
   Generic controls
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: #fff; font-weight: 500; font-size: 13px;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b82e4c; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius);
  display: inline-grid; place-items: center; color: var(--text-muted);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 24px; height: 24px; }
.icon-btn.sm svg { width: 15px; height: 15px; }

.input, .textarea, .select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: #fff; outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(69, 115, 210, .15); }
.field-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin: 0 0 6px; }
.form-row { margin-bottom: 14px; }

.segmented { display: inline-flex; background: var(--bg-hover); border-radius: var(--radius); padding: 2px; }
.segmented button { padding: 4px 12px; border-radius: 4px; font-size: 13px; color: var(--text-muted); }
.segmented button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); font-weight: 500; }

/* Avatar */
.avatar {
  border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-block;
  background: var(--bg-active); vertical-align: middle;
}
.avatar-empty {
  border-radius: 50%; border: 1px dashed var(--text-faint); display: inline-grid; place-items: center;
  color: var(--text-faint); flex-shrink: 0;
}
.avatar-empty svg { width: 60%; height: 60%; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px #fff; margin-left: -6px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-more {
  margin-left: -6px; box-shadow: 0 0 0 2px #fff; border-radius: 50%; background: var(--bg-active);
  display: inline-grid; place-items: center; font-size: 11px; color: var(--text-muted); font-weight: 600;
}

/* Check circle */
.check {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--text-faint); display: inline-grid; place-items: center;
  color: transparent; transition: all .15s ease; background: #fff;
}
.check svg { width: 11px; height: 11px; }
.check:hover { border-color: var(--success); color: var(--success); background: var(--success-bg); }
.check.done { background: var(--success); border-color: var(--success); color: #fff; }
.check.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Due date colors */
.due { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.due.today { color: var(--success); font-weight: 500; }
.due.tomorrow { color: var(--warn); }
.due.overdue { color: var(--danger); font-weight: 500; }
.done-task .due { color: var(--text-faint); font-weight: 400; }

/* ==========================================================================
   Page header (project / home / team)
   ========================================================================== */
.page-header { padding: 18px 28px 0; border-bottom: 1px solid var(--border); background: #fff; }
.page-title-row { display: flex; align-items: center; gap: 12px; }
.project-icon {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex-shrink: 0;
}
.project-icon svg { width: 20px; height: 20px; }
.page-title {
  font-size: 20px; font-weight: 600; margin: 0; padding: 2px 6px; border-radius: var(--radius);
  border: 1px solid transparent; outline: none; min-width: 40px;
}
.page-title[contenteditable="true"] { cursor: text; }
.page-title[contenteditable="true"]:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.page-title[contenteditable="true"]:focus { border-color: var(--primary); }
.page-title-row .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; margin-top: 10px; }
.tab {
  padding: 8px 10px; font-size: 14px; color: var(--text-muted); border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }

.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 28px; }
.toolbar .spacer { flex: 1; }
.split-btn { display: inline-flex; }
.split-btn .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.split-btn .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: 1px solid rgba(255,255,255,.3); padding: 6px 7px; }

/* ==========================================================================
   List view
   ========================================================================== */
.list { padding: 0 28px 80px; }
.list-head {
  display: grid; grid-template-columns: 1fr 160px 130px 40px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); position: sticky; top: 0; background: #fff; z-index: 2;
}
.list-head > div { padding: 7px 10px; border-left: 1px solid var(--border); }
.list-head > div:first-child { border-left: 0; padding-left: 34px; }

.section { margin-top: 18px; position: relative; }
.section-header {
  display: flex; align-items: center; gap: 4px; padding: 6px 0; min-height: 40px; position: relative;
}
.section-header .drag-handle { opacity: 0; }
.section-header:hover .drag-handle { opacity: 1; }
.section-toggle { width: 24px; height: 24px; display: grid; place-items: center; color: var(--text-muted); border-radius: 4px; transition: transform .15s; }
.section-toggle:hover { background: var(--bg-hover); }
.section-toggle svg { width: 14px; height: 14px; }
.section.collapsed .section-toggle { transform: rotate(-90deg); }
.section.collapsed .section-body { display: none; }
.section-name {
  font-size: 16px; font-weight: 600; padding: 2px 6px; border-radius: var(--radius); outline: none;
  border: 1px solid transparent;
}
.section-name:hover { border-color: var(--border); }
.section-name:focus { border-color: var(--primary); }
.section-count { color: var(--text-faint); font-size: 13px; margin-left: 2px; }
.section-actions { margin-left: 6px; display: flex; gap: 2px; opacity: 0; }
.section-header:hover .section-actions, .section-actions:focus-within { opacity: 1; }
.section-body { border-top: 1px solid var(--border); min-height: 6px; }

.task-row {
  display: grid; grid-template-columns: 1fr 160px 130px 40px; align-items: stretch;
  border-bottom: 1px solid var(--border); background: #fff; position: relative; cursor: pointer;
  min-height: 38px;
}
.task-row:hover { background: var(--bg-subtle); }
.task-row.selected { background: #eef3fc; }
.task-row > div { display: flex; align-items: center; padding: 0 10px; border-left: 1px solid var(--border); min-width: 0; }
.task-row > div:first-child { border-left: 0; padding-left: 0; gap: 6px; }
.task-row .drag-handle { opacity: 0; }
.task-row:hover .drag-handle { opacity: 1; }
.task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-title-input { flex: 1; border: 0; outline: 0; background: transparent; padding: 6px 0; }
.task-meta-icons { display: inline-flex; gap: 6px; color: var(--text-faint); font-size: 12px; align-items: center; }
.task-meta-icons span { display: inline-flex; align-items: center; gap: 2px; }
.task-meta-icons svg { width: 13px; height: 13px; }
.task-row.done-task .task-title { color: var(--text-faint); }
.task-row.leaving { animation: fadeOut .5s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateX(8px); } }
.task-row .row-more { opacity: 0; }
.task-row:hover .row-more { opacity: 1; }
.cell-assignee { gap: 8px; font-size: 13px; color: var(--text-muted); }
.cell-assignee .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drag-handle {
  width: 18px; height: 24px; display: grid; place-items: center; color: var(--text-faint); cursor: grab; flex-shrink: 0;
}
.drag-handle svg { width: 12px; height: 12px; }
.add-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 0 8px 24px; color: var(--text-muted);
  font-size: 13px; border-bottom: 1px solid var(--border); width: 100%; text-align: left;
}
.add-row:hover { color: var(--text); background: var(--bg-subtle); }
.add-row svg { width: 14px; height: 14px; }
.add-section {
  margin-top: 22px; display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-weight: 500;
  padding: 6px 8px; border-radius: var(--radius);
}
.add-section:hover { background: var(--bg-hover); color: var(--text); }
.add-section svg { width: 16px; height: 16px; }

/* Drag & drop feedback */
.dragging { opacity: .4; }
.drop-line { height: 2px; background: var(--primary); margin: -1px 0; position: relative; z-index: 3; pointer-events: none; border-radius: 2px; }
.drop-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.board .drop-line { margin: -4px 0 4px; }
.sec-drop-before::before, .sec-drop-after::after {
  content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--primary); border-radius: 2px; z-index: 4;
}
.sec-drop-before::before { top: -10px; }
.sec-drop-after::after { bottom: -10px; }
.board .sec-drop-before::before, .board .sec-drop-after::after { top: 0; bottom: 0; width: 3px; height: auto; left: auto; right: auto; }
.board .sec-drop-before::before { left: -8px; }
.board .sec-drop-after::after { right: -8px; }

.empty {
  text-align: center; color: var(--text-muted); padding: 60px 20px;
}
.empty h3 { color: var(--text); margin: 12px 0 4px; font-size: 16px; }
.empty-illus { width: 72px; height: 72px; border-radius: 50%; background: var(--bg-hover); display: inline-grid; place-items: center; }
.empty-illus svg { width: 32px; height: 32px; color: var(--text-faint); }
.section-empty { padding: 10px 0 10px 24px; color: var(--text-faint); font-size: 13px; border-bottom: 1px solid var(--border); }

/* ==========================================================================
   Board view
   ========================================================================== */
.board { display: flex; gap: 16px; padding: 4px 28px 28px; align-items: flex-start; min-height: calc(100% - 60px); }
.column {
  width: 290px; flex-shrink: 0; background: var(--bg-subtle); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; max-height: calc(100vh - 210px); position: relative;
}
.column-header { display: flex; align-items: center; gap: 4px; padding: 10px 8px 6px 6px; }
.column-header .section-name { font-size: 14px; }
.column-header .spacer { flex: 1; }
.column-header .drag-handle { opacity: 0; }
.column-header:hover .drag-handle { opacity: 1; }
.column-body { padding: 4px 8px 8px; overflow-y: auto; flex: 1; min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 10px 12px; box-shadow: var(--shadow-sm); cursor: pointer;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card.selected { border-color: var(--primary); }
.card-top { display: flex; gap: 8px; align-items: flex-start; }
.card-top .check { margin-top: 1px; }
.card-title { flex: 1; word-break: break-word; }
.card.done-task .card-title { color: var(--text-faint); }
.card-bottom { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-height: 22px; }
.card-bottom .spacer { flex: 1; }
.card-add { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text-muted); padding: 8px; border-radius: var(--radius); font-size: 13px; }
.card-add:hover { background: var(--bg-active); color: var(--text); }
.card-add svg { width: 14px; height: 14px; }
.card textarea { width: 100%; border: 0; outline: 0; resize: none; padding: 0; font: inherit; }
.column-add {
  width: 290px; flex-shrink: 0; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 14px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; justify-content: center; font-weight: 500;
}
.column-add:hover { background: var(--bg-subtle); color: var(--text); }
.column-add svg { width: 16px; height: 16px; }

/* ==========================================================================
   Home / Dashboard
   ========================================================================== */
.home { max-width: 1040px; margin: 0 auto; padding: 32px 28px 80px; }
.home-date { text-align: center; color: var(--text-muted); font-weight: 500; }
.home-greet { text-align: center; font-size: 30px; font-weight: 400; margin: 4px 0 18px; }
.stats { display: flex; justify-content: center; gap: 0; margin: 0 auto 28px; background: var(--bg-subtle); border-radius: 30px; width: max-content; padding: 6px 8px; }
.stat { padding: 4px 18px; display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat b { color: var(--text); font-size: 16px; }
.stat.danger b { color: var(--danger); }
.home-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.widget { border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; display: flex; flex-direction: column; min-height: 200px; }
.widget-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 8px; }
.widget-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.widget-head .spacer { flex: 1; }
.widget-body { padding: 4px 12px 16px; }
.group-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 12px 8px 4px; color: var(--text); }
.group-title .n { color: var(--text-faint); font-weight: 400; }
.group-title.overdue { color: var(--danger); }
.mytask {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.mytask:hover { background: var(--bg-subtle); }
.mytask .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mytask.done-task .title { color: var(--text-faint); }
.project-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted);
  background: var(--bg-hover); border-radius: 12px; padding: 2px 9px 2px 7px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
}
.project-pill .project-dot { width: 8px; height: 8px; border-radius: 3px; }
.proj-tile { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--radius); cursor: pointer; }
.proj-tile:hover { background: var(--bg-subtle); }
.proj-tile .project-icon { width: 40px; height: 40px; }
.proj-tile .meta { font-size: 12px; color: var(--text-muted); }
.progress { height: 4px; background: var(--bg-active); border-radius: 2px; overflow: hidden; margin-top: 4px; width: 120px; }
.progress > div { height: 100%; background: var(--success); }
.proj-tile .info { flex: 1; min-width: 0; }
.proj-tile .name { font-weight: 500; }

/* ==========================================================================
   Team
   ========================================================================== */
.team { max-width: 1040px; margin: 0 auto; padding: 24px 28px 80px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.member-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 16px; text-align: center; position: relative;
}
.member-card:hover { box-shadow: var(--shadow); }
.member-card .name { font-weight: 600; margin-top: 10px; }
.member-card .email { color: var(--text-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.member-card .role { color: var(--text-faint); font-size: 12px; margin-top: 2px; }
.member-card .projects { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 12px; }
.member-card .you { position: absolute; top: 10px; right: 10px; font-size: 11px; background: var(--bg-hover); padding: 1px 8px; border-radius: 10px; color: var(--text-muted); }
.member-card .btn { margin-top: 14px; }

/* ==========================================================================
   Detail pane
   ========================================================================== */
.detail {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 40; width: min(100vw, var(--detail-w));
  overflow: hidden; border-left: 1px solid var(--border); background: #fff;
  transform: translateX(105%); transition: transform .22s ease, box-shadow .22s ease; display: flex; flex-direction: column;
}
.detail.open { transform: none; box-shadow: -12px 0 32px rgba(30,31,33,.12); }
.detail-inner { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; }
.detail-top {
  display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.detail-top .spacer { flex: 1; }
.complete-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.complete-btn svg { width: 14px; height: 14px; }
.complete-btn:hover { border-color: var(--success); color: var(--success); background: var(--success-bg); }
.complete-btn.done { background: var(--success); border-color: var(--success); color: #fff; }
.detail-done-banner {
  background: var(--success-bg); color: #2e7356; font-size: 13px; padding: 8px 24px; display: flex; align-items: center; gap: 8px;
}
.detail-done-banner svg { width: 14px; height: 14px; }
.detail-scroll { flex: 1; overflow-y: auto; padding: 16px 24px 24px; position: relative; }
.detail-title {
  width: 100%; font-size: 22px; font-weight: 600; border: 1px solid transparent; border-radius: var(--radius);
  padding: 4px 8px; margin-left: -9px; resize: none; outline: none; overflow: hidden; line-height: 1.3; background: transparent;
}
.detail-title:hover { border-color: var(--border); }
.detail-title:focus { border-color: var(--primary); }
.fields { display: grid; grid-template-columns: 130px 1fr; row-gap: 6px; align-items: center; margin: 14px 0 22px; font-size: 13px; }
.fields .k { color: var(--text-muted); }
.field-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; margin-left: -8px; border-radius: var(--radius);
  border: 1px solid transparent; min-height: 32px; max-width: 100%;
}
.field-btn:hover { border-color: var(--border-strong); }
.field-btn .muted { color: var(--text-faint); }
.date-wrap { display: inline-flex; align-items: center; gap: 4px; }
.date-wrap input[type="date"] {
  border: 1px solid transparent; border-radius: var(--radius); padding: 5px 8px; margin-left: -8px; background: transparent; font-size: 13px; min-height: 32px;
}
.date-wrap input[type="date"]:hover { border-color: var(--border-strong); }
.date-wrap input[type="date"]:focus { outline: none; border-color: var(--primary); }
.date-wrap.overdue input { color: var(--danger); }
.date-wrap.today input { color: var(--success); }
.d-section { margin-top: 22px; }
.d-section h4 { font-size: 13px; font-weight: 600; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.d-section h4 .n { color: var(--text-faint); font-weight: 400; }

/* Rich text editor */
.editor-wrap { border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .15s; }
.editor-wrap:hover { border-color: var(--border-strong); }
.editor-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(69,115,210,.12); }
.editor-toolbar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); border-radius: var(--radius) var(--radius) 0 0; }
.editor-toolbar .sep { width: 1px; height: 18px; background: var(--border-strong); margin: 0 4px; }
.tb-btn { width: 28px; height: 28px; border-radius: 4px; display: grid; place-items: center; color: var(--text-muted); }
.tb-btn:hover { background: var(--bg-active); color: var(--text); }
.tb-btn.active { background: var(--bg-active); color: var(--text); }
.tb-btn svg { width: 16px; height: 16px; }
.tb-hint { margin-left: auto; font-size: 11px; color: var(--text-faint); padding-right: 4px; }
.editor {
  min-height: 120px; padding: 10px 12px; outline: none; line-height: 1.55; word-break: break-word;
}
.editor:empty::before { content: attr(data-placeholder); color: var(--text-faint); }
.editor ul, .editor ol { margin: 4px 0; padding-left: 24px; }
.editor h1 { font-size: 20px; font-weight: 600; margin: 12px 0 6px; line-height: 1.3; }
.editor h2 { font-size: 16px; font-weight: 600; margin: 10px 0 4px; line-height: 1.35; }
.editor > :first-child { margin-top: 0; }
.tb-btn.tb-text { width: auto; padding: 0 7px; font-size: 12px; font-weight: 600; }
.editor p { margin: 0 0 6px; }
.editor a { color: var(--primary); text-decoration: underline; cursor: pointer; }

/* Attachments */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 14px; text-align: center;
  color: var(--text-muted); font-size: 13px; cursor: pointer; transition: all .15s;
}
.dropzone:hover { background: var(--bg-subtle); border-color: var(--text-faint); }
.dropzone b { color: var(--primary); font-weight: 500; }
.attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 10px; }
.att {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: relative; background: #fff;
  display: flex; flex-direction: column;
}
.att:hover { box-shadow: var(--shadow); }
.att-thumb { height: 92px; background: var(--bg-subtle); display: grid; place-items: center; color: var(--text-faint); cursor: pointer; overflow: hidden; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-thumb .ext { font-size: 13px; font-weight: 700; background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; color: var(--text-muted); text-transform: uppercase; }
.att-info { padding: 6px 8px; font-size: 12px; }
.att-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { color: var(--text-faint); }
.att-actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; opacity: 0; }
.att:hover .att-actions { opacity: 1; }
.att-actions button { width: 24px; height: 24px; border-radius: 4px; background: rgba(255,255,255,.95); display: grid; place-items: center; box-shadow: var(--shadow-sm); color: var(--text-muted); }
.att-actions button:hover { color: var(--text); }
.att-actions svg { width: 14px; height: 14px; }
.drop-overlay {
  position: absolute; inset: 8px; border: 2px dashed var(--primary); border-radius: var(--radius-lg);
  background: rgba(238, 243, 252, .92); display: none; place-items: center; z-index: 20; color: var(--primary);
  font-weight: 600; font-size: 15px; pointer-events: none;
}
.drop-overlay.show { display: grid; }
.drop-overlay svg { width: 36px; height: 36px; display: block; margin: 0 auto 8px; }

/* Comments / activity */
.activity { border-top: 1px solid var(--border); margin-top: 26px; padding-top: 16px; }
.activity-item { display: flex; gap: 10px; margin-bottom: 14px; font-size: 13px; }
.activity-item .who { font-weight: 600; }
.activity-item .when { color: var(--text-faint); font-size: 12px; margin-left: 6px; }
.activity-item .text { margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.activity-item.system { color: var(--text-muted); font-size: 12px; align-items: center; }
.activity-item.system .dot { width: 24px; display: grid; place-items: center; }
.activity-item.system .dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.comment-box { display: flex; gap: 10px; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--bg-subtle); flex-shrink: 0; align-items: flex-start; }
.comment-box textarea { flex: 1; min-height: 38px; max-height: 140px; resize: none; }
.collaborators { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); padding: 0 24px 10px; background: var(--bg-subtle); flex-shrink: 0; }

/* ==========================================================================
   Popovers, modals, toasts
   ========================================================================== */
.popover {
  position: fixed; z-index: 100; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; max-height: 360px; overflow-y: auto;
  animation: popIn .12s ease;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: var(--radius); text-align: left; font-size: 13px;
}
.menu-item:hover, .menu-item.kbd { background: var(--bg-hover); }
.menu-item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger svg { color: var(--danger); }
.menu-item .check-mark { margin-left: auto; color: var(--primary); }
.menu-item .sub { color: var(--text-faint); font-size: 12px; margin-left: auto; padding-left: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu-label { font-size: 11px; color: var(--text-faint); padding: 6px 10px 4px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.popover .search-in { margin: 2px 2px 6px; width: calc(100% - 4px); }
.user-card { display: flex; gap: 12px; align-items: center; padding: 10px; }
.user-card .name { font-weight: 600; }
.user-card .email { font-size: 12px; color: var(--text-muted); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(30,31,33,.45); z-index: 90; display: grid; place-items: center; padding: 20px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  min-width: 0; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); width: 480px; max-width: 100%; max-height: 90vh;
  display: flex; flex-direction: column; animation: popIn .15s ease;
}
.modal-head { display: flex; align-items: center; padding: 18px 22px 8px; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 600; flex: 1; }
.modal-body { padding: 8px 22px 16px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); }
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch { width: 26px; height: 26px; border-radius: 7px; border: 2px solid transparent; }
.color-swatch.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }
.member-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.member-row:last-child { border-bottom: 0; }
.member-row:hover { background: var(--bg-subtle); }
.member-row .info { flex: 1; min-width: 0; }
.member-row .email { font-size: 12px; color: var(--text-muted); }
.member-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.avatar-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.avatar-edit .actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.avatar-edit .hint { font-size: 12px; color: var(--text-faint); }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--text); color: #fff; padding: 10px 14px 10px 16px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 14px; font-size: 13px; animation: popIn .15s ease;
}
.toast button { color: #8fb1f5; font-weight: 600; }
.toast button:hover { color: #fff; }

.link-pop { width: 320px; padding: 12px; }
.link-pop .form-row { margin-bottom: 10px; }
.link-pop .row { display: flex; gap: 8px; justify-content: flex-end; }
.link-info { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 13px; max-width: 360px; }
.link-info a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

@media (max-width: 1200px) {
  :root { --detail-w: 520px; }
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .sidebar .brand-name, .sidebar .nav-item span:not(.project-dot), .sidebar .org-switch div, .sidebar .nav-heading span, .sidebar .sidebar-hint, .nav-item .count { display: none; }
  .sidebar { padding: 12px 8px; align-items: center; }
  .sidebar .brand { padding: 6px 0 14px; justify-content: center; }
  /* Organisation als runder Button */
  .sidebar .org-switch { width: 40px; height: 40px; padding: 0; border-radius: 50%; justify-content: center; flex-shrink: 0; }
  .sidebar .org-switch .org-badge { width: 32px; height: 32px; }
  .sidebar .nav-item { justify-content: center; padding: 8px; width: 44px; }
  .sidebar .nav-sep { width: 32px; margin: 10px auto 4px; }
  .sidebar .nav-heading { justify-content: center; padding: 14px 0 6px; }
  /* Projekte: farbiges Feld mit den ersten beiden Buchstaben */
  .sidebar .nav-item .project-dot { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
  .sidebar .nav-item .project-dot .pi { display: block; }
  .sidebar .nav-item[data-project-id] { padding: 4px; }
  .sidebar .sidebar-footer { width: 100%; display: flex; justify-content: center; }
  .list-head, .task-row { grid-template-columns: 1fr 44px 90px 32px; }
  .cell-assignee .name { display: none; }
}

[draggable="true"] { -webkit-user-drag: element; }
.task-row:hover [data-hover-hint] { opacity: 1 !important; }
[data-hover-hint] svg { width: 15px; height: 15px; }

/* ==========================================================================
   Login
   ========================================================================== */
.auth {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(1200px 600px at 10% -10%, #fde7df 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e9e4fb 0%, transparent 60%), #f6f5f4;
}
.auth-card {
  width: 400px; max-width: 100%; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px 32px 26px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; margin-bottom: 22px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; font-weight: 600; }
.auth-sub { color: var(--text-muted); margin: 0 0 20px; line-height: 1.5; }
.auth-card form .field-label { margin-top: 12px; }
.auth-submit { width: 100%; justify-content: center; padding: 10px 12px; font-size: 14px; margin-top: 18px; }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-error { color: var(--danger); font-size: 13px; min-height: 0; margin-top: 10px; }
.auth-error:empty { display: none; }
.auth-msg { background: #eef3fc; color: #2f4f94; border-radius: var(--radius); padding: 10px 12px; font-size: 13px; margin-bottom: 8px; }
.auth-link { color: var(--primary); font-size: 13px; margin-top: 16px; }
.auth-link:hover { text-decoration: underline; }
.auth-row { display: flex; justify-content: space-between; }
.auth-foot { margin-top: 18px; font-size: 12px; color: var(--text-faint); }
.code-input { font-size: 26px; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; padding: 10px; }

.sync-status { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.sync-status.pending { color: var(--text-muted); }
.sync-status.error { color: var(--danger); }
.hint { font-size: 12px; color: var(--text-faint); }

/* Team-Verwaltung */
.member-card .card-menu { position: absolute; top: 8px; left: 8px; }
.member-card.inactive { opacity: .55; }
.member-card.inactive .avatar { filter: grayscale(1); }

/* ==========================================================================
   CSV-Import
   ========================================================================== */
.import h4 { font-size: 13px; font-weight: 600; margin: 18px 0 8px; }
.import-drop { display: block; padding: 36px 20px; }
.import-drop.over { border-color: var(--primary); background: #eef3fc; }
.import-file { display: flex; align-items: center; gap: 10px; background: var(--bg-subtle); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; }
.import-file svg { width: 16px; height: 16px; color: var(--text-muted); }
.import-file span { color: var(--text-muted); flex: 1; }
.import-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; }
.radio-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; cursor: pointer; }
.radio-row input { accent-color: var(--primary); }
.map-table { display: grid; grid-template-columns: 170px 1fr; gap: 6px 10px; align-items: center; font-size: 13px; }
.map-table .select { padding: 5px 8px; font-size: 13px; }
.import-stats { display: flex; gap: 18px; margin-top: 14px; font-size: 13px; color: var(--text-muted); }
.import-stats b { display: block; font-size: 20px; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-hover); border-radius: 14px; padding: 3px 10px; font-size: 12px; }
.chip b { color: var(--text-muted); font-weight: 500; }
.chip.ok { background: var(--success-bg); }
.import-warn { display: flex; gap: 10px; background: #fff6e6; border: 1px solid #f3dcae; color: #7a5410; border-radius: var(--radius); padding: 10px 12px; font-size: 13px; margin-top: 10px; line-height: 1.45; }
.import-warn svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.preview-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: 220px; }
.preview-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.preview-table th, .preview-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.preview-table th { background: var(--bg-subtle); font-weight: 600; color: var(--text-muted); position: sticky; top: 0; }
.import-progress { padding: 40px 10px; text-align: center; }
.progress.big { width: 100%; height: 8px; border-radius: 4px; margin: 14px 0 8px; }
.progress.big > div { transition: width .2s; }
.modal .modal-foot .spacer { flex: 1; }
@media (max-width: 960px) { .import-grid { grid-template-columns: 1fr; } }
.import-grid > div { min-width: 0; }
.import .select { width: 100%; }

/* Rechtsklick-Markierung */
.task-row.ctx-selected, .mytask.ctx-selected { background: #eef3fc; }
.card.ctx-selected { border-color: var(--primary); }

/* ==========================================================================
   Unteraufgaben
   ========================================================================== */
.breadcrumb {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted);
  padding: 4px 8px; margin: -4px 0 6px -8px; border-radius: var(--radius); max-width: 100%;
}
.breadcrumb:hover { background: var(--bg-hover); color: var(--text); }
.breadcrumb svg { width: 14px; height: 14px; flex-shrink: 0; }
.breadcrumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subtask-progress { height: 3px; background: var(--bg-active); border-radius: 2px; overflow: hidden; margin: -2px 0 8px; }
.subtask-progress > div { height: 100%; background: var(--success); transition: width .2s; }
.subtasks { border-top: 1px solid var(--border); }
.subtask-row {
  display: flex; align-items: center; gap: 6px; padding: 0 4px 0 0; min-height: 38px;
  border-bottom: 1px solid var(--border); background: #fff;
}
.subtask-row:hover { background: var(--bg-subtle); }
.subtask-row .drag-handle { opacity: 0; cursor: grab; }
.subtask-row:hover .drag-handle { opacity: 1; }
.subtask-title { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 8px 4px; font-size: 14px; }
.subtask-title:focus { background: #fff; box-shadow: inset 0 0 0 1px var(--primary); border-radius: 4px; }
.subtask-row.done-task .subtask-title { color: var(--text-faint); }
.sub-cell { display: inline-flex; align-items: center; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.sub-cell:hover { background: var(--bg-active); }
.sub-cell .due { font-size: 12px; }
.sub-ghost { opacity: 0; display: inline-flex; color: var(--text-faint); }
.sub-ghost svg { width: 15px; height: 15px; }
.subtask-row:hover .sub-ghost, .subtask-row:focus-within .sub-ghost { opacity: 1; }
.sub-add { border-bottom: 0; padding-left: 8px; }
.sub-count { color: var(--text-faint); }
.sub-count.all-done { color: var(--success); }
.parent-hint { color: var(--text-faint); font-size: 12px; }

/* Auswahl-Popover (Projekt / Abschnitt) */
.list-picker { width: 280px; }
.list-picker .opts { max-height: 280px; overflow-y: auto; }
.list-picker .menu-item .project-dot { width: 10px; height: 10px; border-radius: 3px; }
.field-btn .project-dot { width: 10px; height: 10px; border-radius: 3px; }

/* ==========================================================================
   Teams & Rollen
   ========================================================================== */
.nav-team { margin-bottom: 6px; }
.team-head { padding: 12px 6px 4px 10px; }
.team-head a { display: inline-flex; align-items: center; gap: 8px; color: var(--sidebar-muted); text-decoration: none; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; min-width: 0; }
.team-head a span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-head a:hover, .team-head.active a { color: var(--sidebar-text); }
.team-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.nav-empty { font-size: 12px; color: var(--text-faint); padding: 4px 10px 6px 34px; }
.role-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: var(--bg-hover); color: var(--text-muted); vertical-align: middle; }
.role-badge.admin { background: #fde9e4; color: #b4472b; }
.team-icon svg { width: 55%; height: 55%; }
.team-grid.teams { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.team-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; cursor: pointer; position: relative; }
.team-card:hover { box-shadow: var(--shadow); }
.team-card .name { font-weight: 600; font-size: 16px; margin-top: 12px; }
.team-card .meta { color: var(--text-muted); font-size: 13px; margin: 2px 0 12px; }
.team-card .you { position: absolute; top: 12px; right: 12px; font-size: 11px; background: var(--success-bg); color: #2e7356; padding: 1px 8px; border-radius: 10px; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius); cursor: pointer; }
.person-row:hover { background: var(--bg-subtle); }
.person-row .info { flex: 1; min-width: 0; }
.person-row .name { font-weight: 500; }
.person-row .meta { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-empty { color: var(--text-muted); padding: 10px 8px; font-size: 13px; }
.widget-note { font-size: 12px; color: var(--text-faint); padding: 0 20px 14px; }
.user-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; }
.user-hero h1 { margin: 0 0 4px; font-size: 26px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.user-hero .meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-muted); font-size: 14px; }
.user-hero .meta > * { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.user-hero .meta a:hover { color: var(--primary); }
.user-hero .projects { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.user-hero .spacer { flex: 1; }
.member-card .role { display: flex; justify-content: center; align-items: center; gap: 4px; flex-wrap: wrap; }

/* ==========================================================================
   Live-Suche
   ========================================================================== */
.live-search {
  position: fixed; z-index: 120; background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 8px; max-height: min(70vh, 640px); overflow-y: auto; animation: popIn .12s ease;
}
.ls-head { font-size: 13px; font-weight: 600; color: var(--text-muted); padding: 10px 10px 4px; }
.ls-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; }
.ls-item:hover, .ls-item.kbd { background: var(--bg-hover); }
.ls-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ls-title { font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-title b { font-weight: 700; }
.ls-sub { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-sub b { font-weight: 700; color: var(--text); }
.ls-sub .project-dot, .ls-proj .project-dot { width: 9px; height: 9px; border-radius: 3px; }
.ls-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--text-faint); display: grid; place-items: center; color: transparent; flex-shrink: 0; }
.ls-check svg { width: 12px; height: 12px; }
.ls-check.done { background: var(--success); border-color: var(--success); color: #fff; }
.ls-more { display: block; color: var(--primary); font-size: 14px; padding: 8px 10px; border-radius: 8px; width: 100%; text-align: left; }
.ls-more:hover, .ls-more.kbd { background: var(--bg-hover); }
.ls-recent { margin: 0 0 6px 42px; border-left: 2px solid var(--border); padding-left: 6px; }
.ls-item.small { padding: 5px 8px; gap: 8px; }
.ls-item.small .ls-title { font-size: 13px; color: var(--text-muted); }
.ls-item.small .ls-check { width: 16px; height: 16px; }
.ls-item.small .ls-check svg { width: 9px; height: 9px; }
.ls-proj { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-faint); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.ls-empty { padding: 18px 12px; color: var(--text-muted); text-align: center; }
@media (max-width: 900px) { .team-head { justify-content: center; padding: 10px 0 4px; } .team-head a > span:last-child, .team-head button, .nav-empty { display: none; } }

/* ==========================================================================
   Desktop-Grundwerte für mobile Bausteine
   ========================================================================== */
.tabbar, .overdue-card { display: none; }
.mt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mt-main .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-proj { display: none; }
.mt-due { width: 86px; text-align: right; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.search-page { max-width: 720px; margin: 0 auto; padding: 20px 16px 120px; }
.search.big { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border-strong); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.search.big svg { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; }
.search.big input { border: 0; outline: 0; flex: 1; font-size: 17px; background: transparent; min-width: 0; }
.search.big:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(69,115,210,.15); }
.search-results { background: #fff; border-radius: 14px; }

/* ==========================================================================
   Mobil (Smartphone & Tablet hochkant, bis 900 px)
   ========================================================================== */
@media (max-width: 900px) {
  html, body { background: var(--bg-subtle); }
  body { -webkit-tap-highlight-color: transparent; }
  .app { height: 100vh; height: 100dvh; }
  .sidebar, .topbar { display: none !important; }
  .view { padding-top: env(safe-area-inset-top); padding-bottom: calc(84px + env(safe-area-inset-bottom)); background: var(--bg-subtle); -webkit-overflow-scrolling: touch; }

  /* Tab-Leiste */
  .tabbar {
    display: flex; align-items: flex-start; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
  }
  .tab-side { flex: 1; display: flex; justify-content: space-around; }
  .tab-item {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 6px; min-width: 64px;
    color: var(--text-muted); text-decoration: none; font-size: 10.5px; font-weight: 500;
  }
  .tab-item svg { width: 24px; height: 24px; stroke-width: 1.8; }
  .tab-item .avatar { width: 26px !important; height: 26px !important; }
  .tab-item.active { color: var(--text); }
  .tab-item.active svg { stroke-width: 2.3; }
  .tab-item.active .avatar { box-shadow: 0 0 0 2px var(--text); }
  .tab-badge { position: absolute; top: 0; left: calc(50% + 6px); background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; }
  .tab-create {
    width: 56px; height: 56px; border-radius: 50%; margin: -20px 6px 0; flex-shrink: 0; color: #fff;
    background: linear-gradient(135deg, #f06a6a, #f8a65a); box-shadow: 0 6px 16px rgba(240,106,106,.4); display: grid; place-items: center;
  }
  .tab-create svg { width: 26px; height: 26px; }
  .tab-create:active { transform: scale(.95); }
  .toasts { bottom: calc(92px + env(safe-area-inset-bottom)); width: calc(100% - 24px); }
  .toast { width: 100%; justify-content: space-between; }

  /* Dashboard */
  .home { padding: 20px 16px 24px; }
  .home-date { text-align: left; font-size: 15px; color: var(--text); }
  .home-greet { text-align: left; font-size: 32px; font-weight: 700; margin: 2px 0 20px; letter-spacing: -.01em; }
  .stats { display: none; }
  .home-grid { grid-template-columns: 1fr; gap: 16px; }
  .home-grid > div { gap: 16px !important; }
  .widget { border-radius: 22px; border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,.03); }
  .widget-head { padding: 20px 20px 8px; flex-wrap: wrap; }
  .widget-head h2 { font-size: 21px; }
  .widget-head .avatar { display: none; }
  .widget-body { padding: 4px 14px 16px; }
  .overdue-card { display: block; background: #fff; border-radius: 22px; border: 1px solid var(--border); padding: 18px 18px 20px; margin-bottom: 16px; }
  .oc-head { display: flex; align-items: flex-start; gap: 8px; }
  .oc-head h3 { flex: 1; margin: 2px 0 14px; font-size: 18px; font-weight: 600; line-height: 1.35; }
  .oc-task { background: var(--bg-subtle); border-radius: 16px; padding: 14px; cursor: pointer; }
  .oc-row { display: flex; align-items: center; gap: 12px; }
  .oc-row .check { width: 24px; height: 24px; }
  .oc-title { font-size: 16px; }
  .oc-meta { margin-top: 12px; }
  .oc-meta .due { font-size: 15px; }
  .oc-proj { margin-left: auto; color: var(--text-muted); font-size: 13px; }
  .oc-update { width: 100%; justify-content: center; margin-top: 14px; padding: 13px; font-size: 16px; border-radius: 14px; }
  .oc-update svg { width: 20px; height: 20px; }

  /* Aufgabenzeilen (Dashboard, Personen-Seite, Suche) */
  .group-title { font-size: 17px; font-weight: 600; padding: 18px 6px 6px; }
  .group-title .n { margin-left: auto; font-weight: 400; color: var(--text-muted); }
  .mytask { align-items: flex-start; gap: 12px; padding: 13px 6px; border-radius: 0; }
  .mytask .check { width: 24px; height: 24px; margin-top: 1px; }
  .mt-main .title { white-space: normal; font-size: 16px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .mt-proj { display: block; font-size: 13px; color: var(--text-muted); margin-top: 3px; }
  .mytask .project-pill { display: none; }
  .mt-due, .task-row .due:not([data-hover-hint]) {
    width: auto; flex-shrink: 0; background: var(--bg-hover); color: var(--text); border-radius: 8px; padding: 4px 11px; font-size: 13px; font-weight: 500; text-align: center;
  }
  .mt-due.overdue, .task-row .due.overdue { background: #fde8ea; color: var(--danger); }
  .mt-due.today, .task-row .due.today { background: var(--success-bg); color: #2e7356; }
  .mt-due.no-due { display: none; }
  .proj-tile { padding: 10px 6px; gap: 14px; }
  .proj-tile .project-icon { width: 52px; height: 52px; border-radius: 14px; }
  .proj-tile .project-icon svg { width: 26px; height: 26px; }
  .proj-tile .name { font-size: 17px; }
  .proj-tile .avatar-stack { display: none; }

  /* Projektseite: kompakte Liste */
  .page-header { padding: 14px 16px 0; }
  .page-title-row { flex-wrap: wrap; gap: 8px; }
  .page-title { font-size: 21px; }
  .page-title-row .avatar-stack { display: none; }
  .page-title-row .btn { padding: 5px 10px; font-size: 12px; }
  .toolbar { padding: 10px 16px; flex-wrap: wrap; gap: 6px; }
  .toolbar > span:not(.spacer) { display: none; }
  .toolbar .btn { font-size: 12px; padding: 5px 9px; }
  .list { padding: 0 12px 24px; }
  .list-head { display: none; }
  .section { margin-top: 14px; background: #fff; border-radius: 16px; padding: 4px 12px 6px; border: 1px solid var(--border); }
  .section-body { border-top: 0; }
  .section-header .drag-handle { display: none; }
  .section-actions { opacity: 1; }
  .task-row { display: flex; align-items: center; min-height: 54px; background: transparent; border-bottom: 1px solid var(--border); }
  .task-row:last-child { border-bottom: 0; }
  .task-row > div { border-left: 0; padding: 0; }
  .task-row > div:first-child { flex: 1; gap: 12px; padding: 8px 0; }
  .task-row .drag-handle, .task-row .row-more, .task-row .cell-assignee, .task-row [data-hover-hint] { display: none !important; }
  .task-row .check { width: 24px; height: 24px; }
  .task-row .task-meta-icons, .card .task-meta-icons { display: none; }
  .task-title { white-space: normal; font-size: 16px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .task-row > div[data-action="due"] { padding-left: 8px; }
  .add-row { padding: 12px 0 12px 4px; font-size: 15px; border-bottom: 1px solid var(--border); }
  .add-section { margin: 14px 4px; }
  .board { padding: 4px 12px 24px; scroll-snap-type: x mandatory; overflow-x: auto; }
  .column { width: 85vw; max-height: none; scroll-snap-align: start; }
  .column-add { width: 85vw; }

  /* Aufgaben-Details im Vollbild */
  .detail { width: 100vw !important; z-index: 60; border-left: 0; padding-top: env(safe-area-inset-top); }
  .detail-top { padding: 10px 12px; }
  .detail-scroll { padding: 14px 16px 24px; }
  .detail-title { font-size: 21px; }
  .fields { grid-template-columns: 110px 1fr; }
  .editor-toolbar { overflow-x: auto; }
  .tb-hint { display: none; }
  .long-date { display: none; }
  .comment-box { padding: 10px 12px; }
  .collaborators { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }

  /* Dialoge als Bottom-Sheet */
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100% !important; max-width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .popover { max-width: calc(100vw - 16px); }

  /* Teams, User, Personen-Seite */
  .team { padding: 16px 16px 24px; }
  .team-grid, .team-grid.teams { grid-template-columns: 1fr 1fr; gap: 12px; }
  .member-card, .team-card { background: #fff; }
  .user-hero { flex-wrap: wrap; gap: 14px; }
  .user-hero h1 { font-size: 22px; flex-wrap: wrap; }
  .hero-actions { justify-content: flex-start; width: 100%; }
  .search-page { padding-top: 16px; }
}
@media (max-width: 520px) {
  .team-grid, .team-grid.teams { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 96px 1fr; font-size: 14px; }
  .tab-item { min-width: 56px; }
}

/* ==========================================================================
   Archivierte Projekte
   ========================================================================== */
.nav-archive { margin-top: 10px; border-top: 1px solid #e3e1df; padding-top: 4px; }
.archive-toggle { width: 100%; justify-content: flex-start; gap: 6px; cursor: pointer; }
.archive-toggle:hover { color: var(--sidebar-text); }
.archive-caret { display: inline-grid; place-items: center; transition: transform .15s; transform: rotate(-90deg); }
.archive-caret svg { width: 13px; height: 13px; }
.open > .archive-toggle .archive-caret, .open > .archive-toggle-row .archive-caret { transform: none; }
.nav-item.archived { color: var(--sidebar-muted); }
.nav-item.archived .project-dot { opacity: .55; }
.archive-banner { display: flex; align-items: center; gap: 12px; margin: 12px 28px 0; padding: 10px 14px; border-radius: var(--radius-lg); background: #f3f1ef; border: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.archive-banner svg { width: 20px; height: 20px; flex-shrink: 0; }
.archive-banner > div { flex: 1; }
.archive-banner b { color: var(--text); }
.archive-group { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 6px; }
.archive-toggle-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); padding: 6px 8px; border-radius: var(--radius); width: 100%; }
.archive-toggle-row:hover { background: var(--bg-subtle); color: var(--text); }
.archived-tiles .proj-tile { opacity: .7; }
@media (max-width: 900px) { .archive-banner { margin: 10px 16px 0; flex-wrap: wrap; } }

/* ==========================================================================
   Mobil – Feinschliff (Größen, Abstände, Details)
   ========================================================================== */
.detail-back, .cb-short, .m-comment, .m-people { display: none; }
@media (max-width: 900px) {
  .view { overflow-x: hidden; }
  /* Dashboard: kleinere Schriften, engere Abstände */
  .home { padding: 14px 14px 20px; }
  .home-date { font-size: 13px; color: var(--text-muted); font-weight: 500; }
  .home-greet { font-size: 22px; font-weight: 600; margin: 2px 0 14px; letter-spacing: 0; }
  .home-grid, .home-grid > div { gap: 12px !important; }
  .widget { border-radius: 16px; }
  .widget-head { padding: 12px 14px 2px; gap: 8px; align-items: center; }
  .widget-head h2 { font-size: 16px; }
  .widget-head .segmented button { padding: 3px 10px; font-size: 12px; }
  .widget-body { padding: 0 10px 10px; }
  .overdue-card { border-radius: 16px; padding: 12px 14px 14px; margin-bottom: 12px; }
  .oc-head h3 { font-size: 14px; margin: 2px 0 10px; }
  .oc-task { border-radius: 12px; padding: 10px 12px; }
  .oc-row .check { width: 20px; height: 20px; }
  .oc-title { font-size: 14px; }
  .oc-meta { margin-top: 8px; }
  .oc-meta .due { font-size: 13px; }
  .oc-meta .avatar { width: 22px !important; height: 22px !important; }
  .group-title { font-size: 13px; padding: 10px 4px 2px; }
  .mytask { padding: 9px 4px; gap: 10px; }
  .mytask .check { width: 20px; height: 20px; }
  .mt-main .title { font-size: 14px; }
  .mt-proj { font-size: 12px; margin-top: 1px; }
  .mt-due, .task-row .due:not([data-hover-hint]) { font-size: 12px; padding: 3px 9px; }
  .proj-tile { padding: 8px 4px; gap: 12px; }
  .proj-tile .project-icon { width: 40px; height: 40px; border-radius: 11px; }
  .proj-tile .project-icon svg { width: 20px; height: 20px; }
  .proj-tile .name { font-size: 14px; }
  .person-row { padding: 6px 4px; }
  .empty { padding: 30px 12px; }
  /* Projektliste etwas kompakter */
  .task-row { min-height: 46px; }
  .task-row .check { width: 20px; height: 20px; }
  .task-title { font-size: 14px; }
  .section-name { font-size: 15px; }
  .add-row { font-size: 14px; padding: 10px 0 10px 4px; }
  .page-title { font-size: 19px; }

  /* Tab-Leiste: Plus wie die anderen Tabs */
  .tab-create { width: auto; height: auto; border-radius: 0; margin: 0; background: none; box-shadow: none; color: var(--text-muted); min-width: 64px; display: flex; }
  .tab-create svg { width: 24px; height: 24px; }
  .tab-create:active { transform: none; opacity: .6; }

  /* Details: Zurück links, Erledigt rechts */
  .detail-back { display: inline-grid; margin-right: auto; }
  .detail-back svg { width: 22px; height: 22px; color: var(--text); }
  .detail-close { display: none; }
  .detail-top { gap: 4px; }
  .detail-top .spacer { display: none; }
  .complete-btn { order: 2; padding: 5px 10px; }
  .detail-top [data-d="attach"] { order: 3; }
  .detail-top [data-d="more"] { order: 4; }
  .cb-long { display: none; }
  .cb-short { display: inline; }
  .detail { transition: transform .22s ease; will-change: transform; }

  /* Kommentare klein am Ende des Inhalts, Beteiligte separat */
  .activity { margin-top: 20px; padding-top: 12px; }
  .m-comment { display: block; margin-top: 8px; }
  .m-comment textarea { min-height: 40px; resize: none; font-size: 15px; padding: 9px 11px; }
  .m-comment-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
  .m-people { display: block; margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--border); }
  .m-people h4 { font-size: 13px; font-weight: 600; margin: 0 0 8px; }
  .m-people-list { display: flex; flex-wrap: wrap; gap: 8px 14px; }
  .m-person { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
  .detail-scroll { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   Seite „Projekte“ (Tab-Leiste)
   ========================================================================== */
.plist { max-width: 720px; margin: 0 auto; padding: 16px 14px 24px; }
.plist-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.plist-head h1 { margin: 0; font-size: 22px; font-weight: 600; }
.plist-head .spacer { flex: 1; }
.plist-group { margin-top: 14px; }
.plist-team { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); text-decoration: none; padding: 0 4px 6px; }
.plist-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.plist-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.plist-item:last-child { border-bottom: 0; }
.plist-item:active { background: var(--bg-hover); }
.plist-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.plist-name { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist-meta { font-size: 13px; color: var(--text-muted); }
.plist-chevron { width: 16px; height: 16px; color: var(--text-faint); flex-shrink: 0; }
.plist-item.archived { color: var(--text-muted); }
.plist-item.archived .plist-icon { opacity: .55; }
.plist-empty { padding: 12px; color: var(--text-muted); font-size: 13px; }
.plist .archive-group { border-top: 0; }

/* ==========================================================================
   Login-Bereich
   ========================================================================== */
.logins { display: grid; grid-template-columns: 340px 1fr; height: 100%; }
.lg-list-pane { border-right: 1px solid var(--border); padding: 18px 16px; overflow-y: auto; display: flex; flex-direction: column; }
.lg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lg-head h1 { margin: 0; font-size: 20px; font-weight: 600; }
.lg-head .spacer { flex: 1; }
.lg-head .project-icon { width: 32px; height: 32px; }
.lg-search { display: flex; align-items: center; gap: 8px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; margin-bottom: 10px; color: var(--text-muted); }
.lg-search svg { width: 16px; height: 16px; }
.lg-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; }
.lg-list { flex: 1; }
.lg-item { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.lg-item:hover { background: var(--bg-hover); }
.lg-item.active { background: var(--bg-active); }
.lg-icon { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #6d6e6f, #9ca0a3); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.lg-icon.big { width: 44px; height: 44px; border-radius: 11px; font-size: 15px; }
.lg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lg-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-host { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-note { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--text-faint); margin-top: 14px; line-height: 1.4; }
.lg-note svg { flex-shrink: 0; margin-top: 1px; }
.lg-detail-pane { overflow-y: auto; }
.lg-empty { padding-top: 120px; }
.lg-detail { max-width: 640px; padding: 28px 32px; }
.lg-back { display: none; }
.lg-title { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.lg-title h2 { margin: 0; font-size: 22px; font-weight: 600; }
.lg-title .spacer { flex: 1; }
.lg-field { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.lg-label { color: var(--text-muted); font-size: 13px; }
.lg-value { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.lg-secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; letter-spacing: .08em; color: var(--text-muted); margin-right: 4px; }
.lg-secret.revealed { color: var(--text); letter-spacing: 0; user-select: all; word-break: break-all; white-space: pre-wrap; }
.lg-link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); text-decoration: none; font-weight: 500; }
.lg-link:hover { text-decoration: underline; }
.lg-meta { margin-top: 16px; font-size: 12px; color: var(--text-faint); }
@media (max-width: 900px) {
  .logins { display: block; }
  .lg-list-pane { border-right: 0; padding: 14px; }
  .logins.has-detail .lg-list-pane { display: none; }
  .logins:not(.has-detail) .lg-detail-pane { display: none; }
  .lg-list { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 4px; }
  .lg-detail { padding: 14px 16px; }
  .lg-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); text-decoration: none; font-size: 14px; margin-bottom: 12px; }
  .lg-back svg { width: 18px; height: 18px; }
  .lg-field { grid-template-columns: 1fr; gap: 4px; }
  .hide-sm { display: none; }
}

/* ==========================================================================
   Flowerflow-Design: Logo, Akzente
   ========================================================================== */
:root { --sage: #c3cabd; --navy: #1c2b3b; --navy-2: #345577; --taupe: #ab9675; --offwhite: #f5f2ee; }
a { color: var(--navy-2); }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0; }
.brand-name { height: 11px; width: auto; display: block; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-wordmark { height: 13px; width: auto; }
.btn-create { background: var(--navy); }
.btn-create:hover { background: var(--accent-hover); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(52, 85, 119, .16); }
.role-badge.admin { background: #efe8de; color: #7a6544; }
.role-badge.lead { background: #e4e9e0; color: #4f6250; }
.tab-badge { background: var(--navy); }
.check.done, .ls-check.done { background: var(--success); border-color: var(--success); }
.auth { background: radial-gradient(1200px 600px at 10% -10%, #e9ece5 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #efe8de 0%, transparent 60%), var(--offwhite); }
.org-switch.static { cursor: default; }
.org-switch.static:hover { border-color: #dcd9d6; box-shadow: none; }
.team-head a { gap: 0; }
@media (max-width: 900px) { .brand-name { display: none; } }

/* Farbwähler mit Hex-Code */
.color-custom { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.color-custom input[type=color] { width: 40px; height: 34px; padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; cursor: pointer; }
.color-custom input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
.color-custom input[type=color]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.color-custom .hex { width: 110px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: lowercase; }
.color-pop { padding: 12px; width: 300px; }

/* Team Lead */
.lead-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); margin-left: auto; }
.lead-toggle input { width: 14px; height: 14px; }
.triage { margin-bottom: 20px; }
.triage .widget-head h2 { font-size: 17px; }
.tri-count { background: var(--navy); color: #fff; border-radius: 10px; font-size: 12px; font-weight: 600; padding: 1px 8px; }
.tri-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-bottom: 1px solid var(--border); cursor: pointer; }
.tri-row:last-of-type { border-bottom: 0; }
.tri-row:hover { background: var(--bg-subtle); }
.tri-row .title { font-size: 14px; }
.tri-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tri-meta .project-dot { width: 8px; height: 8px; border-radius: 3px; }
.tri-quick { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.tri-av { border-radius: 50%; padding: 0; line-height: 0; transition: transform .1s; }
.tri-av:hover { transform: scale(1.12); box-shadow: 0 0 0 2px var(--navy-2); }

/* Personen-Seite & Dashboard: Raster nicht breiter als der Platz */
.home-grid > * { min-width: 0; }
.mytask { min-height: 0; }

/* Desktop: Detail-Panel schiebt die Liste zur Seite statt sie zu überdecken */
.main { transition: margin-right .22s ease; }
@media (min-width: 1100px) {
  .app.detail-open .main { margin-right: var(--detail-w); }
  .detail.open { box-shadow: -1px 0 0 var(--border); }
}

/* Beschreibungs-Editor: Formatierungsleiste bleibt beim Scrollen sichtbar */
.editor-toolbar { position: sticky; top: -16px; z-index: 6; }

/* Plus-Menü mobil: breites Slide-over mit Pfeil zum Plus */
.popover.create-sheet { padding: 10px; border-radius: 18px; overflow: visible; max-height: none; box-shadow: 0 -6px 30px rgba(26, 37, 51, .18), 0 2px 8px rgba(26, 37, 51, .08); animation: sheetIn .16s ease; }
.popover.create-sheet .menu-item { padding: 14px 14px; font-size: 16px; gap: 14px; border-radius: 12px; }
.popover.create-sheet .menu-item svg { width: 22px; height: 22px; }
.popover.create-sheet::after { content: ""; position: absolute; bottom: -10px; left: var(--arrow-x, 50%); transform: translateX(-50%); border: 11px solid transparent; border-bottom: 0; border-top-color: #fff; filter: drop-shadow(0 2px 1px rgba(26, 37, 51, .08)); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  /* iOS-Web-App: kein Scroll-Unschärfe-Effekt oben – das Dokument selbst scrollt nicht */
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  .view { overscroll-behavior: contain; }
  .app::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--bg-subtle); z-index: 70; pointer-events: none; }
  .tri-row { flex-wrap: wrap; }
  .tri-quick { width: 100%; justify-content: flex-end; }
  .triage .hint { display: none; }
}

/* Leere Datumsspalte (Desktop): keine Höhe */
.mt-due.no-due { padding: 0; }

/* Geöffnetes Detail-Panel am Desktop: Liste kompakter, Titel bleibt lesbar */
.page-title { min-width: 60px; }
@media (min-width: 1100px) {
  .app.detail-open .page-title-row .page-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
  .app.detail-open .page-title-row .avatar-stack { display: none; }
  .app.detail-open .list-head, .app.detail-open .task-row { grid-template-columns: 1fr 48px 104px 32px; }
  .app.detail-open .cell-assignee .name { display: none; }
  .app.detail-open .toolbar > span:not(.spacer) { display: none; }
}
@media (min-width: 1100px) and (max-width: 1500px) { :root { --detail-w: 480px; } }

.list-head > div { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

@media (max-width: 900px) {
  .triage .widget-head h2 { font-size: 16px; }
  .tri-quick { justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
  .tri-quick .tri-av:nth-child(n+5) { display: none; }
  .tri-row { padding: 10px 4px; }
}

/* Seitentitel (Projekt, Team, …) immer einzeilig; Avatare und Buttons rutschen bei wenig Platz darunter */
.page-title-row { flex-wrap: wrap; row-gap: 10px; }
.page-title { white-space: nowrap; flex: 0 0 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.page-title-row .spacer { flex: 1 1 0; min-width: 0; }

/* Links, die wie Buttons aussehen, ohne Link-Farbe und Unterstreichung */
a.btn { color: var(--text); text-decoration: none; }
a.btn.btn-primary { color: #fff; }
.plist-head .btn svg { width: 15px; height: 15px; }
