/* ═══════════════════════════════════════════════════════════
   IQtodo · style.css
   IQment Brand Design System – Mobile First
   Version: 1.6.0  |  2026-04-04
═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════
   DESIGN TOKENS  –  IQment Brand
═══════════════════════════════════════════ */
:root {
  /* Brand */
  --cream:       #f0ebe0;
  --cream-dark:  #e8e2d6;
  --cream-deep:  #dfd8ca;
  --header-bg:   #4A9A9E;
  --red:         #FF6C0C;
  --red-dark:    #d95a08;
  --red-light:   #ff8c3c;
  --navy:        #1a3a5c;
  --navy-light:  #2563a8;
  --steel:       #4a6880;

  /* UI */
  --surface:     #ffffff;
  --surface2:    #f8f4ee;
  --border:      #ddd5c4;
  --border-dark: #c9bfad;
  --text:        #1c1c1a;
  --text-mid:    #4a4540;
  --text-soft:   #8a8078;
  --text-dim:    #b5aba0;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(28,28,26,.08);
  --shadow-md:  0 4px 16px rgba(28,28,26,.10);
  --shadow-lg:  0 8px 32px rgba(28,28,26,.13);

  /* Layout */
  --sidebar-w: 260px;
  --header-h:  60px;
  --radius:    10px;
  --radius-sm: 6px;
}

/* ── RESET ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  background: var(--cream);
  color: var(--text);
  line-height: 1.5;
}

/* ── SCROLLBARS ── */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius:3px; }

/* ══════════════════════════════════════════
   LAYOUT SHELL
══════════════════════════════════════════ */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  height: 100vh;
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.topbar {
  grid-column: 1 / -1;
  background: var(--header-bg);
  display: flex;
  align-items: center;
  padding: 0 20px 0 16px;
  gap: 16px;
  border-bottom: 2px solid var(--red);
}

/* Logo area */
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

/* Inline SVG logo (recreated from brand image) */
.logo-img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

.logo-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.15);
}

.app-name {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -.2px;
}
.app-name span {
  color: var(--red-light);
}

/* NAV TABS (center) */
.nav-tabs {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,.07);
  border-radius: 8px;
  padding: 3px;
  /* Zentriert ohne absolute Position → überlappt nie mit topbar-right */
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.nav-tab {
  padding: 6px 18px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.55);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all .18s;
  white-space: nowrap;
}
.nav-tab.active {
  background: var(--red);
  color: #fff;
}
.nav-tab:hover:not(.active) { color: #fff; background: rgba(255,255,255,.10); }

/* Mitglieder-Tab: dezenter, etwas abgesetzt */
.nav-tab-members {
  opacity: .55;
  font-size: 16px;
  padding: 4px 10px;
  margin-left: 4px;
  border-left: 1px solid rgba(255,255,255,.10);
}
.nav-tab-members:hover { opacity: 1; }
.nav-tab-members.active { opacity: 1; background: rgba(255,255,255,.12); }

/* RIGHT: drive status + auth */
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Drive status pill */
.drive-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.5);
  white-space: nowrap;
  transition: all .25s;
}
.drive-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  flex-shrink: 0;
  transition: background .25s;
}

