/* =========================================================
   WIEtrac – Styles
   Palette: #3D348B · #7678ED · #F7B801 · #F18701 · #F35B04
   ========================================================= */

/* Schrift lokal (DSGVO-freundlich, offline) – Plus Jakarta Sans, SIL Open Font License (fonts/OFL.txt) */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/PlusJakartaSans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/PlusJakartaSans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --indigo: #3D348B;
  --indigo-700: #2F2870;
  --indigo-900: #1E1B3A;
  --violet: #7678ED;
  --violet-300: #A9A6F5;
  --yellow: #F7B801;
  --orange: #F18701;
  --red: #F35B04;

  --primary: var(--indigo);
  --primary-hover: var(--indigo-700);
  --accent: var(--violet);

  --bg: #F6F5FB;
  --surface: #FFFFFF;
  --surface-2: #FAFAFE;
  --border: #ECEAF4;
  --border-strong: #DCD9EC;
  --text: #1E1B3A;
  --text-2: #5B5876;
  --text-3: #9895AE;
  --tint: #F0EFFD;
  --tint-2: #E3E1FB;

  --ok: #1F9D6B;
  --warn: var(--orange);
  --danger: var(--red);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-sm: 0 1px 2px rgba(30, 27, 58, .05);
  --shadow: 0 1px 2px rgba(30, 27, 58, .04), 0 6px 20px rgba(30, 27, 58, .05);
  --shadow-lg: 0 20px 60px rgba(30, 27, 58, .18);
  --sidebar-w: 252px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.num, .tabular { font-variant-numeric: tabular-nums; }

.ic { width: 18px; height: 18px; flex: none; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  z-index: 40;
  transition: transform .25s ease;
}
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.02em;
  box-shadow: 0 6px 16px rgba(61, 52, 139, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--indigo); }
