/* ============================================================
   TAASK TEAM — Pulse v4
   Część 1/2: reset, zmienne, layout, sidebar, header
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rethink+Sans:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap&subset=latin-ext');

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Rethink Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
input, textarea { font: inherit; color: inherit; }
.mono { font-family: 'Space Mono', ui-monospace, monospace; font-feature-settings: "tnum"; }

/* ---------- TOKENS ---------- */
:root {
  /* tła */
  --cream:        #f5f1ea;
  --cream-2:      #efe9df;
  --paper:        #fbf8f2;
  --ink:          #0f0f0f;
  --ink-2:        #2a2a2a;
  --muted:        #6b6660;
  --muted-2:      #9a948c;
  --line:         #e6dfd2;
  --line-2:       #d8d0c0;

  /* sidebar (jedyny mocny element) */
  --sb-bg:        #0a0a0a;
  --sb-fg:        #f5f1ea;
  --sb-muted:     #6b6660;
  --sb-line:      #1f1f1f;
  --sb-active:    #1a1a1a;

  /* pastele projektów */
  --p-sensor:     #d9f0d4;  --p-sensor-ink: #1f5132;  --p-sensor-line: #b8e0ad;
  --p-hub:        #d4e4f7;  --p-hub-ink:    #1e3a5f;  --p-hub-line:    #b3cce8;
  --p-blog:       #fdf0c4;  --p-blog-ink:   #6b4f00;  --p-blog-line:   #f0dc8a;
  --p-lp:         #e6dcf5;  --p-lp-ink:     #4a2d75;  --p-lp-line:     #cdb8e8;

  /* kropki/markery (mocne) */
  --d-sensor:     #22c55e;
  --d-hub:        #3b82f6;
  --d-blog:       #f97316;
  --d-lp:         #8b5cf6;

  /* metryki */
  --r-sm:  10px;
  --r-md:  16px;
  --r-lg:  22px;
  --r-xl:  28px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 0 rgba(15,15,15,.04), 0 2px 8px rgba(15,15,15,.04);
  --shadow-md: 0 1px 0 rgba(15,15,15,.05), 0 8px 24px rgba(15,15,15,.06);

  --sb-w: 232px;
  --rail-w: 340px;
}

/* ---------- LAYOUT ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sb-w) 1fr var(--rail-w);
  min-height: 100vh;
  background: var(--cream);
}
.main {
  padding: 28px 32px 48px;
  min-width: 0;
}
.rail {
  padding: 28px 28px 48px 8px;
  border-left: 1px dashed var(--line);
  min-width: 0;
}
@media (max-width: 1280px) {
  .app { grid-template-columns: var(--sb-w) 1fr; }
  .rail { display: none; }
}

/* ---------- SIDEBAR ---------- */
.sb {
  background: var(--sb-bg);
  color: var(--sb-fg);
  padding: 24px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-radius: 0 var(--r-xl) var(--r-xl) 0;
}
.sb__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--sb-line);
}
.sb__logo b {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.sb__logo span {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--sb-muted);
  text-transform: uppercase;
  margin-top: 4px;
}
.sb__group { display: flex; flex-direction: column; gap: 2px; }
.sb__label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sb-muted);
  padding: 0 12px 8px;
}
.sb__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--sb-fg);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s;
}
.sb__link svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.6; fill: none; flex-shrink: 0; }
.sb__link:hover { background: var(--sb-active); }
.sb__link.is-active {
  background: var(--sb-fg);
  color: var(--ink);
}
.sb__link.is-active svg { stroke: var(--ink); }
.sb__user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--sb-line);
}
.sb__user .ring {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
  color: var(--sb-bg);
  background: var(--sb-fg);
  border: 2px solid var(--sb-fg);
}
.sb__user b { font-size: 13px; }
.sb__user small { display: block; color: var(--sb-muted); font-size: 11px; }

/* ---------- HEADER (main top) ---------- */
.hd { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; }
.hd__top {
  display: flex;
  align-items: center;
  gap: 16px;
}
.hd__search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 10px 16px 10px 14px;
  box-shadow: var(--shadow-sm);
}
.hd__search .icon {
  width: 30px; height: 30px;
  background: #f9c6d8;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.hd__search .icon svg { width: 14px; height: 14px; stroke: var(--ink); stroke-width: 2; fill: none; }
.hd__search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
}
.hd__search input::placeholder { color: var(--muted-2); }
.hd__search .in { color: var(--muted); font-size: 12px; padding-right: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: nowrap; }
.chip {
  font-size: 11px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
  transition: background .15s;
}
.chip:hover { background: var(--cream-2); }
.chip.is-active { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.hd__icons { display: flex; gap: 8px; }
.hd__icons button {
  width: 38px; height: 38px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 50%;
  display: grid; place-items: center;
}
.hd__icons svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; fill: none; }

.hd__title h1 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.hd__title h1 .wave { display: inline-block; transform: rotate(8deg); }
.hd__title p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  max-width: 560px;
}

