/* =====================================================
   Beauty CRM Threads · app.css
   Estetyka: editorial / atelier
   Paleta: cream, deep forest, burnt coral, dusty plum
   ===================================================== */

:root {
  --cream:       #f5f1e8;
  --cream-dark:  #ebe5d4;
  --paper:       #fdfaf2;
  --ink:         #1d2920;
  --ink-soft:    #3a4a3e;
  --ink-muted:   #6b7368;

  --forest:      #2d4a3e;
  --forest-dark: #1e3329;
  --coral:       #c65d3e;
  --coral-soft:  #e89878;
  --plum:        #8a4a6b;
  --ochre:       #c69c3e;
  --dusty-blue:  #4a6b8a;

  --border:      #d9d2bf;
  --border-strong: #b8ae95;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(29, 41, 32, 0.04);
  --shadow-md: 0 4px 12px rgba(29, 41, 32, 0.06);
  --shadow-lg: 0 12px 32px rgba(29, 41, 32, 0.10);

  --serif: 'Fraunces', Georgia, serif;
  --sans:  'Inter', system-ui, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-image:
    radial-gradient(circle at 10% 0%, rgba(198, 93, 62, 0.04) 0, transparent 40%),
    radial-gradient(circle at 90% 100%, rgba(45, 74, 62, 0.05) 0, transparent 45%);
  min-height: 100vh;
}

h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
h1 { font-size: 2.4rem; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 1.8rem; line-height: 1.15; }
h3 { font-size: 1.35rem; }

a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--coral); }

/* -------------------- Navigation -------------------- */
.app-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1020;
  backdrop-filter: blur(8px);
}
.app-brand {
  color: var(--ink) !important;
  font-weight: 500;
}
.app-brand:hover { color: var(--forest) !important; }
.brand-mark {
  width: 28px; height: 28px;
  background: var(--forest);
  border-radius: 50%;
  position: relative;
  display: inline-block;
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 6px;
  background: var(--coral);
  border-radius: 50%;
}
.brand-text {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
}
.brand-accent {
  color: var(--coral);
  font-style: italic;
  font-weight: 400;
  margin-left: 2px;
}

.app-nav-links a {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.app-nav-links a:hover { color: var(--forest); }
.app-nav-links a.active {
  color: var(--forest);
  border-bottom-color: var(--coral);
}

.user-badge {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ac, var(--forest));
  color: var(--paper);
  border: 2px solid var(--paper);
  outline: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.15s;
}
.user-badge:hover { transform: scale(1.08); }

/* -------------------- Buttons -------------------- */
.btn-primary-custom {
  background: var(--forest);
  border: 1px solid var(--forest);
  color: var(--paper);
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.15s;
}
.btn-primary-custom:hover {
  background: var(--forest-dark);
  border-color: var(--forest-dark);
  color: var(--paper);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-coral {
  background: var(--coral);
  border: 1px solid var(--coral);
  color: var(--paper);
}
.btn-coral:hover {
  background: #a84a30;
  border-color: #a84a30;
  color: var(--paper);
}
.btn-outline-custom {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
}
.btn-outline-custom:hover {
  background: var(--cream-dark);
  border-color: var(--ink-soft);
  color: var(--ink);
}

/* -------------------- Main -------------------- */
.app-main {
  padding: 2rem 0 4rem;
}
.container-xl { max-width: 1280px; }

/* -------------------- Page header -------------------- */
.page-header {
  margin-bottom: 2.5rem;
}
.page-header .eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--coral);
  font-weight: 600;
  margin-bottom: 8px;
}
.page-header h1 {
  margin: 0 0 8px 0;
}
.page-header .lede {
  color: var(--ink-muted);
  font-size: 16px;
  max-width: 56ch;
}

/* -------------------- Stats row -------------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: all 0.2s;
}
.stat-card:hover {
  border-color: var(--ink-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.stat-card .stat-hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* -------------------- View switcher -------------------- */
.view-switch {
  display: inline-flex;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}