/* pill states */
.drive-pill.s-idle    { }
.drive-pill.s-loading { border-color: rgba(99,102,241,.5); color: #a5b4fc; }
.drive-pill.s-loading .drive-dot { background: #818cf8; animation: blink .7s infinite; }
.drive-pill.s-saving  { border-color: rgba(234,179,8,.4); color: #fde68a; }
.drive-pill.s-saving  .drive-dot { background: #fbbf24; animation: blink .7s infinite; }
.drive-pill.s-saved   { border-color: rgba(34,197,94,.4); color: #86efac; }
.drive-pill.s-saved   .drive-dot { background: #4ade80; }
.drive-pill.s-error   { border-color: rgba(239,68,68,.4); color: #fca5a5; }
.drive-pill.s-error   .drive-dot { background: #f87171; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }

/* Google sign-in button */
.btn-google {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #fff;
  color: #3c4043;
  border: none;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow .2s, opacity .2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.btn-google:disabled { opacity: .6; cursor: wait; }

/* User avatar chip */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255,255,255,.8);
  transition: border-color .2s;
}
.user-chip:hover { border-color: var(--red-light); color: #fff; }
.user-chip img { width: 22px; height: 22px; border-radius: 50%; }
.user-chip-x { color: rgba(255,255,255,.35); font-size: 11px; margin-left: 2px; }

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.sb-section {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.sb-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

/* Member list */
.member-list { display: flex; flex-direction: column; gap: 4px; }

.member-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
  border: 1px solid transparent;
}
.member-row:hover { background: var(--cream); }
.member-row.active { background: var(--cream-dark); border-color: var(--border); }

.member-avatar {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.member-name { font-size: 12px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-badge {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--cream-dark);
  color: var(--text-soft);
  font-weight: 600;
}

.add-member {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.sb-input {
  flex: 1;
  padding: 6px 10px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.sb-input:focus { border-color: var(--navy-light); }
.sb-input::placeholder { color: var(--text-dim); }

.btn-plus {
  width: 30px; height: 30px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
  flex-shrink: 0;
  line-height: 1;
}
.btn-plus:hover { background: var(--red-dark); }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.stat-box {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.stat-num {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.stat-lbl { font-size: 10px; color: var(--text-soft); margin-top: 3px; }

/* Filters */
.filter-list { display: flex; flex-direction: column; gap: 2px; }
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  border: 1px solid transparent;
  transition: all .15s;
}
.filter-row:hover { background: var(--cream); color: var(--text); }
.filter-row.active { background: var(--cream-dark); color: var(--text); border-color: var(--border); }
.filter-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ══════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════ */
.main {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}

.view { display: none; flex-direction: column; flex: 1; }
.view.active { display: flex; }

/* ── TODO VIEW ── */
.view-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
}

.view-title {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  color: var(--text);
}

/* ── Header Stat Buttons ── */
.header-stats {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}

.hstat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--cream);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.hstat-btn:hover { box-shadow: var(--shadow-sm); }
.hstat-btn.active { box-shadow: var(--shadow-md); }

.hstat-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 3px;
}
.hstat-lbl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* Farben pro Button */
.hstat-urgent                  { border-color: #e8b4b0; }
.hstat-urgent .hstat-num       { color: var(--red); }
.hstat-urgent.active           { background: #fdf0ef; border-color: var(--red); }

.hstat-open                    { border-color: #e8d9a0; }
.hstat-open   .hstat-num       { color: #b45309; }
.hstat-open.active             { background: #fdf8ec; border-color: #b45309; }

.hstat-done                    { border-color: #b4ddb4; }
.hstat-done   .hstat-num       { color: #16a34a; }
.hstat-done.active             { background: #edfaed; border-color: #16a34a; }

.hstat-total                   { border-color: #c0b8b0; background: #7a736c; }
.hstat-total  .hstat-num       { color: #fff; }
.hstat-total  .hstat-lbl       { color: rgba(255,255,255,.7); }
.hstat-total.active            { background: #5a5550; border-color: #5a5550; }

/* Blinken wenn Dringend > 0 */
@keyframes urgentPulse {
  0%, 100% { border-color: #e8b4b0; background: var(--cream); }
  50%       { border-color: var(--red); background: #fdf0ef; box-shadow: 0 0 0 3px rgba(192,57,43,.15); }
}
.hstat-urgent.has-urgent {
  animation: urgentPulse 1.6s ease-in-out infinite;
}

.prio-select {
  padding: 6px 10px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  outline: none;
}

.assign-chips { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.a-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: .4;
  transition: opacity .15s, border-color .15s;
  user-select: none;
}
.a-chip:hover { opacity: .7; }
.a-chip.on    { opacity: 1; }

.add-row {
  padding: 10px 24px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* Schlanke Add-Row – nur Hinzufügen-Button (Modal-Variante) */
.add-row-slim {
  padding: 10px 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.task-input {
  flex: 1;
  padding: 9px 13px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.task-input:focus { border-color: var(--navy-light); }
.task-input::placeholder { color: var(--text-dim); }

.btn-primary {
  padding: 9px 18px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }

/* Task list */
.task-area { flex: 1; padding: 14px 24px; }

.group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 7px;
}
.group-label::after { content:''; flex:1; height:1px; background:var(--border); }

.task-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 5px;
  transition: box-shadow .2s, border-color .2s;
  animation: fadeUp .22s ease;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:none} }
.task-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-dark); }
.task-card:hover .task-edit-btn { opacity: 1; }
.task-edit-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 5px;
  border-radius: 4px;
  transition: all .15s;
  flex-shrink: 0;
  opacity: 0;
  line-height: 1;
}
.task-edit-btn:hover { color: var(--navy-light); background: #2563a812; }
.task-card.done { opacity: .5; }
.task-card.done .task-txt { text-decoration: line-through; }

.check-box {
  width: 18px; height: 18px;
  border: 2px solid var(--border-dark);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.check-box:hover { border-color: var(--red); }
.check-box.ticked { background: var(--red); border-color: var(--red); }
.check-box.ticked::after { content:'✓'; color:#fff; font-size:10px; font-weight:700; }

.task-body { flex: 1; min-width: 0; }
.task-txt { font-size: 13px; line-height: 1.4; word-break: break-word; }
.task-meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; flex-wrap: wrap; }

.av-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  padding: 0;
}

.prio-tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid;
}
.prio-high   { border-color:#c0392b; color:#c0392b; background:#c0392b10; }
.prio-medium { border-color:#d4a017; color:#c18a10; background:#d4a01710; }
.prio-low    { border-color:#2563a8; color:#2563a8; background:#2563a810; }

.task-date { font-size: 10px; color: var(--text-dim); }

.del-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 1px 5px;
  border-radius: 4px;
  transition: all .15s;
  flex-shrink: 0;
  line-height: 1;
}
.del-btn:hover { color: var(--red); background: #c0392b12; }

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-txt { font-size: 12px; }

/* ── KANBAN VIEW ── */
#view-kanban {
  padding: 20px;
  overflow-x: auto;
}

.kanban-board { display: flex; gap: 14px; min-width: max-content; }

.k-col {
  width: 268px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-h) - 40px);
  box-shadow: var(--shadow-sm);
}

.k-col-head {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.k-col-bar { width: 4px; height: 16px; border-radius: 2px; flex-shrink: 0; }
.k-col-title { font-size: 13px; font-weight: 700; flex: 1; }
.k-count {
  background: var(--cream-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  color: var(--text-soft);
}

.k-cards {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.k-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  transition: box-shadow .2s, border-color .2s;
  animation: fadeUp .22s ease;
}
.k-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-dark); }
.k-card-txt { font-size: 12px; line-height: 1.4; margin-bottom: 8px; }
.k-card-foot { display: flex; align-items: center; justify-content: space-between; }
.k-move-row { margin-top: 8px; display: flex; gap: 5px; align-items: center; }

.k-move-sel {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  padding: 4px 6px;
  color: var(--text-soft);
  cursor: pointer;
}

.k-add-btn {
  margin: 8px 10px 10px;
  padding: 7px;
  background: transparent;
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.k-add-btn:hover { border-color: var(--red); color: var(--red); }

/* ── CALENDAR VIEW ── */
#view-calendar { padding: 20px; }

.cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.cal-arrow {
  width: 32px; height: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: border-color .15s;
}
.cal-arrow:hover { border-color: var(--red); color: var(--red); }
.cal-title { font-size: 18px; font-weight: 700; flex: 1; }
.cal-today-btn {
  padding: 5px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s;
}
.cal-today-btn:hover { border-color: var(--red); color: var(--red); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cal-hdr {
  background: var(--header-bg);
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: 8px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.cal-day {
  background: var(--surface);
  padding: 8px;
  min-height: 86px;
  cursor: pointer;
  transition: background .12s;
}
.cal-day:hover { background: var(--cream); }
.cal-day.faded { opacity: .35; }
.cal-day.today { outline: 2px solid var(--red); outline-offset: -2px; }
.cal-day-num { font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.cal-day.today .cal-day-num { color: var(--red); }

.cal-pip {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── MODAL ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28,28,26,.45);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  width: 400px;
  max-width: 94vw;
  box-shadow: var(--shadow-lg);
  animation: popIn .22s ease;
}
@keyframes popIn { from{opacity:0;transform:scale(.96) translateY(8px)} to{opacity:1;transform:none} }

.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; font-weight: 600; color: var(--text-soft); margin-bottom: 5px; }
.field input, .field select {
  width: 100%;
  padding: 8px 11px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.field input:focus, .field select:focus { border-color: var(--navy-light); }

.modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.btn-ghost {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color .15s;
}
.btn-ghost:hover { border-color: var(--text-soft); color: var(--text); }

/* ── KATEGORIEN ── */
.cat-section { border-bottom: 1px solid var(--border); }

.cat-main {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px 7px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  transition: background .15s;
  user-select: none;
  border-left: 3px solid transparent;
}
.cat-main:hover { background: var(--cream); color: var(--text); }
.cat-main.active { background: var(--cream-dark); color: var(--text); border-left-color: var(--red); }

.cat-arrow {
  font-size: 9px;
  margin-left: auto;
  transition: transform .2s;
  color: var(--text-dim);
  flex-shrink: 0;
}
.cat-main.open .cat-arrow { transform: rotate(90deg); }

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

.cat-sub-list {
  display: none;
  flex-direction: column;
  padding: 0 0 4px 0;
}
.cat-sub-list.open { display: flex; }

.cat-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px 5px 26px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-soft);
  transition: background .12s;
  border-left: 3px solid transparent;
}
.cat-sub:hover { background: var(--cream); color: var(--text); }
.cat-sub.active { background: var(--cream-dark); color: var(--text); border-left-color: var(--red); font-weight: 600; }

.cat-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--cream-dark);
  padding: 1px 6px;
  border-radius: 20px;
  flex-shrink: 0;
}

.cat-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .15s;
  flex-shrink: 0;
}
/* Desktop: nur bei Hover anzeigen */
@media (hover: hover) {
  .cat-main:hover .cat-actions,
  .cat-sub:hover .cat-actions { opacity: 1; }
}
/* Touch-Geräte: immer sichtbar */
@media (hover: none) {
  .cat-actions { opacity: 1; }
}

.cat-btn {
  width: 18px; height: 18px;
  border: none;
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-soft);
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  line-height: 1;
}
.cat-btn:hover { background: var(--cream-deep); }
.cat-btn.del:hover { background: #c0392b18; color: var(--red); }

/* Category modal */
.cat-color-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.cat-color-opt {
  width: 24px; height: 24px;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s;
  flex-shrink: 0;
}
.cat-color-opt:hover { transform: scale(1.15); }
.cat-color-opt.selected { border-color: var(--text); transform: scale(1.1); }

/* ── VERSION BADGE ── */
.version-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}
.version-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  box-shadow: 0 0 6px #4ade8088;
}
.version-num {
  font-size: 11px;
  font-weight: 700;
  color: #c8b89a;
  letter-spacing: .04em;
}
.version-date {
  font-size: 10px;
  font-weight: 400;
  color: #504840;
  letter-spacing: .03em;
}

/* ── MEMBER EDIT CONTROLS ── */
.member-actions {
  display: flex;
  gap: 4px;
  margin-left: 4px;
  opacity: 0;
  transition: opacity .15s;
  flex-shrink: 0;
}
.member-row:hover .member-actions { opacity: 1; }

.member-action-btn {
  width: 22px; height: 22px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: background .15s;
  color: var(--text-soft);
  line-height: 1;
  padding: 0;
}
.member-action-btn:hover { background: var(--cream-deep); }
.member-action-btn.del:hover { background: #c0392b18; color: var(--red); }

/* Edit member modal color picker */
.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.color-swatch {
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s;
  flex-shrink: 0;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--text); transform: scale(1.1); }

/* ── DATE PICKER & REPEAT ── */
.date-inp {
  padding: 6px 10px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
  min-width: 0;
}
.date-inp:focus { border-color: var(--navy-light); }

.repeat-sel {
  padding: 6px 8px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.repeat-sel:focus { border-color: var(--navy-light); }

/* Due-date badge on task card */
.due-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid;
}
.due-ok       { border-color: var(--border-dark); color: var(--text-soft); background: var(--cream); }
.due-today    { border-color: #0093AF; color: #0093AF; background: #0093AF15; font-weight: 800; }
.due-tomorrow { border-color: #16a34a; color: #16a34a; background: #16a34a15; font-weight: 800; }
.due-soon     { border-color: #d4a017; color: #b8860b; background: #d4a01712; }
.due-overdue  { border-color: #CE2029; color: #CE2029; background: #CE202918; font-weight: 800; }

/* Repeat badge */
.repeat-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--navy-light);
  color: #fff;
  opacity: .85;
}

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  padding: 10px 18px;
  background: var(--header-bg);
  color: #fff;
  border-left: 3px solid var(--red);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  z-index: 999;
  box-shadow: var(--shadow-lg);
  transform: translateY(60px);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
  pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.ok   { border-color: #22c55e; }
#toast.err  { border-color: var(--red); }


/* ═══════════════════════════════════════════════════════════
   MOBILE FIRST  –  Smartphone-Layout (Standard)
   Alle Basis-Styles gelten für Smartphones.
   Desktop-Erweiterungen kommen via @media (min-width:...)
═══════════════════════════════════════════════════════════ */

/* ── Shell: Mobile = 1 Spalte, kein Sidebar ── */
@media (max-width: 767px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-h) auto 1fr;
    height: 100dvh;  /* dynamic viewport height für Mobile */
  }

  /* Sidebar auf Mobile: horizontal scrollbarer Streifen */
  .sidebar {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
    min-height: 0;
  }

  .sb-section {
    flex-shrink: 0;
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: 10px 12px;
    min-width: 140px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    min-width: 280px;
  }

  .stat-box { padding: 6px 8px; }
  .stat-num { font-size: 16px; }

  .member-list { flex-direction: row; gap: 4px; }
  .member-row  { padding: 4px 8px; min-width: max-content; }

  .filter-list { flex-direction: row; gap: 4px; }
  .filter-row  { padding: 4px 8px; min-width: max-content; white-space: nowrap; }

  /* Main: volle Breite */
  .main {
    grid-column: 1;
    grid-row: 3;
  }

  /* Header: kompakter */
  .topbar { padding: 0 10px; gap: 8px; }
  .app-name { font-size: 13px; }

  /* Nav-Tabs in Header: kleiner */
  .nav-tabs { padding: 2px; }
  .nav-tab  { padding: 4px 10px; font-size: 11px; }

  /* Drive-Pill auf Mobile ausblenden (spart Platz) */
  .drive-pill { display: none; }

  /* Version-Badge auf Mobile ausblenden */
  .version-badge { display: none; }

  /* Add-Row: umbrechen */
  .add-row {
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 6px;
  }

  .add-row-slim {
    padding: 8px 12px;
  }

  .task-input { min-width: 100%; }
  .btn-primary { width: 100%; justify-content: center; }

  /* Task-Karten: kompakter */
  .task-area { padding: 10px 12px; }
  .task-card { padding: 10px 11px; }

  /* Kanban: horizontal scrollen */
  #view-kanban { padding: 10px; }
  .k-col { width: 240px; }

  /* Kalender: kleinere Zellen */
  .cal-day { padding: 5px; min-height: 60px; }
  .cal-day-num { font-size: 10px; }
  #view-calendar { padding: 10px; }

  /* Modals: fast vollbild */
  .modal {
    width: 96vw !important;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 18px;
    margin: 0 auto;
  }

  /* Kategorie-Sidebar auf Mobile */
  .cat-main { padding: 6px 10px; font-size: 11px; }
  .cat-sub  { padding: 4px 10px 4px 20px; font-size: 11px; }
}

/* ── Tablet ── */
@media (min-width: 768px) and (max-width: 1023px) {
  :root { --sidebar-w: 200px; }

  .nav-tab { padding: 5px 12px; font-size: 11px; }
  .drive-pill { font-size: 10px; padding: 3px 8px; }
  .modal { width: 90vw !important; max-width: 480px; }
}

/* ── Desktop (min-width: 1024px): Original-Layout ── */
@media (min-width: 1024px) {
  /* Alles wie bisher — Shell mit Sidebar */
  .shell {
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--header-h) 1fr;
    height: 100vh;
  }

  .sidebar {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid var(--border);
    border-bottom: none;
    max-height: unset;
  }

  .sb-section {
    flex-direction: column;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .main {
    grid-column: 2;
    grid-row: 2;
  }

  .drive-pill { display: flex; }
  .version-badge { display: flex; }
}

/* ── Touch-freundliche Tap-Targets ── */
@media (hover: none) and (pointer: coarse) {
  .check-box  { width: 24px; height: 24px; }
  .del-btn    { padding: 6px 10px; font-size: 18px; }
  .cat-btn    { width: 28px; height: 28px; }
  .member-action-btn { width: 28px; height: 28px; }
  .filter-row { padding: 10px 9px; }
  .member-row { padding: 10px 9px; }
  .nav-tab    { padding: 10px 14px; }
  .btn-plus   { width: 38px; height: 38px; }
  .a-chip     { width: 32px; height: 32px; font-size: 11px; }
}

/* ── Safe Area für iPhone Notch/Home-Indicator ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .main          { padding-bottom: env(safe-area-inset-bottom); }
  .add-row       { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .add-row-slim  { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  #toast         { bottom: calc(18px + env(safe-area-inset-bottom)); }
}

/* ── SPRACHUMSCHALTER ── */
.lang-switch {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,.07);
  border-radius: 6px;
  padding: 2px;
  flex-shrink: 0;
}
.lang-btn {
  padding: 3px 9px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.45);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  transition: all .15s;
  letter-spacing: .05em;
}
.lang-btn:hover  { color: #fff; }
.lang-btn.active { background: var(--red); color: #fff; }

/* Due-Status: Aufgabentitel-Hervorhebung */
.txt-due-overdue  { font-weight: 700 !important; background: #CE2029 !important; color: #fff !important; border-radius: 4px; padding: 1px 6px; margin: -1px -6px; }
.txt-due-today    { font-weight: 700 !important; background: #d4a017 !important; color: #fff !important; border-radius: 4px; padding: 1px 6px; margin: -1px -6px; }
.txt-due-tomorrow { font-weight: 700 !important; }