/* ---------- SECTION HEADERS ---------- */
.sec { margin-bottom: 28px; }
.sec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sec__head h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sec__head .count {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sec__head .more {
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px dashed var(--line-2);
  padding-bottom: 1px;
}

/* część 2/2 (karty, pille, checkboxy, rail, activity, polish) doklejam w następnej turze */

/* ============================================================
   Część 2/2: karty, pille, checkboxy, rail, activity, polish
   ============================================================ */

/* ---------- TASK CARDS (5 patternów) ---------- */
.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.card--sensor { background: var(--p-sensor); border-color: var(--p-sensor-line); }
.card--hub    { background: var(--p-hub);    border-color: var(--p-hub-line); }
.card--blog   { background: var(--p-blog);   border-color: var(--p-blog-line); }
.card--lp     { background: var(--p-lp);     border-color: var(--p-lp-line); }

.card__row { display: flex; align-items: flex-start; gap: 14px; }
.card__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  flex: 1;
  line-height: 1.3;
}
.card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }

/* Pattern 1 — HERO (high priority) */
.card--hero { padding: 24px 26px; border-radius: var(--r-xl); }
.card--hero .card__title { font-size: 22px; }
.card--hero .card__sub { color: var(--ink-2); opacity: .75; font-size: 13px; margin-top: 6px; }

/* Pattern 2 — KOMPAKT (low priority) */
.card--compact { padding: 12px 16px; border-radius: var(--r-md); }
.card--compact .card__title { font-size: 14px; font-weight: 600; }

/* Pattern 3 — PROGRESS */
.card--progress .bar { height: 6px; background: rgba(15,15,15,.08); border-radius: 99px; margin-top: 14px; overflow: hidden; }
.card--progress .bar > i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.card--progress .bar-foot { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--ink-2); opacity: .7; }

/* Pattern 4 — z AWATARAMI */
.card__people { display: flex; margin-left: auto; }
.card__people .ring {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
  color: var(--paper);
  border: 2px solid var(--paper);
  margin-left: -8px;
}
.card__people .ring:first-child { margin-left: 0; }

/* ---------- CHECKBOX (custom konturowy) ---------- */
.cb {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  cursor: pointer;
  transition: background .15s;
}
.cb:hover { background: rgba(15,15,15,.06); }
.cb.is-done { background: var(--ink); }
.cb.is-done::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23f5f1ea' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M3 8.5l3.5 3.5L13 5'/></svg>") center/14px no-repeat;
}

/* ---------- PILLS ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(15,15,15,.06);
  color: var(--ink-2);
  border: 1px solid rgba(15,15,15,.08);
}
.pill--type { text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; }
.pill--proj::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--dot, var(--ink));
}
.pill--proj[data-p="p_sensor"] { --dot: var(--d-sensor); }
.pill--proj[data-p="p_hub"]    { --dot: var(--d-hub); }
.pill--proj[data-p="p_blog"]   { --dot: var(--d-blog); }
.pill--proj[data-p="p_lp"]     { --dot: var(--d-lp); }

.pill--user { padding-left: 4px; }
.pill--user .ring {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 9px;
  color: var(--paper);
}

/* deadline pill = czarna kapsułka */
.pill--dl {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
  font-weight: 700;
  padding: 5px 12px;
}
.pill--dl.is-today    { background: #d4361e; border-color: #d4361e; }
.pill--dl.is-tomorrow { background: #b85b00; border-color: #b85b00; }

/* ---------- RAIL (głosówki + deadliny) ---------- */
.rail__sec { margin-bottom: 28px; }
.rail__head {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-left: 4px;
}

.voice {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.voice__top { display: flex; align-items: center; gap: 10px; }
.voice__top .ring {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
  color: var(--paper);
  border: 2px solid var(--paper);
  outline: 1.5px solid var(--ink);
}
.voice__top b { font-size: 13px; }
.voice__top .dur {
  font-size: 11px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}
.voice__top time { margin-left: auto; font-size: 11px; color: var(--muted); }
.voice__txt { font-size: 12.5px; color: var(--ink-2); margin: 10px 0 8px; line-height: 1.45; font-style: italic; }
.voice__foot { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }

.dl-group { margin-bottom: 14px; }
.dl-group__lab {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 4px 6px;
}
.dl-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
}
.dl-item::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--dot, var(--ink));
  flex-shrink: 0;
}
.dl-item[data-p="p_sensor"] { --dot: var(--d-sensor); }
.dl-item[data-p="p_hub"]    { --dot: var(--d-hub); }
.dl-item[data-p="p_blog"]   { --dot: var(--d-blog); }
.dl-item[data-p="p_lp"]     { --dot: var(--d-lp); }

/* ---------- ACTIVITY FEED ---------- */
.feed {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 8px 4px;
  box-shadow: var(--shadow-sm);
}
.feed__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.feed__row:last-child { border-bottom: 0; }
.feed__row .ring {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
  color: var(--paper);
  flex-shrink: 0;
}
.feed__row b { font-weight: 700; }
.feed__row em { font-style: normal; font-weight: 600; color: var(--ink); }
.feed__row .proj-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--r-pill);
}
.feed__row .proj-tag[data-p="p_sensor"] { background: var(--p-sensor); color: var(--p-sensor-ink); }
.feed__row .proj-tag[data-p="p_hub"]    { background: var(--p-hub);    color: var(--p-hub-ink); }
.feed__row .proj-tag[data-p="p_blog"]   { background: var(--p-blog);   color: var(--p-blog-ink); }
.feed__row .proj-tag[data-p="p_lp"]     { background: var(--p-lp);     color: var(--p-lp-ink); }
.feed__row time { margin-left: auto; font-size: 11px; color: var(--muted); }

/* ---------- POLISH ---------- */
::selection { background: var(--ink); color: var(--cream); }
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
