/* Hxbrrrt Workspace — system wizualny
   Ciemny, ale nie czarny. Jeden akcent (limonka marki Hxbrrrt), reszta to skala szarości z lekkim chłodnym odcieniem. */
:root {
  color-scheme: dark;
  --bg: #0f1013;
  --bg-2: #121317;
  --panel: #16171b;
  --panel-2: #1b1c21;
  --hover: #1f2026;
  --active: #24262d;
  --line: #24252b;
  --line-2: #2d2f36;
  --line-3: #3a3c44;
  --text: #e8e9ec;
  --text-2: #b9bbc2;
  --muted: #80838c;
  --faint: #5d6068;
  --accent: #beef78;
  --accent-2: #d3ff99;
  --accent-ink: #15200b;
  --accent-soft: rgba(190, 239, 120, .1);
  --danger: #f0616a;
  --danger-soft: rgba(240, 97, 106, .12);
  --warn: #f0b35c;
  --info: #7c8cff;
  --s-todo: #8a8d96;
  --s-progress: #f0b35c;
  --s-review: #a48bfa;
  --s-done: #79d38b;
  --p-urgent: #f0616a;
  --p-high: #f2905c;
  --p-medium: #e6c35c;
  --p-low: #80838c;
  --r-sm: 5px;
  --r: 7px;
  --r-lg: 10px;
  --shadow-pop: 0 0 0 1px rgba(255,255,255,.06), 0 12px 32px -8px rgba(0,0,0,.6), 0 4px 10px -4px rgba(0,0,0,.4);
  --shadow-card: 0 1px 0 rgba(255,255,255,.025) inset, 0 1px 2px rgba(0,0,0,.25);
  --font: "Inter", "Inter var", ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sidebar-w: 236px;
  --topbar-h: 52px;
  --tabbar-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
::selection { background: rgba(190, 239, 120, .28); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Paski przewijania */
* { scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--line-3); }

/* ---------- Układ aplikacji ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 10px 10px 12px;
  min-height: 0;
  overflow-y: auto;
}
.ws-switch {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; margin-bottom: 8px; border-radius: var(--r);
  font-weight: 600; letter-spacing: -.01em;
}
.ws-logo {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font: 700 11px/1 var(--mono); letter-spacing: -.06em;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.15);
}
.ws-logo img { width: 20px; height: 20px; object-fit: contain; }
.ws-name { flex: 1; min-width: 0; }
.ws-name small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }

.search-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%;
  height: 32px; padding: 0 8px; margin-bottom: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--muted); transition: border-color .15s, color .15s;
}
.search-trigger:hover { border-color: var(--line-2); color: var(--text-2); }
.search-trigger span { flex: 1; text-align: left; }
kbd {
  font: 500 10.5px/1 var(--mono); color: var(--muted);
  padding: 3px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--bg);
}

.nav-section { margin-top: 14px; }
.nav-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 4px; font-size: 11.5px; font-weight: 500; color: var(--faint);
}
.nav-label button { color: var(--faint); border-radius: 4px; padding: 2px; display: grid; }
.nav-label button:hover { color: var(--text); background: var(--hover); }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 30px; padding: 0 8px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--active); color: var(--text); }
.nav-item[aria-current="page"] svg { color: var(--accent); }
.nav-item svg { color: var(--muted); }
.nav-item .count { margin-left: auto; font: 500 11px var(--mono); color: var(--muted); }
.nav-item .badge-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nav-project .swatch { width: 10px; height: 10px; border-radius: 3px; margin: 0 3px; }
.sidebar-foot { margin-top: auto; padding-top: 12px; }
.me-button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 8px; border-radius: var(--r); text-align: left;
}
.me-button:hover { background: var(--hover); }
.me-button .who { flex: 1; min-width: 0; line-height: 1.25; }
.me-button .who small { display: block; color: var(--muted); font-size: 11.5px; }

.main { min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative; scroll-padding-top: var(--topbar-h); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--text); }
.crumbs svg { color: var(--faint); }
.topbar .spacer { flex: 1; }
.topbar .actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }
.page { padding: 28px 32px 80px; max-width: 1320px; margin: 0 auto; }
.page.wide { max-width: none; }
.page.flush { padding: 0; max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 30px; padding: 0 12px; border-radius: var(--r-sm);
  font-weight: 500; font-size: 13px; white-space: nowrap;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
  transition: background .12s, border-color .12s, transform .08s, opacity .12s;
}
.btn:hover { background: var(--hover); border-color: var(--line-3); }
.btn:active { transform: translateY(.5px); }
.btn svg { color: var(--muted); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: inset 0 -1px 0 rgba(0,0,0,.18); }
.btn.primary svg { color: currentColor; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: rgba(240,97,106,.35); }
.btn.solid-danger { background: var(--danger); border-color: transparent; color: #200608; }
.btn.solid-danger:hover { background: #ff7880; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn.lg { height: 36px; padding: 0 16px; font-size: 14px; }
.btn.icon { width: 30px; padding: 0; }
.btn.icon.sm { width: 26px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn .kbd-hint { font: 500 10.5px var(--mono); opacity: .6; margin-left: 2px; }
.segmented { display: inline-flex; padding: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.segmented button { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 5px; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--active); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3); }

/* ---------- Pola formularzy ---------- */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.field small { color: var(--muted); font-size: 11.5px; }
.input, .textarea, .select {
  width: 100%; min-height: 34px; padding: 7px 10px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  color: var(--text); outline: none;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--line-3); }