.brand-text strong span { color: var(--violet); }
.brand-text small { color: var(--text-3); font-size: 11.5px; font-weight: 500; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-section {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-3); padding: 16px 12px 6px;
}
.nav-section:first-child { padding-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--tint); color: var(--indigo); font-weight: 600; }
.nav-item.active .ic { color: var(--indigo); }
.nav-item .ic { color: var(--text-3); }
.nav-item .count {
  margin-left: auto; font-size: 11.5px; font-weight: 600;
  min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.nav-item.active .count { background: #fff; border-color: var(--tint-2); color: var(--indigo); }
.nav-item .count.alert { background: #FFF1E8; border-color: #FFD9C2; color: var(--red); }

.sidebar-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.goal-card {
  border-radius: 14px; padding: 14px;
  background: linear-gradient(150deg, var(--indigo) 0%, #4F45A8 100%);
  color: #fff;
}
.goal-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; font-weight: 600; }
.goal-card .value { font-size: 20px; font-weight: 700; margin: 2px 0 10px; }
.goal-card .value small { font-size: 12px; opacity: .7; font-weight: 500; }
.goal-card .track { height: 6px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.goal-card .track span { display: block; height: 100%; background: var(--yellow); border-radius: 99px; }
.user-bar { display: flex; align-items: center; gap: 4px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); flex: 1; min-width: 0; }
.user-bar .icon-btn { color: var(--text-3); }
.user-bar .icon-btn:hover { color: var(--red); background: #FFF1E8; }
.user-row:hover { background: var(--surface-2); }
.user-row .meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-row .meta strong { font-size: 13px; font-weight: 600; }
.user-row .meta small { font-size: 11.5px; color: var(--text-3); }
.user-row .ic { margin-left: auto; color: var(--text-3); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: var(--tint-2); color: var(--indigo);
  font-size: 12px; font-weight: 700;
}
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.other { background: #FFF4D6; color: #9A6B00; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 32px;
  background: rgba(246, 245, 251, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.search { position: relative; flex: 1; max-width: 440px; }
.search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); display: flex; }
.search input {
  width: 100%; height: 40px; padding: 0 14px 0 38px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(118, 120, 237, .14); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 420px; overflow-y: auto;
}
.search-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--text-3); padding: 8px 10px 4px; }
.search-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; background: none; border-radius: 9px; text-align: left;
}
.search-item:hover { background: var(--tint); }
.search-item small { color: var(--text-3); margin-left: auto; white-space: nowrap; }
.search-empty { padding: 14px; color: var(--text-3); text-align: center; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--indigo); border-color: var(--border-strong); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 2px var(--surface);
}
.icon-btn.ghost { background: transparent; border-color: transparent; width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.ghost:hover { background: var(--tint); }
.only-mobile { display: none; }

.notif-wrap { position: relative; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 340px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 8px; z-index: 50;
}
.dropdown-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 10px; }
.dropdown-head strong { font-size: 14px; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--tint); }
.notif-item .ic-wrap { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: #FFF4D6; color: #B07A00; flex: none; }
.notif-item .t { font-weight: 600; font-size: 13px; }
.notif-item small { color: var(--text-3); font-size: 12px; }

/* Running timer pill */
.timer-pill {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 6px 0 14px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--tint-2);
  box-shadow: 0 4px 14px rgba(61, 52, 139, .08);
}
.timer-pill .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.6s infinite; }
.timer-pill .info { display: flex; flex-direction: column; line-height: 1.1; max-width: 180px; }
.timer-pill .info small { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-pill .info strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.timer-pill .stop {
  width: 30px; height: 30px; border-radius: 8px; border: 0;
  background: var(--red); color: #fff; display: grid; place-items: center;
}
.timer-pill .stop:hover { background: #D94F02; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(243, 91, 4, .45); }
  70% { box-shadow: 0 0 0 8px rgba(243, 91, 4, 0); }
  100% { box-shadow: 0 0 0 0 rgba(243, 91, 4, 0); }
}

/* ---------- Buttons & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid transparent; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(61, 52, 139, .22); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--violet); color: #fff; }
.btn-accent:hover { background: #6466E0; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #D94F02; }
.btn-text { background: none; color: var(--indigo); padding: 0 8px; height: 30px; }
.btn-text:hover { background: var(--tint); }
.btn-text.danger { color: var(--red); }
.btn-text.danger:hover { background: #FFF1E8; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239895AE' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(118, 120, 237, .14); }
.input.sm, .select.sm { height: 32px; font-size: 13px; border-radius: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--indigo); }
.hint { font-size: 12px; color: var(--text-3); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { position: relative; cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 28px; height: 28px; border-radius: 9px; border: 2px solid transparent; box-shadow: inset 0 0 0 2px #fff; }
.swatches input:checked + span { border-color: var(--text); }
.swatches input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }

.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
}
.segmented button {
  border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--tint); color: var(--indigo); }

/* ---------- View & cards ---------- */
.view { padding: 8px 32px 48px; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 12px 0 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.page-head p { margin: 6px 0 0; color: var(--text-2); max-width: 560px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--tint); color: var(--indigo);
}
.badge.up { background: #E8F6EF; color: var(--ok); }
.badge.down { background: #FFF1E8; color: var(--red); }
.badge.neutral { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.badge.yellow { background: #FFF4D6; color: #9A6B00; }
.badge.orange { background: #FFEEDC; color: #B05F00; }

.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 18px; }
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-weight: 600; font-size: 13px; }
.kpi .kpi-top .dot { width: 8px; height: 8px; border-radius: 50%; }
.kpi .value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.kpi .sub { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); min-height: 22px; }
.kpi .mini-track { height: 5px; border-radius: 99px; background: var(--tint); overflow: hidden; margin-top: 10px; }
.kpi .mini-track span { display: block; height: 100%; border-radius: 99px; background: var(--violet); }
.kpi.highlight { background: linear-gradient(150deg, var(--indigo), #574DB3); border-color: transparent; color: #fff; }
.kpi.highlight .kpi-top, .kpi.highlight .sub { color: rgba(255,255,255,.75); }
.kpi.highlight .badge { background: rgba(255,255,255,.16); color: #fff; }
.kpi .earn { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--indigo); font-variant-numeric: tabular-nums; }
.kpi.highlight .earn { color: var(--yellow); }

.dash-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-bottom: 18px; }
.dash-lower { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-lower.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Charts ---------- */
.chart { position: relative; height: var(--h, 240px); padding-left: 38px; }
.chart-grid { position: absolute; inset: 0 0 26px 38px; display: flex; flex-direction: column-reverse; justify-content: space-between; pointer-events: none; }
.chart-grid div { position: relative; border-top: 1px dashed var(--border); height: 0; }
.chart-grid div:first-child { border-top-style: solid; }
.chart-grid span { position: absolute; left: -38px; top: -8px; font-size: 11px; color: var(--text-3); width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.chart-bars { position: absolute; inset: 0 0 0 38px; display: flex; align-items: stretch; gap: var(--gap, 6px); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; position: relative; }
.bar-area { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar {
  width: 100%; max-width: 46px; border-radius: 7px 7px 3px 3px;
  display: flex; flex-direction: column-reverse; overflow: hidden;
  background: var(--violet-300);
  transition: filter .15s, transform .15s;
  min-height: 0;
}
.bar.zero { background: transparent; }
.bar.hl { background: var(--indigo); }
.bar.mid { background: var(--violet); }
.bar.stacked { background: transparent; gap: 1px; }
.bar.stacked i { display: block; width: 100%; }
.bar-col:hover .bar { filter: brightness(1.06); }
.bar-label { height: 26px; line-height: 26px; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.bar-label.today { color: var(--indigo); font-weight: 700; }
.bar-col[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% - 18px); left: 50%; transform: translateX(-50%);
  background: var(--indigo-900); color: #fff; font-size: 11.5px; font-weight: 600;
  padding: 6px 9px; border-radius: 8px; white-space: pre; z-index: 5; pointer-events: none;
  box-shadow: var(--shadow);
}

.breakdown { display: flex; flex-direction: column; gap: 16px; }
.bd-row .bd-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.bd-row .bd-top .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-row .bd-top small { color: var(--text-3); font-weight: 500; }
.bd-row .bd-top .val { margin-left: auto; font-variant-numeric: tabular-nums; }
.track { height: 7px; border-radius: 99px; background: var(--tint); overflow: hidden; }
.track span { display: block; height: 100%; border-radius: 99px; }
.color-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }

.segbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--tint); margin-bottom: 16px; }
.segbar span { display: block; height: 100%; }
.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend-row .val { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-row small { color: var(--text-3); width: 38px; text-align: right; }

.empty {
  text-align: center; color: var(--text-3); padding: 28px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty .ic { width: 28px; height: 28px; color: var(--violet-300); }

/* Compact lists (dashboard) */
.mini-list { display: flex; flex-direction: column; }
.mini-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); min-width: 0; }
.mini-item:first-child { border-top: 0; padding-top: 0; }
.mini-item .grow { flex: 1; min-width: 0; }
.mini-item .t { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-item small { color: var(--text-3); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-item .dur { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }

/* ---------- Timer view ---------- */
.timer-card { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 20px; margin-bottom: 18px; }
.timer-card.is-running { border-color: var(--tint-2); box-shadow: 0 8px 30px rgba(61, 52, 139, .10); }
.timer-input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 16px; font-weight: 500; background: transparent; height: 48px; }
.timer-input::placeholder { color: var(--text-3); }
.timer-card .select { width: 230px; }
.timer-clock { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 110px; text-align: right; color: var(--text-3); }
.is-running .timer-clock { color: var(--indigo); }
.btn-timer { width: 48px; padding: 0; }
.btn-timer.stop { background: var(--red); box-shadow: 0 4px 12px rgba(243, 91, 4, .3); }
.btn-timer.stop:hover { background: #D94F02; }

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr) 1.2fr; gap: 10px; margin-bottom: 18px; }
.ws-day { padding: 12px 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); }
.ws-day.today { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(118,120,237,.12); }
.ws-day small { color: var(--text-3); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.ws-day strong { display: block; font-size: 15px; font-variant-numeric: tabular-nums; margin: 2px 0 8px; }
.ws-day .track { height: 5px; }
.ws-total { background: var(--indigo); border-color: transparent; color: #fff; }
.ws-total small { color: rgba(255,255,255,.7); }
.ws-total .track { background: rgba(255,255,255,.18); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .select { width: auto; min-width: 190px; }

.day-group { margin-bottom: 14px; overflow: hidden; }
.day-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.day-head strong { font-size: 13px; }
.day-head span { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--indigo); }
.entry {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 18px; padding: 12px 12px 12px 20px;
  border-top: 1px solid var(--border);
}
.day-head + .entry { border-top: 0; }
.entry:hover { background: var(--surface-2); }
.entry .e-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.entry .e-desc { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .e-desc.muted { color: var(--text-3); font-weight: 500; font-style: italic; }
.entry .e-proj { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .e-time { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.entry .e-dur { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.entry .e-actions { display: flex; gap: 2px; opacity: .35; transition: opacity .15s; }
.entry:hover .e-actions, .entry:focus-within .e-actions { opacity: 1; }
.entry.running { background: #FBFAFF; }
.entry.running .e-dur { color: var(--red); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
  color: var(--text-3); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 700; }
.table .name-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.table .muted { color: var(--text-3); }
.budget { min-width: 140px; }
.budget small { display: block; font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; }
.budget .track span.over { background: var(--red) !important; }
tr.archived { opacity: .5; }

/* ---------- Reports ---------- */
.report-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.period-nav { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 3px; }
.period-nav strong { padding: 0 10px; font-size: 13px; min-width: 150px; text-align: center; }
.period-nav .icon-btn { width: 30px; height: 30px; border: 0; border-radius: 8px; }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.report-main { grid-template-columns: minmax(0, 1fr); margin-bottom: 18px; }

/* ---------- To-Dos ---------- */
.todo-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.todo-tabs a {
  height: 34px; padding: 0 14px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13px; color: var(--text-2); border: 1px solid var(--border); background: var(--surface);
}
.todo-tabs a:hover { color: var(--text); border-color: var(--border-strong); }
.todo-tabs a.active { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.todo-tabs a small { font-size: 11.5px; opacity: .7; }

.quick-add { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; margin-bottom: 18px; }
.quick-add .ic { color: var(--violet); }
.quick-add input { flex: 1; border: 0; outline: none; height: 42px; background: transparent; font-size: 14.5px; min-width: 0; }
.quick-add .input.sm { width: 150px; }

.task-group { margin-bottom: 18px; }
.task-group-head { display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.task-group-head.overdue { color: var(--red); }
.task-group-head .n { font-weight: 600; }
.task-list { overflow: hidden; }
.task {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  border-top: 1px solid var(--border); cursor: pointer; transition: background .12s;
}
.task:first-child { border-top: 0; }
.task:hover { background: var(--surface-2); }
.task .grow { flex: 1; min-width: 0; }
.task .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task.done .t { text-decoration: line-through; color: var(--text-3); font-weight: 500; }
.task .meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.task .meta > span { display: inline-flex; align-items: center; gap: 4px; }
.task .right { display: flex; align-items: center; gap: 10px; flex: none; }
.prio { width: 4px; align-self: stretch; border-radius: 4px; margin: -3px 0; flex: none; }
.prio.high { background: var(--red); }
.prio.medium { background: var(--yellow); }
.prio.low { background: var(--tint-2); }

.tick {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; color: transparent; padding: 0;
  transition: border-color .15s, background .15s, color .15s;
}
.tick:hover { border-color: var(--violet); color: var(--violet); }
.tick.on { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.tick.sm { width: 18px; height: 18px; }
.tick .ic { width: 12px; height: 12px; stroke-width: 3; }

.due { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.due.overdue { background: #FFF1E8; border-color: #FFD9C2; color: var(--red); }
.due.today { background: #FFF4D6; border-color: #FBE3A0; color: #9A6B00; }
.due.tomorrow { background: var(--tint); border-color: var(--tint-2); color: var(--indigo); }

/* ---------- Drawer ---------- */
.drawer-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.drawer-root.open { pointer-events: auto; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(30, 27, 58, .28); opacity: 0; transition: opacity .2s; }
.drawer-root.open .drawer-backdrop { opacity: 1; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(580px, 100%);
  background: var(--surface); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.drawer-root.open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-head .crumb { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }
.drawer-foot { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }
.title-input { width: 100%; border: 0; outline: none; font-size: 20px; font-weight: 700; letter-spacing: -.015em; padding: 4px 0; background: transparent; resize: none; overflow: hidden; line-height: 1.3; font-family: inherit; color: inherit; display: block; }
.title-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.title-row .tick { margin-top: 7px; }
.prop-grid { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; align-items: center; margin-bottom: 22px; }
.prop-grid > label { font-size: 12.5px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.prop-grid .row .input, .prop-grid .row .select { flex: 1; }
.section-title { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 22px 0 10px; }
.reminder-box { border: 1px solid var(--border); border-radius: 13px; padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; }
.channel-row { display: flex; gap: 8px; flex-wrap: wrap; }
.channel {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 12.5px; color: var(--text-2); cursor: pointer;
}
.channel input { display: none; }
.channel.on { border-color: var(--violet); color: var(--indigo); background: var(--tint); }
.subtasks { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.subtask { display: grid; grid-template-columns: auto minmax(0, 1fr) 122px 76px auto auto; gap: 8px; align-items: center; padding: 7px 8px 7px 12px; border-top: 1px solid var(--border); }
.subtask:first-child { border-top: 0; }
.subtask .input { border-color: transparent; background: transparent; height: 32px; padding: 0 6px; }
.subtask .input:hover { border-color: var(--border); }
.subtask .input:focus { background: var(--surface); }
.subtask.done .st-title { text-decoration: line-through; color: var(--text-3); }
.subtask-add { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.subtask-add input { flex: 1; border: 0; background: transparent; outline: none; height: 34px; }
.progress-line { height: 4px; border-radius: 4px; background: var(--tint); overflow: hidden; margin-bottom: 10px; }
.progress-line span { display: block; height: 100%; background: var(--violet); }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-root.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(30, 27, 58, .35); animation: fade .15s ease; }
.modal {
  position: relative; width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s ease;
}
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 6px; }
.modal header h2 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-body { padding: 14px 22px 8px; overflow-y: auto; }
.modal footer { display: flex; align-items: center; gap: 10px; padding: 16px 22px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Toast ---------- */
.toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 12px;
  background: var(--indigo-900); color: #fff; box-shadow: var(--shadow-lg); font-weight: 500; font-size: 13.5px;
  animation: pop .2s ease;
}
.toast.reminder { background: var(--indigo); }
.toast.reminder .ic { color: var(--yellow); }
.toast button { background: rgba(255,255,255,.14); color: #fff; border: 0; height: 28px; padding: 0 10px; border-radius: 8px; font-weight: 600; font-size: 12.5px; }
.toast button:hover { background: rgba(255,255,255,.24); }

/* ---------- Settings ---------- */
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-grid .card-pad { display: flex; flex-direction: column; gap: 14px; }
.info-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 11px; background: #FFF8E6; color: #7A5600; font-size: 12.5px; border: 1px solid #FBE3A0; }
.info-note .ic { flex: none; margin-top: 1px; }
.stat-line { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.stat-line:first-of-type { border-top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-lower { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .dash-main { grid-template-columns: 1fr; }
  .week-strip { grid-template-columns: repeat(4, 1fr); }
  .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .nav-scrim { position: fixed; inset: 0; background: rgba(30,27,58,.3); z-index: 35; display: none; }
  .app.nav-open .nav-scrim { display: block; }
  .main { margin-left: 0; }
  .only-mobile { display: grid; }
  .topbar { padding: 12px 16px; }
  .view { padding: 4px 16px 40px; }
  .timer-card { flex-wrap: wrap; padding: 12px; }
  .timer-input { flex-basis: 100%; height: 40px; }
  .timer-card .select { flex: 1; width: auto; }
  .entry { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; }
  .entry .e-time { grid-column: 1; font-size: 12px; }
  .entry .e-actions { opacity: 1; grid-column: 2; grid-row: 2; }
}
@media (max-width: 640px) {
  .kpis, .dash-lower, .kpis-4 { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 21px; }
  .page-head h1 { font-size: 23px; }
  .search { max-width: none; }
  .timer-pill .info { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .prop-grid { grid-template-columns: 1fr; gap: 6px; }
  .subtask { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .subtask .st-due, .subtask .st-who { display: none; }
  .week-strip { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .ws-day { padding: 10px; }
  .dropdown { width: calc(100vw - 32px); right: -60px; }
  .quick-add .input.sm { width: 120px; }
}

/* ---------- Print (Berichte als PDF) ---------- */
@media print {
  .sidebar, .topbar, .page-actions, .report-controls, .toast-root { display: none !important; }
  .main { margin: 0; }
  .view { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- Speicher-Warnung ---------- */
.save-banner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 12px; width: min(720px, calc(100% - 24px));
  padding: 12px 12px 12px 16px; border-radius: 14px;
  background: #FFF1E8; border: 1px solid #FFD9C2; color: #8A2E00; box-shadow: var(--shadow-lg); font-size: 13px;
}
.save-banner .ic { color: var(--red); }
.save-banner span { flex: 1; }
.save-banner .btn { background: var(--red); color: #fff; }
.save-banner .btn:hover { background: #D94F02; }
@media print { .save-banner { display: none !important; } }

/* ---------- Login / Lizenz-Aktivierung ---------- */
body.auth-mode .app { display: none; }
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(118, 120, 237, .18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(247, 184, 1, .14), transparent 60%),
    var(--bg);
}
.auth-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow); padding: 32px 28px 24px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-brand strong { font-size: 19px; font-weight: 800; letter-spacing: -.02em; color: var(--indigo); }
.auth-brand strong span { color: var(--violet); }
.auth-card h1 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.auth-sub { margin: 0 0 20px; color: var(--text-2); }
.auth-card form { margin-top: 18px; }
.auth-card .btn-lg { width: 100%; margin-top: 4px; }
.auth-links { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.auth-msg { font-size: 13px; padding: 10px 12px; border-radius: 10px; }
.auth-msg.err { background: #FFF1E8; color: #8A2E00; border: 1px solid #FFD9C2; }
.auth-msg.ok { background: #E8F6EF; color: #146B49; border: 1px solid #BFE6D3; }
.auth input[name=key] { font-variant-numeric: tabular-nums; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Admin ---------- */
.admin-top { display: flex; align-items: center; gap: 10px; padding: 16px 32px; border-bottom: 1px solid var(--border); background: var(--surface); }
.admin-top .brand { padding: 0; }
.admin-shell .view { margin: 0 auto; }
.key-box {
  font-size: 22px; font-weight: 800; letter-spacing: .08em; text-align: center;
  padding: 18px 12px; border-radius: 14px; background: var(--tint); color: var(--indigo);
  border: 1px dashed var(--violet-300); user-select: all; word-break: break-all;
}
@media (max-width: 640px) { .admin-top { padding: 12px 16px; flex-wrap: wrap; } }

/* ---------- Aufgaben: breites Panel & Status ---------- */
.drawer.wide { width: min(980px, 100%); }
.drawer.wide .drawer-body { padding: 28px 48px 40px; }
.status-chip { height: 20px; padding: 0 8px; border-radius: 6px; font-weight: 600; font-size: 11.5px; }
.status-chip.doing { background: var(--tint); color: var(--indigo); }
.status-chip.review { background: #FFF4D6; color: #9A6B00; }

/* ---------- Board (Kanban) ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.board-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.board-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.board-head strong { font-size: 13px; }
.board-head small { color: var(--text-3); font-weight: 600; }
.board-cards { display: flex; flex-direction: column; gap: 8px; min-height: 80px; border-radius: 12px; transition: background .15s, box-shadow .15s; }
.board-cards.drop-hover { background: var(--tint); box-shadow: 0 0 0 2px var(--violet-300) inset; }
.board-empty { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 18px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.board-more { border: 0; background: none; color: var(--indigo); font-weight: 600; font-size: 12.5px; padding: 6px; cursor: pointer; }
.bcard {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 12px 10px 14px; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, opacity .15s;
}
.bcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.bcard.dragging { opacity: .45; }
.bcard.done .bcard-title { text-decoration: line-through; color: var(--text-3); }
.bcard-prio { position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; }
.bcard-prio.high { background: var(--red); }
.bcard-prio.medium { background: var(--yellow); }
.bcard-prio.low { background: var(--tint-2); }
.bcard-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; margin-bottom: 6px; word-break: break-word; }
.bcard-proj { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.bcard-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bcard-meta .hint { display: inline-flex; align-items: center; gap: 3px; }

/* ---------- Kalender ---------- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 14px; align-items: start; }
.cal { padding: 14px; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cal-wd { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: 8px 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-cell { min-height: 112px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background .12s; }
.cal-cell.other { background: var(--surface-2); }
.cal-cell.other .cal-day span { color: var(--text-3); }
.cal-cell.today .cal-day span { background: var(--indigo); color: #fff; }
.cal-cell.drop-hover { background: var(--tint); }
.cal-day { display: flex; align-items: center; justify-content: space-between; }
.cal-day span { font-size: 12px; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-add { opacity: 0; border: 0; background: none; color: var(--text-3); width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { background: var(--tint); color: var(--indigo); }
.cchip {
  font-size: 12px; line-height: 1.3; padding: 3px 7px; border-radius: 6px; cursor: pointer;
  background: color-mix(in srgb, var(--c, var(--violet)) 14%, white); border-left: 3px solid var(--c, var(--violet));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500;
}
.cchip b { font-weight: 700; }
.cchip.done { opacity: .55; text-decoration: line-through; }
.cchip.sub { background: transparent; border-left: 0; color: var(--text-2); padding-left: 4px; font-size: 11.5px; }
.cchip.side { margin-bottom: 6px; white-space: normal; padding: 7px 9px; cursor: grab; }
.cchip.dragging { opacity: .4; }
.cal-side { padding: 16px; min-height: 160px; position: sticky; top: 84px; }
.cal-side.drop-hover { box-shadow: 0 0 0 2px var(--violet-300) inset; }
.cal-howto { font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px 14px; }
.cal-howto p { margin: 10px 0; }

/* ---------- Text-Editor ---------- */
.rte { border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.rte:focus-within { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(118, 120, 237, .12); }
.rte-bar { position: sticky; top: -20px; z-index: 2; display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: 13px 13px 0 0; }
.rte-btn { width: 30px; height: 30px; border: 0; background: none; border-radius: 7px; color: var(--text-2); display: grid; place-items: center; }
.rte-btn:hover { background: var(--tint); color: var(--indigo); }
.rte-btn.on { background: var(--tint-2); color: var(--indigo); }
.rte-btn .tb-txt { font-size: 12px; font-weight: 800; }
.rte-sep { width: 1px; background: var(--border-strong); margin: 5px 4px; }
.rte-body { min-height: 180px; padding: 14px 18px 18px; outline: none; font-size: 14.5px; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; }
.drawer.wide .rte-body { min-height: 360px; }
.rte-body { position: relative; }
.rte-body.is-empty::before { content: attr(data-placeholder); position: absolute; left: 18px; top: 14px; color: var(--text-3); pointer-events: none; }
.rte-body > :first-child { margin-top: 0; }
.rte-body p { margin: 0 0 8px; }
.rte-body h2 { font-size: 20px; font-weight: 800; letter-spacing: -.015em; margin: 18px 0 6px; }
.rte-body h3 { font-size: 16px; font-weight: 700; margin: 14px 0 4px; }
.rte-body ul, .rte-body ol { margin: 4px 0 10px; padding-left: 24px; }
.rte-body li { margin: 2px 0; }
.rte-body ul[data-type="check"] { list-style: none; padding-left: 4px; }
.rte-body ul[data-type="check"] li { position: relative; padding-left: 28px; }
.rte-body ul[data-type="check"] li::before {
  content: ''; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 5px;
  border: 2px solid var(--border-strong); background: var(--surface); cursor: pointer; box-sizing: border-box;
}
.rte-body ul[data-type="check"] li[data-checked="true"] { color: var(--text-3); text-decoration: line-through; }
.rte-body ul[data-type="check"] li[data-checked="true"]::before {
  background: var(--indigo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat;
  border-color: var(--indigo);
}
.rte-body blockquote { margin: 8px 0; padding: 6px 14px; border-left: 3px solid var(--violet); background: var(--tint); border-radius: 0 8px 8px 0; color: var(--text-2); }
.rte-body pre { margin: 8px 0; padding: 12px 14px; background: var(--indigo-900); color: #E8E6FF; border-radius: 10px; font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.rte-body a { color: var(--indigo); text-decoration: underline; text-underline-offset: 2px; }
.rte-body hr { border: 0; border-top: 1px solid var(--border-strong); margin: 16px 0; }

@media (max-width: 1080px) {
  .cal-wrap { grid-template-columns: 1fr; }
  .cal-side { position: static; }
}
@media (max-width: 640px) {
  .board { grid-template-columns: repeat(4, 82vw); }
  .cal-cell { min-height: 74px; padding: 3px; }
  .cchip { font-size: 10.5px; padding: 2px 4px; }
  .cal-head .hint { display: none; }
  .drawer.wide .drawer-body { padding: 20px 18px; }
}

/* ---------- Kalkulation vs. Ist ---------- */
.est-card { margin-bottom: 18px; }
.est-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 32px; }
.est-row { cursor: pointer; border-radius: 10px; padding: 4px 6px; margin: -4px -6px; transition: background .12s; }
.est-row:hover { background: var(--surface-2); }
.est-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.est-name { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est-bar { position: relative; height: 10px; border-radius: 99px; background: var(--tint); }
.est-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--violet); }
.est-fill { border-radius: 99px 0 0 99px; }
.est-fill.full { border-radius: 99px; }
.est-over {
  position: absolute; top: 0; bottom: 0; border-radius: 0 99px 99px 0;
  background: repeating-linear-gradient(135deg, var(--red) 0 6px, #F7834A 6px 12px);
}
.est-mark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--indigo-900); box-shadow: 0 0 0 2px var(--surface); }
.est-nums { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.est-nums strong { color: var(--text); font-variant-numeric: tabular-nums; }
.est-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.est-legend span { display: inline-flex; align-items: center; gap: 6px; }
.est-legend i { display: inline-block; width: 16px; height: 8px; border-radius: 99px; }
.lg-fill { background: var(--violet); }
.lg-mark { width: 3px !important; height: 14px !important; border-radius: 2px !important; background: var(--indigo-900); }
.lg-over { background: repeating-linear-gradient(135deg, var(--red) 0 4px, #F7834A 4px 8px); }
.budget { min-width: 220px; }
.budget small { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.budget .est-bar { height: 8px; }
@media (max-width: 900px) { .est-grid { grid-template-columns: 1fr; } }

/* ---------- Aufgabenliste im Asana-Stil (Tabelle mit eingerückten Unteraufgaben) ---------- */
.tl { padding: 0; overflow: hidden; }
.tl-head, .tl-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) 118px 132px 84px 64px; align-items: center; column-gap: 8px;
}
.tl-head { padding: 9px 10px 9px 6px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.tl-row { position: relative; min-height: 44px; padding: 3px 10px 3px 6px; border-top: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.tl-head + .tl-row { border-top: 0; }
.tl-row:hover { background: var(--surface-2); }
.tl-row.done .tl-title { text-decoration: line-through; color: var(--text-3); }
.tl-name { display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: calc(var(--depth, 0) * 26px); }
.tl-row[data-depth]:not([data-depth="0"]) .tl-name::before { /* Einrückungslinie */
  content: ''; position: absolute; left: calc(28px + (var(--depth) - 1) * 26px + 10px); top: 0; bottom: 0; width: 1.5px; background: var(--border);
}
.tl-grip { color: var(--text-3); opacity: 0; cursor: grab; display: grid; place-items: center; width: 22px; height: 28px; border-radius: 6px; }
.tl-row:hover .tl-grip { opacity: .7; }
.tl-grip:hover { opacity: 1 !important; background: var(--tint); color: var(--indigo); }
.tl-row .caret, .tl-row .caret-space { margin: 0; }
.tl-title {
  flex: 1 1 auto; min-width: 140px; height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 7px;
  background: transparent; font-size: 14px; font-weight: 500; outline: none; text-overflow: ellipsis;
}
.tl-row[data-depth="0"] .tl-title { font-weight: 600; }
.tl-title:hover { border-color: var(--border); background: var(--surface); }
.tl-title:focus { border-color: var(--violet); background: var(--surface); box-shadow: 0 0 0 3px rgba(118, 120, 237, .12); }
.tl-badges { display: inline-flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; overflow: hidden; font-size: 12px; color: var(--text-3); }
.tl-badges > * { flex: none; }
.tl-badges .hint { display: inline-flex; }
.tl-proj { display: inline-flex; align-items: center; gap: 5px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-count { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.tl-count.all { color: var(--ok); }
.tl-open {
  flex: none; display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 6px 0 8px; border: 1px solid var(--border);
  border-radius: 7px; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; display: none;
}
.tl-row:hover .tl-open { display: inline-flex; }
.tl-open:hover { color: var(--indigo); border-color: var(--violet-300); }
.tl-date { width: 100%; height: 30px; border: 1px solid transparent; border-radius: 7px; background: transparent; padding: 0 6px; font-size: 12.5px; color: var(--text-2); outline: none; }
.tl-date:hover { border-color: var(--border); background: var(--surface); }
.tl-date:focus { border-color: var(--violet); background: var(--surface); }
.tl-date.set { font-weight: 600; }
.tl-date.overdue { color: var(--red); }
.tl-date:not(.set):not(:focus)::-webkit-datetime-edit { color: transparent; }
.tl-who { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; color: var(--text-2); }
.tl-who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio-pill { display: inline-flex; height: 22px; align-items: center; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }
.prio-pill.high { background: #FFF1E8; color: var(--red); }
.prio-pill.medium { background: #FFF4D6; color: #9A6B00; }
.prio-pill.low { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.tl-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: 0; }
.tl-row:hover .tl-actions, .tl-row:focus-within .tl-actions { opacity: 1; }
.tl-actions .tl-del:hover { color: var(--red); background: #FFF1E8; }
.tl-row.add { cursor: text; color: var(--text-3); }
.tl-row.add .tl-name > .ic { color: var(--violet); flex: none; }
.tl-row.add .tl-title { font-weight: 500; }
/* Hinzufügen-Knopf erscheint, sobald man in die Zeile tippt (lässt dem Platzhalter sonst den Platz) */
.tl-add-btn { flex: none; height: 30px; padding: 0 12px; display: none; }
.tl-row.add:focus-within .tl-add-btn { display: inline-flex; }
.quick-add > .btn { flex: none; }
/* Ziehen & Ablegen: Markierung davor / danach / als Unteraufgabe */
.tl-row.pos-before { box-shadow: inset 0 2px 0 var(--violet); }
.tl-row.pos-after { box-shadow: inset 0 -2px 0 var(--violet); }
.tl-row.pos-inside { background: var(--tint); box-shadow: inset 0 0 0 2px var(--violet-300); }
.tl-row.drop-hover { transition: none; }
.tl-help { display: flex; align-items: center; gap: 6px; margin: -6px 4px 14px; font-size: 12px; color: var(--text-3); }
.tl-help b { color: var(--text-2); font-weight: 600; }
.task-group .tl { margin-top: 0; }

/* Aufklapp-Pfeil */
.caret {
  width: 24px; height: 24px; border: 0; background: none; border-radius: 6px; flex: none; padding: 0;
  display: grid; place-items: center; color: var(--text-3); cursor: pointer; transition: transform .15s, background .15s;
}
.caret:hover { background: var(--tint); color: var(--indigo); }
.caret.open { transform: rotate(90deg); }
.caret-space { width: 24px; flex: none; }

/* Kompakte Variante im Aufgaben-Panel */
.tl.compact { border: 1px solid var(--border); border-radius: 13px; }
.tl.compact .tl-row { padding-left: 4px; }
.tl.compact .tl-row .tl-who, .tl.compact .tl-row .tl-prio { display: none; }
.tl.compact .tl-row:first-child { border-top: 0; }

/* Pfad im Panel */
.crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.crumb-proj { display: inline-flex; align-items: center; gap: 5px; }
.crumb-sep { color: var(--border-strong); }
.crumb-link { border: 0; background: none; padding: 3px 6px; border-radius: 6px; color: var(--text-2); font-weight: 600; cursor: pointer; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb-link:hover { background: var(--tint); color: var(--indigo); }
.crumb-cur { color: var(--text); }

@media (max-width: 900px) {
  .tl-head { display: none; }
  .tl-grip, .tl-who, .tl-prio, .tl-actions, .tl-open { display: none !important; }
}

.next-day { font-size: 11px; font-weight: 700; color: var(--orange); margin-left: 2px; }

/* ---------- Aufgaben: Tablet & Handy ---------- */
.tl.compact .tl-row { grid-template-columns: minmax(0, 1fr) 120px 64px; }

@media (max-width: 900px) {
  /* Tabelle → zweispaltig: Titel | Datum (ausgeblendete Spalten verschieben nichts mehr) */
  .tl-row, .tl.compact .tl-row { grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; padding: 4px 8px 4px 6px; }
  .tl-name { padding-left: calc(var(--depth, 0) * 18px); gap: 6px; }
  .tl-row[data-depth]:not([data-depth="0"]) .tl-name::before { display: none; }
  .tl-row[data-depth]:not([data-depth="0"]) { background-image: linear-gradient(var(--border), var(--border)); background-repeat: no-repeat;
    background-size: 1.5px 100%; background-position: calc(var(--depth) * 18px - 4px) 0; }
  .tl-title { min-width: 0; font-size: 14px; }
  .tl-due { justify-self: end; }
  .tl-date { width: 118px; }
  .tl-date:not(.set):not(:focus) { width: 38px; }
  .tl-badges .hint, .tl-badges .tl-proj { display: none; }
  .tl-badges { flex: none; overflow: visible; }
  .tl-help { display: none; }
  .tl.compact .tl-actions { display: none; }
}

@media (max-width: 640px) {
  /* Kopfzeile: Ansichts-Umschalter volle Breite, Kalender-Abo nur als Symbol */
  .page-head { margin-bottom: 16px; gap: 12px; }
  .page-actions { width: 100%; }
  .page-actions .segmented { flex: 1 1 100%; }
  .page-actions .segmented button { flex: 1; padding: 0 6px; }
  .page-actions .btn { flex: 1; }
  .page-actions .btn .btn-label { display: none; }
  .page-actions .btn:has(.btn-label) { flex: 0 0 auto; width: 40px; padding: 0; }
  .topbar .btn .btn-label { display: none; }
  .topbar .btn { width: 40px; padding: 0; }

  /* Filter als waagrecht scrollbare Leiste statt mehrzeilig */
  .todo-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 4px; scrollbar-width: none; }
  .todo-tabs::-webkit-scrollbar { display: none; }
  .todo-tabs a { flex: none; }

  /* Schnell-Eingabe: Text oben, Datum + Projekt darunter */
  .quick-add { flex-wrap: wrap; padding: 8px 10px; gap: 8px; }
  .quick-add > .ic { display: none; }
  .quick-add input#quickTask { flex: 1 1 100%; height: 38px; padding: 0 4px; }
  .quick-add .input.sm, .quick-add .select.sm { flex: 1 1 0; width: auto !important; min-width: 0; }
  .quick-add > .btn { flex: 1 1 100%; justify-content: center; }

  .tl-row { min-height: 46px; }
  .tl-date { width: 104px; font-size: 12px; }
  .status-chip { display: none; }

  /* Kalender: ganzer Monat ohne Wischen, Aufgaben als Farbbalken – lesbar in der Liste darunter */
  .cal { padding: 10px; }
  .cal-wd { padding: 6px 0; text-align: center; letter-spacing: .03em; }
  .cal-cell { min-height: 54px; padding: 3px; gap: 2px; }
  .cal-day { justify-content: center; }
  .cal-add { display: none; }
  .cal-grid .cchip { height: 5px; padding: 0; font-size: 0; border-left: 0; border-radius: 3px; background: var(--c, var(--violet)); }
  .cal-grid .cchip.sub { background: color-mix(in srgb, var(--c, var(--violet)) 45%, white); }
  .cal .cal-agenda { display: block; margin-top: 14px; }

  /* Aufgaben-Panel */
  .drawer-head { padding: 12px 14px; }
  .drawer-body { padding: 16px 16px 24px; }
  .crumbs { font-size: 12px; }
  .crumb-link { max-width: 120px; }
  .title-input { font-size: 18px; }
  .drawer-foot { flex-wrap: wrap; }
  .drawer .section-title .hint { display: none; }
}

/* ---------- Hub (Übersicht aller Tools) ---------- */
.hub {
  min-height: 100vh; display: flex; flex-direction: column;
  background:
    radial-gradient(1100px 520px at 0% -10%, rgba(118, 120, 237, .16), transparent 60%),
    radial-gradient(900px 480px at 110% 0%, rgba(247, 184, 1, .12), transparent 60%),
    var(--bg);
}
.hub-top { display: flex; align-items: center; gap: 12px; padding: 18px 40px; }
.hub-top .brand { padding: 0; }
.hub-user { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.hub-main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 40px 56px; flex: 1; }
.hub-hero h1 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.hub-hero p { margin: 8px 0 30px; color: var(--text-2); font-size: 15px; }
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.hub-tile {
  position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s; overflow: hidden;
}
.hub-tile::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tool); }
.hub-tile:not(.locked):hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(30, 27, 58, .12); }
.hub-tile.locked { background: var(--surface-2); box-shadow: none; }
.hub-tile.locked .hub-icon, .hub-tile.locked h2, .hub-tile.locked p { opacity: .55; }
.hub-tile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.hub-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  color: var(--tool); background: color-mix(in srgb, var(--tool) 14%, white);
}
.hub-icon svg { width: 24px; height: 24px; }
.hub-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); }
.hub-tile h2 { margin: 4px 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.hub-tile p { margin: 0 0 16px; color: var(--text-2); line-height: 1.55; }
.hub-addon {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px dashed var(--border-strong); margin-bottom: 16px; font-size: 13px;
}
.hub-addon.on { border-style: solid; border-color: var(--tint-2); background: var(--tint); }
.hub-addon svg { width: 18px; height: 18px; flex: none; color: var(--indigo); margin-top: 1px; }
.hub-addon small { display: block; color: var(--text-3); margin-top: 3px; }
.hub-action { margin-top: auto; }
.hub-action .btn { width: 100%; }
.hub-action .btn svg { width: 16px; height: 16px; }
.hub-lock { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-weight: 600; font-size: 13px; }
.hub-lock svg { width: 15px; height: 15px; }
.hub-foot { margin-top: 28px; color: var(--text-3); font-size: 12px; text-align: center; }
.nav-hub { margin-bottom: 4px; color: var(--indigo) !important; font-weight: 600; }
.nav-hub .ic { color: var(--violet) !important; }
@media (max-width: 960px) { .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .hub-top { padding: 14px 16px; }
  .hub-user-name { display: none; }
  .hub-main { padding: 16px 16px 40px; }
  .hub-hero h1 { font-size: 26px; }
  .hub-grid { grid-template-columns: 1fr; }
}

/* ---------- Arbeitszeit ---------- */
.wz-mark { background: linear-gradient(135deg, var(--yellow), var(--orange)); box-shadow: 0 6px 16px rgba(241, 135, 1, .28); }
.brand-text strong.wz-brand { color: var(--indigo-900); }
.table .nowrap, .nowrap { white-space: nowrap; }
.table td.neg { color: var(--red); }

/* Projektbudget: Auswertung im Projektformular */
.budget-summary { display: grid; gap: 0; padding: 10px 14px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--tint); }
.budget-summary .badge { justify-self: start; margin-top: 8px; }
.budget-summary .hint { margin-top: 6px; }
.budget .badge { margin-top: 4px; }
.ok-text { color: var(--ok); }
.danger-text { color: var(--red); }

/* ---------- Arbeitszeit: Übersicht (eigene Zeiten mit einem Klick) ---------- */
.wz-start { display: grid; gap: 16px; }
.wz-cta { border: 1px solid rgba(241, 135, 1, .35); background: linear-gradient(135deg, #FFF8EC, var(--surface) 60%); animation: wz-in .45s ease both, wz-glow 1.6s ease .5s 2; }
.wz-miss { animation: wz-in .45s ease .08s both; }
.wz-done { border: 1px solid #CDEBDD; background: #F3FBF7; }
.wz-ok { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: #E8F6EF; color: var(--ok); }
.wz-warn { display: inline-grid; place-items: center; margin-right: 8px; color: var(--orange); vertical-align: -2px; }
.wz-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 140px)) auto; align-items: end; gap: 12px; }
.wz-quick .field { margin: 0; }
.wz-chips { flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wz-miss-list { display: grid; }
.wz-miss-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.wz-miss-row:first-child { border-top: 0; }
.wz-miss-row > .grow { flex: 0 0 210px; }
.wz-miss-row .wz-chips { margin-top: 0; }
.wz-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wz-kpis .value { font-size: 20px; }
.wz-kpis .value.neg { color: var(--red); }
@keyframes wz-in { from { transform: translateY(8px); } to { transform: none; } } /* ohne Transparenz: Inhalt ist immer sofort lesbar */
@keyframes wz-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(241, 135, 1, 0); } 50% { box-shadow: 0 0 0 6px rgba(241, 135, 1, .14); } }
@media (prefers-reduced-motion: reduce) { .wz-cta, .wz-miss { animation: none; } }
@media (max-width: 720px) {
  .wz-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wz-quick .field:nth-child(2) { order: 3; grid-column: 1 / -1; } /* Kommt | Geht, darunter Pause */
  .wz-quick .btn { order: 4; }
  .wz-quick .btn { grid-column: 1 / -1; justify-content: center; }
  .wz-miss-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .wz-miss-row > .grow { flex: none; }
  .wz-kpis { grid-template-columns: 1fr; }
}

/* Hub: Hinweis auf der Arbeitszeit-Kachel */
.hub-status { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; text-decoration: none; }
.hub-status svg { width: 16px; height: 16px; flex: none; }
.hub-status.warn { background: #FFEEDC; color: #B05F00; animation: wz-glow 1.6s ease .4s 2; }
.hub-status.todo { background: #FFF4D6; color: #9A6B00; }
.hub-status.ok { background: #E8F6EF; color: var(--ok); }
.hub-status:hover { filter: brightness(.97); }
@media (prefers-reduced-motion: reduce) { .hub-status.warn { animation: none; } }

/* ---------- Arbeitszeit: Kalender unter „Zeiten“ ---------- */
.toolbar .segmented button { display: inline-flex; align-items: center; gap: 6px; }
.toolbar .segmented .ic-sm { width: 15px; height: 15px; }
.wz-cal { padding: 0; overflow: hidden; }
.wz-cal-head, .wz-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wz-cal-head div { padding: 10px 12px; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.wz-day { min-height: 104px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background .12s; min-width: 0; }
.wz-day:nth-child(7n) { border-right: 0; }
.wz-day:hover { background: var(--tint); }
.wz-day:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.wz-day.out { background: var(--surface-2); opacity: .55; }
.wz-day.off { background: var(--surface-2); }
.wz-day.missing { background: #FFF6EC; box-shadow: inset 3px 0 0 var(--orange); }
.wz-day.anchor { box-shadow: inset 0 0 0 2px var(--violet); }
.wz-day-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wz-day-num { font-weight: 700; font-size: 13px; }
.wz-day.today .wz-day-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--indigo); color: #fff; }
.wz-day-hol { font-size: 10.5px; color: #9A6B00; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wz-day-miss { margin-top: auto; align-self: flex-start; font-size: 11px; font-weight: 700; color: #B05F00; }
.wz-chip { display: flex; justify-content: space-between; gap: 6px; width: 100%; padding: 3px 6px; border: 0; border-radius: 6px; font: inherit; font-size: 11.5px; text-align: left; cursor: pointer; background: var(--tint); color: var(--indigo); }
.wz-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wz-chip b { font-weight: 700; white-space: nowrap; }
.wz-chip.t-vacation, .wz-legend .t-vacation { background: #E8F6EF; color: var(--ok); }
.wz-chip.t-sick, .wz-legend .t-sick { background: #FFF1E8; color: var(--red); }
.wz-chip.t-holiday, .wz-legend .t-holiday { background: #FFF4D6; color: #9A6B00; }
.wz-chip.t-overtime { background: #FFEEDC; color: #B05F00; }
.wz-chip.t-correction { background: var(--surface-2); color: var(--text-2); border: 1px dashed var(--border); }
.wz-chip.locked { cursor: default; opacity: .85; }
.wz-legend .t-work { background: var(--tint); }
.wz-legend .t-missing { background: #FFF6EC; box-shadow: inset 3px 0 0 var(--orange); }
.wz-cal-help { margin: 10px 2px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.wz-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.wz-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; }

/* Sperren & Verlauf */
.wz-lock-ic { display: inline-grid; place-items: center; width: 32px; height: 32px; color: var(--text-3); cursor: help; }
.wz-locked { display: inline-flex; align-items: center; gap: 6px; }
.wz-locked .ic { width: 14px; height: 14px; }
.wz-hist { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface-2); }
.wz-hist summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.wz-hist-row { padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.wz-hist-row:first-of-type { margin-top: 8px; }

@media (max-width: 720px) {
  .wz-day { min-height: 64px; padding: 4px; }
  .wz-cal-head div { padding: 8px 4px; text-align: center; }
  .wz-day-hol { display: none; }
  .wz-chip { padding: 2px 4px; font-size: 10px; }
  .wz-chip span { display: none; }
  .wz-chip b { width: 100%; text-align: center; }
}

/* Arbeitszeit: Zugänge (Team) */
.wz-team-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.wz-team-row:first-of-type { border-top: 0; }
.wz-team-row .select.sm { width: auto; min-width: 140px; }
.btn-text.danger { color: var(--red); }

/* WIEsuite-Logo (assets/brand) */
.suite-logo { display: block; height: 34px; width: auto; }
.brand:has(.suite-logo) { gap: 12px; }
.suite-company { color: var(--text-3); font-size: 12px; font-weight: 600; padding-left: 12px; border-left: 1px solid var(--border); line-height: 1.2; }
.suite-company:empty { display: none; }
.auth-brand img { display: block; height: 52px; width: auto; }
@media (max-width: 720px) { .suite-logo { height: 28px; } .suite-company { display: none; } }

/* Hub: Logo mit Konto darunter, Fußzeile, Support */
.hub-brand { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
.hub-brand a { display: block; }
.hub-top { position: relative; }
/* In der Kopfzeile, vertikal mittig – horizontal bündig mit dem Inhalt darunter (max. 1120 px, 40 px Innenabstand) */
.hub-account { margin: 0; color: var(--text-3); font-size: 13px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
@media (min-width: 1500px) {
  .hub-top .hub-account { position: absolute; top: 50%; transform: translateY(-50%); left: calc((100% - 1120px) / 2 + 40px); }
}
@media (max-width: 1499px) { .hub-top .hub-account { padding-left: 12px; border-left: 1px solid var(--border); } } /* zu schmal: neben dem Logo */
@media (max-width: 720px) { .hub-top .hub-account { display: none; } }
.hub-account strong { color: var(--text-2); font-weight: 700; }
.hub-footer { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 18px 180px 22px 40px; /* rechts Platz für den Support-Knopf */ color: var(--text-3); font-size: 12px; border-top: 1px solid var(--border); }
.support { position: fixed; right: 22px; bottom: 22px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.support-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; background: var(--indigo); color: #fff; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 10px 28px rgba(61, 52, 139, .32); transition: transform .15s, box-shadow .15s; }
.support-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(61, 52, 139, .38); }
.support-btn svg { width: 19px; height: 19px; }
.support-panel { width: 280px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 18px 48px rgba(30, 27, 58, .18); display: grid; gap: 8px; }
.support-panel[hidden] { display: none; }
.support-panel p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.support-panel small { color: var(--text-3); font-size: 11.5px; text-align: center; }
.support-panel .btn { justify-content: center; }
.support-compact .support-btn { width: 44px; padding: 0; justify-content: center; background: var(--surface); color: var(--indigo); border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(30, 27, 58, .12); }
.support-compact .support-btn span { display: none; }
.support-compact .support-btn:hover { box-shadow: 0 10px 24px rgba(30, 27, 58, .18); }
@media print { .support { display: none; } }
@media (max-width: 720px) {
  .hub-footer { flex-direction: column; gap: 4px; padding: 16px 16px 80px; }
  .support { right: 14px; bottom: 14px; }
  .support-btn span { display: none; }
  .support-btn { width: 48px; padding: 0; justify-content: center; }
}

/* Info-Box einer Kachel in der Farbe des Tools (z. B. WIEpilot-Blau) */
.hub-addon.hub-info { border-color: color-mix(in srgb, var(--tool) 22%, white); background: color-mix(in srgb, var(--tool) 6%, white); }
.hub-addon.hub-info svg { color: var(--tool); }
/* Knopf in der Farbe des Tools (WIEpilot) */
.btn.btn-tool { background: var(--tool); box-shadow: 0 8px 20px color-mix(in srgb, var(--tool) 32%, transparent); }
.btn.btn-tool:hover { background: color-mix(in srgb, var(--tool) 86%, black); }

/* ---------- Handy: Tabellen als Karten (data-label aus assets/table-cards.js) ---------- */
@media (max-width: 640px) {
  .table-wrap { overflow-x: visible; }
  .table-wrap > .table, .table-wrap > .table tbody, .table-wrap > .table tr, .table-wrap > .table td { display: block; }
  .table-wrap > .table thead { display: none; }
  .table-wrap > .table tr {
    position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
  }
  .table-wrap > .table tr:last-child { border-bottom: 0; }
  .table-wrap > .table td { min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .table-wrap > .table td::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3);
  }
  .table-wrap > .table td[data-label=""]::before, .table-wrap > .table td:first-child::before { display: none; }
  .table-wrap > .table td:empty { display: none; }
  /* erste Spalte = Kartentitel über die ganze Breite */
  .table-wrap > .table td:first-child { grid-column: 1 / -1; font-weight: 600; padding-right: 76px; }
  .table-wrap > .table td[colspan] { grid-column: 1 / -1; }
  .table-wrap > .table td .budget { min-width: 0; }
  .table-wrap > .table td.nowrap { white-space: normal; }
  /* Symbol-Knöpfe (Bearbeiten, Löschen, Timer) oben rechts, Text-Knöpfe als eigene Zeile */
  .table-wrap > .table td[data-label=""]:last-child:not(:first-child):not(:has(.btn)) { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; }
  .table-wrap > .table td[data-label=""]:last-child:has(.btn) { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }

  /* WIEtrac-Dashboard: untere Karten untereinander statt nebeneinander */
  .dash-lower, .dash-lower.two { grid-template-columns: minmax(0, 1fr); }
  .kpis, .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Aufgaben: mit Datum zweizeilig, damit der Titel die volle Breite bekommt */
  .tl-row:has(.tl-date.set) { grid-template-columns: minmax(0, 1fr); row-gap: 0; padding-bottom: 8px; }
  .tl-row:has(.tl-date.set) .tl-due { justify-self: start; margin: -4px 0 0 calc(var(--depth, 0) * 18px + 56px); }
  .tl-row:has(.tl-date.set) .tl-date { width: auto; height: 26px; padding: 0 4px; font-size: 12px; }

  /* Zeiteinträge: Projekt und Beschreibung dürfen umbrechen */
  .entry .e-desc, .entry .e-proj { white-space: normal; }
  .mini-item .t, .mini-item small, .task .t { white-space: normal; overflow-wrap: anywhere; }
  .table-wrap > .table td:has(.budget) { grid-column: 1 / -1; }

  .hub-addon small { font-size: 12px; }
}
/* Kleine Abhak-Kreise auf Touch-Geräten mit größerer Trefferfläche */
@media (pointer: coarse) {
  .tick.sm { position: relative; }
  .tick.sm::after { content: ''; position: absolute; inset: -9px; }
}

/* Kopfzeilen mit Knöpfen umbrechen lassen, statt den Titel zusammenzudrücken */
.card-head > div:first-child { flex: 1 1 220px; min-width: 0; }
@media (max-width: 640px) { .card-head { flex-wrap: wrap; } }
/* Hinweise nur für Maus- bzw. Touch-Bedienung */
.only-touch { display: none; }
@media (pointer: coarse) { .no-touch { display: none; } .only-touch { display: inline; } }

/* Monatsliste unter dem Aufgaben-Kalender (nur am Handy sichtbar) */
.cal-agenda { display: none; }
.cal-agenda-day { padding: 10px 2px; border-top: 1px solid var(--border); }
.cal-agenda-day:first-child { border-top: 0; }
.cal-agenda-day.past .cal-agenda-date { color: var(--text-3); }
.cal-agenda-date { margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.cal-agenda-day.today .cal-agenda-date { color: var(--indigo); }
.cal-agenda .cchip.side { cursor: pointer; }