.view-switch button {
  background: transparent;
  border: 0;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.view-switch button:hover { color: var(--ink); }
.view-switch button.active {
  background: var(--forest);
  color: var(--paper);
}
.view-switch button i { margin-right: 6px; }

/* -------------------- Filters -------------------- */
.filters-bar {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.filters-bar .filter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  font-weight: 600;
  margin-right: 4px;
}
.filters-bar select, .filters-bar input {
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--cream);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  min-width: 140px;
}
.filters-bar select:focus, .filters-bar input:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.1);
}

/* -------------------- Thread card (Cards view) -------------------- */
.thread-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}
.thread-card:hover {
  border-color: var(--ink-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.thread-card .tc-module {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.thread-card .tc-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  margin: 10px 0 8px;
}
.thread-card:hover .tc-title {
  color: var(--forest);
}
.thread-card .tc-body {
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}
.thread-card .tc-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-muted);
  flex-wrap: wrap;
}
.thread-card .tc-meta i { margin-right: 3px; }
.thread-card .tc-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* -------------------- Badges -------------------- */
.badge-soft {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 10px;
  letter-spacing: 0.02em;
  text-transform: none;
  border: 1px solid transparent;
}
.badge-type-problem  { background: #fbe7e2; color: #7a2c19; border-color: #f0c4b8; }
.badge-type-idea     { background: #e6f0e6; color: #1e3329; border-color: #c4d8c4; }
.badge-type-feature  { background: #e4ecf5; color: #1a3352; border-color: #c1d2e5; }
.badge-type-question { background: #f6ecda; color: #5a4011; border-color: #e5d2a8; }
.badge-type-decision { background: #ede3f0; color: #4b1b5c; border-color: #d8c5dd; }

.badge-prio-low      { background: var(--cream-dark); color: var(--ink-muted); }
.badge-prio-medium   { background: #e8e3cf; color: #5c5033; }
.badge-prio-high     { background: #f5d6b8; color: #7a3f0a; }
.badge-prio-critical { background: #c65d3e; color: var(--paper); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--cream-dark);
  color: var(--ink-soft);
}
.status-pill::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-muted);
}
.status-new::before         { background: #4a6b8a; }
.status-discussion::before  { background: #c69c3e; }
.status-analysis::before    { background: #8a4a6b; }
.status-accepted::before    { background: #2d4a3e; }
.status-in-progress::before { background: #c65d3e; animation: pulse-dot 2s infinite; }
.status-done::before        { background: #6b8a4a; }
.status-rejected::before    { background: #a84a30; }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.6; }
}

/* -------------------- Kanban -------------------- */
.kanban-wrap {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.kanban-col {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 10px;
  min-height: 400px;
}
.kanban-col-head {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  padding: 0 6px 12px;
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--coral);
  margin-bottom: 10px;
}
.kanban-col-head .count {
  background: var(--cream);
  color: var(--ink-muted);
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.kanban-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.kanban-card:hover {
  background: var(--paper);
  border-color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
.kanban-card .kc-title {
  font-weight: 500;
  color: var(--ink);
  margin: 6px 0;
  line-height: 1.35;
}
.kanban-card .kc-meta {
  font-size: 11px;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

/* -------------------- List view -------------------- */
.list-wrap {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.list-row {
  display: grid;
  grid-template-columns: 100px 1fr 110px 110px 80px;
  gap: 14px;
  padding: 14px 18px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--cream); }
.list-row .lr-title {
  font-weight: 500;
  color: var(--ink);
}
.list-row .lr-title:hover { color: var(--forest); }
.list-head {
  background: var(--cream-dark);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 10px 18px;
}

/* -------------------- Thread detail page -------------------- */
.thread-detail {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
}
.thread-detail h1 {
  font-family: var(--serif);
  font-size: 2rem;
  margin: 10px 0 16px;
}
.thread-detail .td-body {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  white-space: pre-wrap;
}
.thread-detail .td-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 20px 0;
  font-size: 13px;
  color: var(--ink-muted);
}
.thread-detail .td-meta > div { display: flex; align-items: center; gap: 6px; }

/* -------------------- Comments -------------------- */
.comment {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
}
.comment-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.comment-author { font-weight: 600; color: var(--ink); }
.comment-time { font-size: 12px; color: var(--ink-muted); }
.comment-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

/* -------------------- Attachments -------------------- */
.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.attachment-tile {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: 12px;
  text-align: center;
  transition: all 0.15s;
}
.attachment-tile:hover {
  border-color: var(--forest);
  transform: translateY(-2px);
}
.attachment-tile img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.attachment-tile .att-icon {
  font-size: 42px;
  color: var(--ink-muted);
  height: 100px;
  display: flex; align-items: center; justify-content: center;
}
.attachment-tile .att-name {
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-tile .att-size {
  color: var(--ink-muted);
  font-size: 11px;
}

/* -------------------- Modules grid -------------------- */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.module-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 4px solid var(--mc, var(--forest));
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s;
  cursor: pointer;
  display: block;
  color: var(--ink);
}
.module-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}
.module-card .mc-icon {
  font-size: 28px;
  color: var(--mc, var(--forest));
  margin-bottom: 10px;
  display: block;
}
.module-card .mc-name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 4px;
}
.module-card .mc-desc {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}
.module-card .mc-count {
  font-size: 12px;
  color: var(--mc, var(--forest));
  font-weight: 600;
}

/* -------------------- Login page -------------------- */
.login-wrap {
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.login-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.login-card h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}
.login-card .login-sub {
  color: var(--ink-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

/* -------------------- Forms -------------------- */
.form-control, .form-select {
  border: 1px solid var(--border);
  background: var(--cream);
  font-size: 14px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--ink);
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.12);
  background: var(--paper);
}
.form-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 6px;
}

/* -------------------- Modal -------------------- */
.modal-content {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}
.modal-title { font-family: var(--serif); }
.modal-footer {
  border-top: 1px solid var(--border);
  background: var(--cream);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* -------------------- Tags -------------------- */
.tag-pill {
  display: inline-block;
  padding: 2px 9px;
  background: var(--cream-dark);
  color: var(--ink-soft);
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 500;
  margin-right: 4px;
  font-family: var(--mono);
  letter-spacing: -0.01em;
}
.tag-pill::before { content: '#'; color: var(--coral); margin-right: 1px; }

/* -------------------- Utils -------------------- */
.divider-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3rem 0;
  color: var(--coral);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.divider-ornament::before, .divider-ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 20px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-muted);
}
.empty-state i {
  font-size: 48px;
  color: var(--border-strong);
  display: block;
  margin-bottom: 16px;
}
.empty-state h3 {
  font-family: var(--serif);
  margin-bottom: 8px;
  color: var(--ink-soft);
}

/* -------------------- Responsive -------------------- */
@media (max-width: 768px) {
  h1 { font-size: 1.9rem; }
  .app-nav-links { display: none !important; }
  .list-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .kanban-wrap {
    grid-template-columns: 1fr;
  }
  .thread-detail { padding: 20px; }
}

/* -------------------- Sekcja nagłówkowa (section sub) -------------------- */
.section-sub {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* -------------------- Fazy projektu -------------------- */
.dash-phases {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 2rem;
  overflow-x: auto;
}
.phases-track {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
  min-width: max-content;
}
.phase-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  min-width: 160px;
  position: relative;
  padding: 0 12px;
}
.phase-node:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 22px;
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.phase-node.phase-done:not(:last-child)::after {
  background: var(--forest);
}
.phase-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cream-dark);
  border: 2px solid var(--border-strong);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
  transition: all 0.2s;
}
.phase-node.phase-active .phase-dot {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--paper);
  box-shadow: 0 0 0 5px rgba(198, 93, 62, 0.18);
  animation: phase-pulse 2.4s infinite;
}
.phase-node.phase-done .phase-dot {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--paper);
}
@keyframes phase-pulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(198, 93, 62, 0.18); }
  50%      { box-shadow: 0 0 0 10px rgba(198, 93, 62, 0.08); }
}
.phase-node .phase-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.phase-node.phase-upcoming .phase-name {
  color: var(--ink-muted);
}
.phase-node.phase-active .phase-name {
  color: var(--coral);
}
.phase-node .phase-desc {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* -------------------- Dashboard main grid (wątki + aside) -------------------- */
.dash-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 2rem;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* -------------------- Right side panel -------------------- */
.dash-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.side-block {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.side-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}
.side-head i { color: var(--coral); margin-right: 4px; }
.side-body { padding: 14px 18px; }

/* Hot items */
.hot-item {
  display: block;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  text-decoration: none;
  color: var(--ink);
}
.hot-item:last-child { border-bottom: 0; }
.hot-item:hover .hot-title { color: var(--coral); }
.hot-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 4px;
  transition: color 0.15s;
}
.hot-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--ink-muted);
  align-items: center;
}
.hot-recent {
  background: var(--coral);
  color: var(--paper);
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 10px;
}
.tiny-module {
  font-weight: 600;
  font-size: 11px;
}

/* Activity feed */
.activity-feed .activity-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.1s;
}
.activity-feed .activity-item:last-child { border-bottom: 0; }
.activity-feed .activity-item:hover { background: var(--cream); margin: 0 -18px; padding: 10px 18px; border-radius: var(--radius-sm); }
.activity-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.activity-text strong { color: var(--ink); font-weight: 600; }
.activity-thread {
  color: var(--forest);
  font-weight: 500;
}
.activity-time {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Distribution bars */
.dist-row {
  margin-bottom: 10px;
}
.dist-row:last-child { margin-bottom: 0; }
.dist-label {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
}
.dist-bar {
  height: 6px;
  background: var(--cream-dark);
  border-radius: 3px;
  overflow: hidden;
}
.dist-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dist-fill.badge-type-problem  { background: #c65d3e; }
.dist-fill.badge-type-idea     { background: #2d4a3e; }
.dist-fill.badge-type-feature  { background: #4a6b8a; }
.dist-fill.badge-type-question { background: #c69c3e; }
.dist-fill.badge-type-decision { background: #8a4a6b; }

/* -------------------- Graf wątków (SVG) -------------------- */
.graph-wrap {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
#threadsGraph {
  width: 100%;
  height: auto;
  display: block;
  background: radial-gradient(circle at center, rgba(45, 74, 62, 0.025) 0%, transparent 60%);
}
#threadsGraph .g-link {
  stroke: var(--border-strong);
  stroke-width: 0.5;
  opacity: 0.4;
}
#threadsGraph .g-module-circle {
  fill: var(--paper);
  stroke-width: 2;
}
#threadsGraph .g-module-label {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: middle;
}
#threadsGraph .g-thread {
  cursor: pointer;
  transition: opacity 0.15s;
}
#threadsGraph .g-thread:hover { opacity: 0.75; }
#threadsGraph .g-thread circle {
  stroke: var(--paper);
  stroke-width: 1.5;
}
#threadsGraph .g-thread.crit circle {
  stroke: var(--coral);
  stroke-width: 2.5;
}
.graph-legend {
  text-align: center;
  margin-top: 10px;
  font-size: 11.5px;
}