.input:focus, .textarea:focus, .select:focus { border-color: rgba(190,239,120,.55); box-shadow: 0 0 0 3px rgba(190,239,120,.1); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.select { appearance: none; padding-right: 28px; background-image: url("../img/chevron.svg"); background-repeat: no-repeat; background-position: right 9px center; }
.select option { background: var(--panel-2); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: rgba(240,97,106,.6); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-error { color: var(--danger); font-size: 12px; }
.input-title { font-size: 18px; font-weight: 600; letter-spacing: -.015em; border: 0; background: transparent; padding: 0; min-height: 0; box-shadow: none !important; }
.input-title:focus { box-shadow: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.checkbox {
  appearance: none; width: 16px; height: 16px; margin: 0; border-radius: 4px; flex-shrink: 0;
  border: 1.5px solid var(--line-3); background: transparent; display: grid; place-items: center; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.checkbox:hover { border-color: var(--muted); }
.checkbox:checked { background: var(--accent); border-color: var(--accent); }
.checkbox:checked::after { content: ""; width: 8px; height: 4.5px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: translateY(-1px) rotate(-45deg); }

.color-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.color-picker label { position: relative; cursor: pointer; }
.color-picker input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.color-picker span { display: block; width: 24px; height: 24px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); transition: transform .12s; }
.color-picker input:checked + span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px currentColor; }
.color-picker input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 4px; }
.color-picker label:hover span { transform: scale(1.08); }
.icon-picker { display: flex; flex-wrap: wrap; gap: 4px; }
.icon-picker label { position: relative; }
.icon-picker input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.icon-picker span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--muted); border: 1px solid transparent; transition: background .12s; }
.icon-picker label:hover span { background: var(--hover); color: var(--text); }
.icon-picker input:checked + span { background: var(--active); border-color: var(--line-3); color: var(--text); }
.icon-picker input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---------- Karty i powierzchnie ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.card-head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -.005em; }
.card-head .link { margin-left: auto; color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.card-head .link:hover { color: var(--text); }
.card-body { padding: 4px 16px 16px; }
.card-list { padding: 0 6px 8px; }
.divider { height: 1px; background: var(--line); margin: 12px 0; border: 0; }

/* ---------- Awatary ---------- */
.avatar {
  --size: 22px;
  width: var(--size); height: var(--size); border-radius: 50%; flex-shrink: 0;
  display: inline-grid; place-items: center; overflow: hidden;
  background: var(--c, #7c8cff); color: rgba(0,0,0,.72);
  font: 600 calc(var(--size) * .42)/1 var(--font); letter-spacing: -.02em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.none { background: transparent; border: 1.5px dashed var(--line-3); box-shadow: none; color: var(--faint); }
.avatar.xs { --size: 18px; } .avatar.sm { --size: 20px; } .avatar.md { --size: 28px; } .avatar.lg { --size: 40px; } .avatar.xl { --size: 72px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--panel); }
.avatar-stack .avatar + .avatar { margin-left: -6px; }

/* ---------- Statusy / priorytety / etykiety ---------- */
.status-icon { display: inline-grid; place-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
  border: 1px solid var(--line-2); border-radius: 999px; font-size: 12px; color: var(--text-2); white-space: nowrap;
  background: var(--panel);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 12.5px; border: 1px solid transparent; max-width: 100%;
  transition: background .12s, border-color .12s;
}
.chip-btn:hover { background: var(--hover); border-color: var(--line-2); color: var(--text); }
.chip-btn.outlined { border-color: var(--line-2); }
.chip-btn.placeholder { color: var(--faint); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 0; }
.tag .swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.due.soon { color: var(--warn); }
.due.overdue { color: var(--danger); }
.due.done { color: var(--faint); }
.progress { position: relative; height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.progress > i { position: absolute; inset: 0 auto 0 0; width: var(--v, 0%); background: var(--c, var(--accent)); border-radius: inherit; transition: width .5s var(--ease); }
.progress.lg { height: 6px; }
.ring { --v: 0; --c: var(--accent); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--line-2) 0); position: relative; flex-shrink: 0; }
.ring::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--panel); }
.ring span { position: relative; font: 600 10px var(--mono); }

/* ---------- Dashboard ---------- */
.greeting { margin-bottom: 24px; }
.greeting .date { color: var(--muted); font-size: 12.5px; font-family: var(--mono); letter-spacing: .02em; text-transform: uppercase; }
.greeting h2 { margin: 6px 0 4px; font-size: 26px; font-weight: 600; letter-spacing: -.03em; }
.greeting p { margin: 0; color: var(--text-2); }
.greeting p strong { color: var(--text); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--line); overflow: hidden; }
.stat { padding: 14px 16px; min-width: 0; background: var(--panel); }
.stat .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 22px; font-weight: 600; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.stat.alert .v { color: var(--danger); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dash-col { display: grid; gap: 18px; min-width: 0; }

/* Wiersze listy zadań (wspólne dla dashboardu, list i projektów) */
.row {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border-radius: var(--r-sm);
  cursor: pointer; transition: background .1s; position: relative;
}
.row:hover { background: var(--hover); }
.row .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { display: flex; align-items: center; gap: 10px; flex-shrink: 1; min-width: 0; justify-content: flex-end; }
.row .meta > * { flex-shrink: 0; }
.row .meta > .tag { flex-shrink: 1; max-width: 160px; }
.row .title { flex-shrink: 1; }
.row.done .title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-3); }
.row .tid { font: 500 11.5px var(--mono); color: var(--faint); width: 44px; flex-shrink: 0; }
.row-icon-btn { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0; }
.row-icon-btn:hover { background: var(--active); }

.project-tile { display: grid; gap: 10px; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2); transition: border-color .15s, background .15s, transform .15s var(--ease); }
.project-tile:hover { border-color: var(--line-3); background: var(--panel-2); }
.project-tile .top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.project-tile h4 { margin: 0; font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-tile .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.p-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); flex-shrink: 0; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 25%, transparent); }
.p-icon.lg { width: 40px; height: 40px; border-radius: 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }

.goal-row { display: grid; gap: 8px; padding: 10px; border-radius: var(--r-sm); cursor: pointer; }
.goal-row:hover { background: var(--hover); }
.goal-row .top { display: flex; align-items: center; gap: 8px; }
.goal-row .top .title { flex: 1; min-width: 0; font-weight: 500; }
.goal-row .pct { font: 600 12px var(--mono); color: var(--text-2); }

.team { display: grid; gap: 4px; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); }
.team-row .name { flex: 1; min-width: 0; }
.team-row .name small { display: block; color: var(--muted); font-size: 11.5px; }
.team-row .nums { display: flex; gap: 14px; font: 500 12px var(--mono); color: var(--text-2); }
.team-row .nums span { display: grid; text-align: right; }
.team-row .nums em { font: 400 10.5px var(--font); color: var(--faint); font-style: normal; }