/* -------------------- Dashboard modules section -------------------- */
.dash-modules { margin-bottom: 2rem; }

/* -------------------- Responsywność dashboardu -------------------- */
@media (max-width: 960px) {
  .dash-main-grid {
    grid-template-columns: 1fr;
  }
  .phases-track {
    flex-direction: column;
    gap: 0;
  }
  .phase-node {
    flex-direction: row;
    text-align: left;
    min-width: 100%;
    padding: 10px 0;
    gap: 14px;
    align-items: center;
  }
  .phase-node:not(:last-child)::after {
    top: auto;
    left: 21px;
    right: auto;
    bottom: -18px;
    width: 2px;
    height: 36px;
  }
  .phase-node .phase-dot { margin-bottom: 0; }
}

/* -------------------- Animations -------------------- */
.fade-in-up {
  animation: fadeInUp 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.thread-card:nth-child(1)  { animation-delay: 0.03s; }
.thread-card:nth-child(2)  { animation-delay: 0.06s; }
.thread-card:nth-child(3)  { animation-delay: 0.09s; }
.thread-card:nth-child(4)  { animation-delay: 0.12s; }
.thread-card:nth-child(5)  { animation-delay: 0.15s; }
.thread-card:nth-child(6)  { animation-delay: 0.18s; }
.thread-card:nth-child(7)  { animation-delay: 0.21s; }
.thread-card:nth-child(8)  { animation-delay: 0.24s; }