/* ---------- Aktywność ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); align-items: start; position: relative; }
.feed li.link { cursor: pointer; }
.feed li.link:hover { background: var(--hover); }
.feed .what { color: var(--text-2); line-height: 1.45; }
.feed .what b { color: var(--text); font-weight: 500; }
.feed .what .obj { color: var(--text); font-weight: 500; }
.feed .what .excerpt { display: block; margin-top: 4px; padding-left: 10px; border-left: 2px solid var(--line-2); color: var(--muted); white-space: pre-line; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed .when { color: var(--faint); font-size: 11.5px; white-space: nowrap; padding-top: 2px; }
.feed-day { font: 500 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 18px 10px 6px; }
.feed-day:first-child { padding-top: 4px; }
.feed .ico { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); }
.feed .ico.ok { color: var(--s-done); } .feed .ico.warn { color: var(--warn); } .feed .ico.accent { color: var(--accent); } .feed .ico.danger { color: var(--danger); } .feed .ico.info { color: var(--info); }

/* ---------- Pasek narzędzi / filtry ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: var(--topbar-h); z-index: 15; }
.toolbar .search { position: relative; width: 240px; max-width: 100%; }
.toolbar .search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.toolbar .search .input { height: 30px; min-height: 0; padding-left: 30px; background: var(--panel); }
.toolbar .grow { flex: 1; }
.filter-chip { display: inline-flex; align-items: center; height: 26px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--panel); font-size: 12.5px; overflow: hidden; }
.filter-chip > span { padding: 0 8px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; height: 100%; }
.filter-chip > span + span { border-left: 1px solid var(--line-2); color: var(--text); }
.filter-chip button { height: 100%; padding: 0 6px; border-left: 1px solid var(--line-2); color: var(--muted); display: grid; place-items: center; }
.filter-chip button:hover { background: var(--hover); color: var(--text); }

/* ---------- Lista zadań (grupowana) ---------- */
.group { margin-bottom: 2px; }
.group-head {
  position: sticky; top: calc(var(--topbar-h) + var(--toolbar-h, 51px)); z-index: 5;
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 24px;
  background: var(--bg-2); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line);
  font-weight: 500; font-size: 13px;
}
.group-head .n { color: var(--muted); font: 500 12px var(--mono); }
.group-head .add { margin-left: auto; }
.group-head button.collapse svg { transition: transform .15s; }
.group.collapsed .group-head button.collapse svg { transform: rotate(-90deg); }
.group.collapsed .group-body { display: none; }
.task-line {
  display: grid; grid-template-columns: 22px 52px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 42px; padding: 0 24px; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background .08s;
}
.task-line:hover { background: var(--panel); }
.task-line:focus-visible { outline-offset: -2px; }
.task-line .tid { font: 500 11.5px var(--mono); color: var(--faint); }
.task-line .t { display: flex; align-items: center; gap: 10px; min-width: 0; }
.task-line .t .title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-line .t .sub { display: inline-flex; gap: 8px; color: var(--faint); font-size: 12px; flex-shrink: 0; }
.task-line .sub span { display: inline-flex; align-items: center; gap: 3px; }
.task-line .right { display: flex; align-items: center; gap: 10px; }
.task-line.done .title { color: var(--muted); }
.task-line .proj-tag { max-width: 160px; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 12px; padding: 16px 24px 32px; overflow-x: auto; align-items: start; min-height: calc(100dvh - var(--topbar-h) - 52px); }
.column { display: flex; flex-direction: column; min-height: 120px; max-height: calc(100dvh - var(--topbar-h) - 90px); border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 500; }
.column-head .n { color: var(--muted); font: 500 12px var(--mono); }
.column-head .add { margin-left: auto; }
.column-body { display: flex; flex-direction: column; gap: 6px; padding: 2px 8px 10px; overflow-y: auto; min-height: 60px; flex: 1; transition: background .15s; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.column.drop-target .column-body { background: rgba(190,239,120,.035); }
.kcard {
  display: grid; gap: 8px; padding: 10px 11px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow-card);
  cursor: grab; user-select: none; touch-action: pan-y;
  transition: border-color .12s, box-shadow .12s, transform .15s var(--ease), opacity .12s;
}
.kcard:hover { border-color: var(--line-3); }
.kcard:focus-visible { outline-offset: 1px; }
.kcard .k-top { display: flex; align-items: center; gap: 6px; font: 500 11px var(--mono); color: var(--faint); }
.kcard .k-top .tag { font-family: var(--font); margin-left: auto; max-width: 60%; }
.kcard .k-title { font-weight: 500; line-height: 1.4; word-break: break-word; }
.kcard .k-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.kcard .k-foot .sp { flex: 1; }
.kcard .k-foot .meta-ic { display: inline-flex; align-items: center; gap: 3px; }
.kcard.done .k-title { color: var(--muted); }
.kcard.dragging-source { opacity: .35; }
.drag-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: rotate(2deg) scale(1.02); box-shadow: var(--shadow-pop); cursor: grabbing; border-color: var(--line-3); }
.drop-placeholder { height: var(--h, 64px); border-radius: var(--r); border: 1.5px dashed rgba(190,239,120,.35); background: rgba(190,239,120,.04); flex-shrink: 0; }
.column-empty { display: grid; place-items: center; padding: 18px 8px; color: var(--faint); font-size: 12px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r); }

/* ---------- Projekty ---------- */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pcard { display: grid; gap: 14px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .15s, background .15s, transform .2s var(--ease); position: relative; }
.pcard:hover { border-color: var(--line-3); background: var(--panel-2); }
.pcard .head { display: flex; gap: 12px; align-items: flex-start; }
.pcard h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.pcard .desc { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.pcard .stats-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.pcard .stats-line .sp { flex: 1; }
.pcard .prog-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pcard .prog-label b { color: var(--text-2); font-weight: 500; font-family: var(--mono); }
.project-hero { display: flex; gap: 16px; align-items: flex-start; padding: 24px 32px 0; max-width: 1320px; margin: 0 auto; }
.project-hero h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; font-weight: 600; }
.project-hero .desc { color: var(--text-2); margin: 6px 0 0; max-width: 760px; white-space: pre-line; }
.props { display: flex; flex-wrap: wrap; gap: 6px 4px; margin-top: 14px; }
.tabs { display: flex; gap: 2px; padding: 0 32px; border-bottom: 1px solid var(--line); max-width: 1320px; margin: 18px auto 0; }
.tabs button { position: relative; height: 38px; padding: 0 10px; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.tabs .n { font: 500 11px var(--mono); color: var(--faint); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.side-props { display: grid; gap: 2px; }
.side-props .prop { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; min-height: 32px; gap: 8px; }
.side-props .prop > span:first-child { color: var(--muted); font-size: 12.5px; }
.breakdown { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--line-2); gap: 2px; }
.breakdown i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--text-2); font-weight: 500; font-family: var(--mono); }

/* ---------- Cele ---------- */
.goal-list { display: grid; gap: 10px; }
.gcard { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: center; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); cursor: pointer; transition: border-color .15s, background .15s; }
.gcard:hover { border-color: var(--line-3); background: var(--panel-2); }
.gcard h3 { margin: 0; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.gcard .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.gcard .prog { display: grid; gap: 8px; }
.gcard .prog .nums { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.gcard .prog .nums b { font: 600 13px var(--mono); color: var(--text); }
.gcard.closed { opacity: .65; }
.goal-status { font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.goal-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.gs-not_started { color: var(--s-todo); } .gs-on_track { color: var(--s-done); } .gs-at_risk { color: var(--warn); } .gs-off_track { color: var(--danger); } .gs-achieved { color: var(--accent); } .gs-abandoned { color: var(--faint); }
.milestones { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.milestones li { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 8px; border-radius: var(--r-sm); }
.milestones li:hover { background: var(--hover); }
.milestones li.done .m-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-3); }
.milestones .m-title { flex: 1; min-width: 0; }
.milestones li .del { opacity: 0; transition: opacity .12s; }
.milestones li:hover .del, .milestones li:focus-within .del { opacity: 1; }
.value-stepper { display: flex; align-items: center; gap: 8px; }
.value-stepper .input { width: 110px; text-align: center; font-family: var(--mono); }
input[type="range"] { accent-color: var(--accent); width: 100%; }

/* ---------- Kalendarz ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: var(--topbar-h); background: var(--bg); z-index: 10; }
.cal-head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.015em; min-width: 170px; text-transform: capitalize; }
.cal-head .grow { flex: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { padding: 8px 10px; font: 500 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.cal-dow:nth-child(7n) { border-right: 0; }
.cal-cell { min-height: 118px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: default; position: relative; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(255,255,255,.012) 6px 7px); }
.cal-cell.out .day-n { color: var(--faint); }
.cal-cell.weekend { background-color: rgba(255,255,255,.008); }
.cal-cell .day-n { display: flex; align-items: center; justify-content: space-between; font: 500 12px var(--mono); color: var(--text-2); padding: 2px 4px 4px; }
.cal-cell.today .day-n b { background: var(--accent); color: var(--accent-ink); border-radius: 5px; padding: 1px 6px; font-weight: 600; }
.cal-cell .add-ev { opacity: 0; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; color: var(--muted); transition: opacity .12s; }
.cal-cell:hover .add-ev, .cal-cell .add-ev:focus-visible { opacity: 1; }
.cal-cell .add-ev:hover { background: var(--hover); color: var(--text); }
.cal-item {
  display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 6px; border-radius: 4px;
  font-size: 12px; color: var(--text-2); text-align: left; width: 100%; min-width: 0;
  background: color-mix(in srgb, var(--c, var(--muted)) 10%, transparent);
  box-shadow: inset 2px 0 0 var(--c, var(--muted));
  transition: background .12s;
}
.cal-item:hover { background: color-mix(in srgb, var(--c, var(--muted)) 20%, transparent); color: var(--text); }
.cal-item span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.cal-item .time { font: 500 10.5px var(--mono); color: var(--muted); }
.cal-item.done span.t { text-decoration: line-through; color: var(--muted); }
.cal-more { font-size: 11.5px; color: var(--muted); padding: 2px 6px; text-align: left; }
.cal-more:hover { color: var(--text); }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 60vh; }
.week-col { border-right: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.week-col:last-child { border-right: 0; }
.week-col .wd { display: flex; align-items: baseline; gap: 6px; padding: 4px 4px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.week-col .wd b { font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.week-col .wd span { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; }
.week-col.today .wd b { color: var(--accent); }
.week-col .cal-item { height: auto; min-height: 26px; padding: 4px 6px; align-items: flex-start; }
.week-col .cal-item span.t { white-space: normal; }
.agenda { max-width: 820px; margin: 0 auto; padding: 16px 24px 60px; }
.agenda-day { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.agenda-day .d { font: 500 12px var(--mono); color: var(--muted); text-transform: uppercase; }
.agenda-day .d b { display: block; font: 600 22px var(--font); color: var(--text); letter-spacing: -.03em; text-transform: none; }
.agenda-day.today .d b { color: var(--accent); }
.agenda-day .items { display: grid; gap: 4px; }
.agenda-day .cal-item { height: 32px; font-size: 13px; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

/* ---------- Komentarze ---------- */
.comments { display: grid; gap: 2px; }
.comment { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 10px 0; }
.comment .c-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.comment .c-head b { font-weight: 600; }
.comment .c-head time { color: var(--faint); font-size: 11.5px; }
.comment .c-head .c-actions { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.comment:hover .c-actions, .comment:focus-within .c-actions { opacity: 1; }
.comment .c-body { margin-top: 3px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.comment .c-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.composer { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding-top: 8px; }
.composer .box { border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg); transition: border-color .12s, box-shadow .12s; }
.composer .box:focus-within { border-color: rgba(190,239,120,.5); box-shadow: 0 0 0 3px rgba(190,239,120,.08); }
.composer textarea { width: 100%; border: 0; background: transparent; resize: none; padding: 9px 11px 4px; min-height: 40px; max-height: 260px; outline: none; color: var(--text); line-height: 1.5; }
.composer .bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 6px 11px; font-size: 11.5px; color: var(--faint); }

/* ---------- Szuflada zadania ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(5,6,8,.45); opacity: 0; transition: opacity .2s; }
.drawer-backdrop.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(720px, 100vw);
  background: var(--bg-2); border-left: 1px solid var(--line-2); box-shadow: -24px 0 60px -20px rgba(0,0,0,.6);
  display: flex; flex-direction: column; transform: translateX(24px); opacity: 0;
  transition: transform .26s var(--ease), opacity .2s;
}
.drawer.open { transform: none; opacity: 1; }
.drawer-head { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 14px 0 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.drawer-head .crumbs { flex: 1; }
.drawer-body { overflow-y: auto; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: start; }
.drawer-main { padding: 22px 24px 40px; min-width: 0; }
.drawer-side { padding: 18px 16px; border-left: 1px solid var(--line); position: sticky; top: 0; min-height: 100%; }
.drawer-side .prop { display: grid; gap: 3px; margin-bottom: 12px; }
.drawer-side .prop > span { color: var(--muted); font-size: 11.5px; padding-left: 8px; }
.drawer-side .chip-btn { width: 100%; justify-content: flex-start; height: 30px; }
.drawer-side .meta-small { font-size: 11.5px; color: var(--faint); padding: 0 8px; line-height: 1.7; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.title-edit { width: 100%; font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; border: 0; background: transparent; resize: none; outline: none; padding: 4px 6px; margin: 0 -6px; border-radius: var(--r-sm); overflow: hidden; color: var(--text); }
.title-edit:hover { background: var(--panel); }
.title-edit:focus { background: var(--panel); box-shadow: 0 0 0 1px var(--line-2); }
.desc-edit { width: 100%; min-height: 70px; border: 0; background: transparent; resize: none; outline: none; padding: 6px; margin: 4px -6px 0; border-radius: var(--r-sm); color: var(--text-2); line-height: 1.6; overflow: hidden; }
.desc-edit:hover { background: var(--panel); }
.desc-edit:focus { background: var(--panel); box-shadow: 0 0 0 1px var(--line-2); color: var(--text); }
.section-title { display: flex; align-items: center; gap: 8px; margin: 26px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.section-title .n { font: 500 11.5px var(--mono); color: var(--faint); }
.section-title .sp { flex: 1; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 6px; border-radius: var(--r-sm); }
.checklist li:hover { background: var(--panel); }
.checklist li .ci-text { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 4px 0; color: var(--text); }
.checklist li.done .ci-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-3); }
.checklist li .del { opacity: 0; }
.checklist li:hover .del, .checklist li:focus-within .del { opacity: 1; }
.checklist-add { display: flex; align-items: center; gap: 10px; padding: 0 6px; min-height: 32px; color: var(--faint); }
.checklist-add input { flex: 1; border: 0; background: transparent; outline: none; color: var(--text); padding: 6px 0; }
.mini-progress { display: inline-flex; align-items: center; gap: 6px; font: 500 11.5px var(--mono); color: var(--muted); }
.mini-progress .progress { width: 60px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.history li { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.history li b { color: var(--text-2); font-weight: 500; }
.history li > span { min-width: 0; }
.history .excerpt { display: none; }
.history .obj { color: var(--text-2); }
.history time { margin-left: auto; color: var(--faint); white-space: nowrap; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: start center; padding: 10vh 16px 16px; background: rgba(5,6,8,.55); opacity: 0; transition: opacity .18s; overflow-y: auto; }
.modal-backdrop.open { opacity: 1; }
.modal {
  width: 100%; max-width: 560px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-pop);
  transform: translateY(8px) scale(.985); opacity: 0; transition: transform .22s var(--ease), opacity .18s;
  display: flex; flex-direction: column; max-height: 82vh;
}
.modal-backdrop.open .modal { transform: none; opacity: 1; }
.modal.sm { max-width: 420px; } .modal.lg { max-width: 720px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0 20px; }
.modal-head h2 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; display: flex; align-items: center; gap: 8px; }
.modal-head h2 .crumb { color: var(--muted); font-weight: 500; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.modal-foot .left { margin-right: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.modal p.lead { margin: 0; color: var(--text-2); }
.prop-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

/* ---------- Menu / popover ---------- */
.popover {
  position: fixed; z-index: 120; min-width: 200px; max-width: 300px; max-height: min(380px, 70vh); overflow-y: auto;
  padding: 4px; background: var(--panel-2); border-radius: 9px; box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top left; transition: opacity .12s, transform .14s var(--ease);
}
.popover.open { opacity: 1; transform: none; }
.popover .pop-search { padding: 4px 4px 6px; border-bottom: 1px solid var(--line-2); margin: -4px -4px 4px; }
.popover .pop-search input { width: 100%; border: 0; background: transparent; outline: none; padding: 8px 10px; color: var(--text); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 30px; padding: 0 8px; border-radius: 6px; text-align: left; color: var(--text-2); }
.menu-item:hover, .menu-item.active { background: var(--active); color: var(--text); }
.menu-item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item .chk { color: var(--accent); }
.menu-item .hint { font: 500 11px var(--mono); color: var(--faint); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover, .menu-item.danger.active { background: var(--danger-soft); }
.menu-sep { height: 1px; background: var(--line-2); margin: 4px -4px; }
.menu-label { padding: 6px 8px 4px; font-size: 11px; color: var(--faint); font-weight: 500; }
.menu-empty { padding: 10px; color: var(--faint); font-size: 12.5px; text-align: center; }

/* ---------- Paleta poleceń ---------- */
.palette { max-width: 620px; }
.palette .p-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette .p-input input { flex: 1; height: 52px; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--text); }
.palette .p-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette .menu-item { min-height: 38px; }
.palette .p-foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); }
.palette .p-foot span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Toasty ---------- */
.toasts { position: fixed; right: 16px; bottom: calc(16px + var(--tabbar-h)); z-index: 200; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px;
  background: var(--panel-2); border-radius: 9px; box-shadow: var(--shadow-pop); font-size: 13px;
  animation: toast-in .26s var(--ease) both;
}
.toast.out { animation: toast-out .2s ease both; }
.toast .t-ic { display: grid; place-items: center; }
.toast.success .t-ic { color: var(--s-done); } .toast.error .t-ic { color: var(--danger); } .toast.info .t-ic { color: var(--info); }
.toast .t-msg { flex: 1; min-width: 0; }
.toast .t-act { color: var(--accent); font-weight: 500; padding: 4px 8px; border-radius: 5px; }
.toast .t-act:hover { background: var(--accent-soft); }
.toast .t-x { color: var(--faint); padding: 4px; border-radius: 5px; display: grid; }
.toast .t-x:hover { color: var(--text); background: var(--hover); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(4px) scale(.98); } }

/* ---------- Puste stany / ładowanie ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 48px 20px; color: var(--muted); }
.empty .e-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-2); margin-bottom: 8px; }
.empty h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.empty p { margin: 0; max-width: 340px; font-size: 13px; }
.empty .btn { margin-top: 12px; }
.empty.compact { padding: 22px 12px; }
.empty.compact .e-ic { width: 32px; height: 32px; border-radius: 9px; margin-bottom: 2px; }
.skel { background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 40%, var(--panel) 80%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: var(--r-sm); }
.skel-line { height: 12px; margin: 10px 0; }
.skel-row { height: 38px; margin: 4px 0; }
.skel-block { height: 120px; border-radius: var(--r-lg); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fade-in .3s var(--ease) both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }
.loading-bar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 300; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .2s; }
.loading-bar.on { opacity: 1; }
.loading-bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: bar 1s ease-in-out infinite; }
@keyframes bar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Ustawienia ---------- */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.settings-nav { display: grid; gap: 2px; position: sticky; top: calc(var(--topbar-h) + 24px); }
.settings-section { margin-bottom: 36px; scroll-margin-top: calc(var(--topbar-h) + 20px); }
.settings-section > h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.settings-section > p { margin: 0 0 16px; color: var(--muted); }
.settings-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.settings-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; padding: 16px 18px; border-bottom: 1px solid var(--line); align-items: start; }
.settings-row:last-child { border-bottom: 0; }
.settings-row > div:first-child b { display: block; font-weight: 500; }
.settings-row > div:first-child small { color: var(--muted); font-size: 12px; }
.settings-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--bg-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.avatar-edit { display: flex; align-items: center; gap: 16px; }
.user-line { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.user-line:last-child { border-bottom: 0; }
.user-line .who { flex: 1; min-width: 0; }
.user-line .who small { display: block; color: var(--muted); font-size: 12px; }
.role-badge { font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: 3px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.role-badge.member { background: var(--hover); color: var(--muted); }
.role-badge.off { background: var(--danger-soft); color: var(--danger); }
.session-line { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.session-line:last-child { border-bottom: 0; }
.session-line .who { flex: 1; min-width: 0; }
.session-line small { color: var(--muted); display: block; font-size: 12px; }
.session-line .current { font-size: 11px; color: var(--s-done); font-weight: 500; }

/* ---------- Mobilna nawigacja ---------- */
.tabbar { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stat { grid-column: span 2; }
  .stat:nth-child(n+4) { grid-column: span 3; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .settings { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .settings-nav { display: flex; overflow-x: auto; position: static; gap: 4px; }
  .settings-nav .nav-item { white-space: nowrap; }
}

@media (max-width: 900px) {
  :root { --tabbar-h: calc(58px + env(safe-area-inset-bottom)); }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 90;
    transform: translateX(-100%); transition: transform .26s var(--ease); box-shadow: 24px 0 60px -20px rgba(0,0,0,.7);
    padding-top: calc(10px + env(safe-area-inset-top));
  }
  .app.nav-open .sidebar { transform: none; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 89; background: rgba(5,6,8,.5); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .app.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .menu-toggle { display: inline-flex; margin-left: -6px; }
  .main { padding-bottom: var(--tabbar-h); }
  .topbar { padding: 0 14px; padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
  .topbar .hide-sm { display: none; }
  .page { padding: 20px 16px 40px; }
  .toolbar { padding: 8px 14px; top: calc(var(--topbar-h) + env(safe-area-inset-top)); }
  .toolbar .search { width: 100%; order: -1; }
  .group-head, .task-line { padding-left: 14px; padding-right: 14px; }
  .task-line { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .task-line .tid, .task-line .proj-tag, .task-line .t .sub { display: none; }
  .task-line .right .prio-wrap { display: none; }
  .board { padding: 12px 14px 24px; grid-auto-columns: minmax(82vw, 1fr); scroll-snap-type: x mandatory; }
  .column { scroll-snap-align: start; max-height: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { display: grid; place-items: center; align-content: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 500; }
  .tabbar [aria-current="page"] { color: var(--text); }
  .tabbar [aria-current="page"] svg { color: var(--accent); }
  .tabbar .fab { align-self: center; justify-self: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px -6px rgba(190,239,120,.45); }
  .drawer { width: 100vw; border-left: 0; transform: translateY(16px); }
  .drawer-head { padding-top: env(safe-area-inset-top); height: calc(50px + env(safe-area-inset-top)); }
  .drawer-body { display: flex; flex-direction: column; }
  .drawer-body > * { flex-shrink: 0; }
  .drawer-side { position: static; border-left: 0; border-bottom: 1px solid var(--line); order: -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; padding: 10px 12px; min-height: auto; }
  .drawer-side .prop { margin-bottom: 6px; }
  .drawer-side .meta-small { grid-column: 1 / -1; margin-top: 6px; }
  .drawer-main { padding: 18px 16px 40px; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { max-width: none !important; border-radius: 16px 16px 0 0; max-height: 92dvh; transform: translateY(24px); padding-bottom: env(safe-area-inset-bottom); }
  .project-hero { padding: 18px 16px 0; }
  .tabs { padding: 0 10px; overflow-x: auto; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { display: flex; overflow-x: auto; position: static; gap: 4px; }
  .settings-nav .nav-item { white-space: nowrap; }
  .settings-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .gcard { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .cal-head { padding: 10px 14px; top: calc(var(--topbar-h) + env(safe-area-inset-top)); }
  .cal-cell { min-height: 74px; padding: 3px; }
  .cal-cell .cal-item { height: 6px; padding: 0; font-size: 0; box-shadow: none; background: var(--c, var(--muted)); border-radius: 3px; }
  .cal-cell .cal-item > * { display: none; }
  .cal-cell .add-ev { display: none; }
  .cal-dow { padding: 6px 4px; text-align: center; }
  .week-grid { grid-template-columns: minmax(0, 1fr); }
  .week-col { border-right: 0; border-bottom: 1px solid var(--line); }
  .week-col .wd { border-bottom: 0; padding-bottom: 4px; margin-bottom: 0; }
  .agenda { padding: 10px 16px 40px; }
  .agenda-day { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
  .toasts { left: 16px; right: 16px; width: auto; }
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat, .stat:nth-child(n+4) { grid-column: span 1; }
  .stat:last-child { grid-column: 1 / -1; }
  .greeting h2 { font-size: 22px; }
  .row .meta > .tag { display: none; }
  .row { min-height: 44px; }
  .page-head { flex-wrap: wrap; }
  .project-cards { grid-template-columns: minmax(0, 1fr); }
  .drawer-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (hover: none) {
  .comment .c-actions, .checklist li .del, .milestones li .del { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Ekran logowania ---------- */
.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(800px 400px at 50% -10%, rgba(190,239,120,.07), transparent 70%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 360px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 28px; text-align: center; }
.auth-brand .ws-logo { width: 44px; height: 44px; border-radius: 12px; }
.auth-brand .ws-logo img { width: 34px; height: 34px; }
.auth-brand h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.025em; }
.auth-brand p { margin: 0; color: var(--muted); }
.auth form { display: grid; gap: 14px; padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-card); }
.auth .input { height: 38px; }
.auth .btn { height: 38px; width: 100%; font-size: 14px; }
.auth .form-error { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-soft); color: #ffb4b9; font-size: 12.5px; }
.auth .form-error:empty { display: none; }
.auth-foot { margin-top: 18px; text-align: center; color: var(--faint); font-size: 12px; display: flex; justify-content: center; gap: 6px; align-items: center; }
.auth-foot a:hover { color: var(--text); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 40px; }
.pw-wrap button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 30px; display: grid; place-items: center; color: var(--muted); border-radius: 5px; }
.pw-wrap button:hover { color: var(--text); background: var(--hover); }
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 500; transition: opacity .25s; }
.boot.gone { opacity: 0; pointer-events: none; }
.boot .ws-logo { width: 36px; height: 36px; border-radius: 10px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; transform: scale(.96); } }
