/* ===== COMPONENTS — global component library =====
   Wszystkie klasy używają tokenów z tokens.css.
   Nie używaj tu raw wartości kolorów — tylko var(--...).
   ================================================== */


/* ══════════════════════════════════════════════════
   TOOLBAR
   ══════════════════════════════════════════════════ */
.proposals-toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
}
.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}
.toolbar-sort {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex: 1;
  flex-wrap: wrap;
}
.toolbar-sort-label {
  font-size: .75rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-right: .15rem;
}
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .28rem .65rem;
  border-radius: .4rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: .78rem;
  text-decoration: none !important;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
}
.sort-btn:hover { color: var(--text-primary); border-color: rgba(255,255,255,.2); }
.sort-btn.active {
  color: var(--accent);
  border-color: rgba(0,209,178,.45);
  background: var(--accent-muted);
  font-weight: 500;
}
.sort-arrow { font-size: .65rem; opacity: .8; margin-left: 1px; }

.toolbar-view { display: flex; gap: .3rem; flex-shrink: 0; }
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: .4rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: .82rem;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.view-toggle-btn:hover { color: var(--text-primary); border-color: rgba(255,255,255,.2); }
.view-toggle-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-muted); }

.toolbar-add-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--accent);
  color: #111 !important;
  border: none;
  border-radius: var(--radius-btn);
  padding: .32rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}
.toolbar-add-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 10px var(--accent-glow);
}


/* ══════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════ */
.badge-status {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-badge);
  white-space: nowrap;
}
.badge-proposition { background: var(--badge-proposition-bg); color: var(--badge-proposition-color); }
.badge-discussion  { background: var(--badge-discussion-bg);  color: var(--badge-discussion-color); }
.badge-referendum  { background: var(--badge-referendum-bg);  color: var(--badge-referendum-color); }
.badge-approved    { background: var(--badge-approved-bg);    color: var(--badge-approved-color); }
.badge-rejected    { background: var(--badge-rejected-bg);    color: var(--badge-rejected-color); }


/* ══════════════════════════════════════════════════
   PROPOSAL CARD (glosowania)
   ══════════════════════════════════════════════════ */
.proposals-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.proposals-list.view-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  align-items: start;
}
.proposals-list.view-grid > .tasks-section-label { grid-column: 1 / -1; }
@media (max-width: 640px) { .proposals-list.view-grid { grid-template-columns: 1fr; } }

.proposal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color var(--transition-med), box-shadow var(--transition-med);
  position: relative;
}
.proposal-card:hover {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px rgba(0,209,178,.4),
    0 0 12px rgba(0,209,178,.35),
    0 0 32px rgba(0,209,178,.15),
    0 6px 24px rgba(0,0,0,.4);
}
.proposal-card.open {
  border-color: rgba(0,209,178,.45);
  box-shadow: 0 0 0 1px rgba(0,209,178,.2), 0 0 12px rgba(0,209,178,.1);
}
.proposal-card-header {
  padding: .9rem 1.1rem .75rem;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}
.proposal-card-header:hover { background: rgba(255,255,255,.025); }
.proposal-card-header:has(.proposal-author-link:hover),
.proposal-card-header:has(.proposal-details-inline:hover),
.proposal-card-header:has(.proposal-chat-link:hover) { background: transparent; }
.proposal-card-header:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.proposal-card-title-row { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: .4rem; }
.proposal-card-num { font-size: .72rem; color: var(--text-muted); font-weight: 600; flex-shrink: 0; padding-top: 2px; }
.proposal-card-title { font-size: .95rem; font-weight: 600; color: var(--text-primary); flex: 1; min-width: 0; line-height: 1.35; }
.proposal-card-chevron { color: var(--text-muted); font-size: .75rem; flex-shrink: 0; margin-top: 4px; transition: transform var(--transition-med) ease; }
.proposal-card.open .proposal-card-chevron { transform: rotate(180deg); }

.proposal-card-badges-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .55rem; }

.proposal-preview {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 .55rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.proposal-card.open .proposal-preview { display: none; }

.proposal-card-meta { display: flex; align-items: center; gap: .45rem; font-size: .75rem; color: var(--text-muted); flex-wrap: wrap; }

.proposal-author-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  text-decoration: none !important;
  border-radius: .35rem;
  padding: 2px 5px 2px 2px;
  margin: -2px -5px -2px -2px;
  transition: background var(--transition-fast);
}
.proposal-author-link:hover { background: rgba(255,255,255,.07); }
.proposal-author-link:hover .proposal-author-name { color: var(--text-primary); }
.proposal-author-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #111;
  font-size: .6rem; font-weight: 700;
  flex-shrink: 0; overflow: hidden;
}
.proposal-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.proposal-author-name { color: rgba(232,234,240,.75); font-weight: 500; transition: color var(--transition-fast); }
.proposal-meta-sep { opacity: .35; }
.proposal-date { color: var(--text-muted); }
.proposal-signatures { display: inline-flex; align-items: center; gap: .2rem; }

.proposal-details-inline {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .75rem; font-weight: 500;
  color: var(--text-muted) !important;
  text-decoration: none !important;
  padding: 3px 8px;
  border-radius: .35rem;
  border: 1px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
}
.proposal-details-inline:hover { color: var(--accent) !important; border-color: rgba(0,209,178,.35); background: var(--accent-muted); }

.proposal-card-body {
  border-top: 1px solid var(--border);
  padding: 0 1.1rem 1rem;
  display: flex; flex-direction: column; gap: .85rem;
  transition: background var(--transition-fast);
}
.proposal-card-body:hover { background: var(--accent-muted); border-top-color: rgba(0,209,178,.35); }

.proposal-body-topbar { display: flex; justify-content: flex-end; padding: .6rem 0 .25rem; border-bottom: 1px solid var(--border); margin-bottom: .15rem; }
.proposal-details-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8rem; font-weight: 600;
  color: var(--accent) !important;
  text-decoration: none !important;
  padding: .3rem .75rem;
  border: 1px solid rgba(0,209,178,.3);
  border-radius: .4rem;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.proposal-details-btn:hover { background: var(--accent-muted); border-color: var(--accent); box-shadow: 0 0 8px rgba(0,209,178,.2); }

.proposal-section-label { font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .3rem; }
.proposal-section-label i { color: var(--accent); }
.proposal-section-text { font-size: .875rem; color: var(--text-primary); line-height: 1.6; }

.proposals-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); font-size: .9rem; }

.proposal-chat-link {
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--accent);
  text-decoration: none !important;
  font-size: .78rem; font-weight: 500;
  padding: 2px 7px 2px 5px;
  border-radius: var(--radius-badge);
  border: 1px solid rgba(0,209,178,.3);
  background: rgba(0,209,178,.07);
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.proposal-chat-link:hover { background: rgba(0,209,178,.18); border-color: var(--accent); box-shadow: 0 0 8px rgba(0,209,178,.3); }


/* ══════════════════════════════════════════════════
   STEPPER NAV (glosowania + tasks)
   ══════════════════════════════════════════════════ */
:root {
  --arrow-h: 36px;
  --arrow-tip: 12px;
  --arrow-overlap: 1px;
  --stepper-color: var(--accent);
  --stepper-color-muted: var(--accent-muted);
  --stepper-color-shadow: var(--accent-glow);
}
.stepper-nav { display: flex; align-items: center; gap: 0; margin-bottom: 1.5rem; flex-wrap: wrap; row-gap: .5rem; }

.stepper-step-wrap {
  position: relative;
  height: var(--arrow-h);
  clip-path: polygon(0 0, calc(100% - var(--arrow-tip)) 0, 100% 50%, calc(100% - var(--arrow-tip)) 100%, 0 100%);
  background: rgba(255,255,255,.04);
  margin-right: calc(-1 * var(--arrow-overlap));
  transition: filter var(--transition-fast), background var(--transition-fast);
}
.stepper-step-wrap + .stepper-step-wrap {
  clip-path: polygon(0 0, calc(100% - var(--arrow-tip)) 0, 100% 50%, calc(100% - var(--arrow-tip)) 100%, 0 100%, var(--arrow-tip) 50%);
}
.stepper-step-wrap:hover { background: rgba(255,255,255,.08); filter: brightness(1.15); z-index: 2; }
.stepper-step-wrap.active { background: var(--stepper-color-muted); filter: drop-shadow(0 0 6px var(--stepper-color-shadow)); z-index: 3; }

.stepper-step {
  display: inline-flex; align-items: center; gap: .45rem;
  height: 100%;
  padding: 0 calc(var(--arrow-tip) + .65rem) 0 calc(var(--arrow-tip) + .65rem);
  color: var(--text-muted);
  text-decoration: none !important;
  font-size: .82rem; white-space: nowrap;
  transition: color var(--transition-fast);
}
.stepper-step-wrap:first-of-type .stepper-step { padding-left: .85rem; }
.stepper-step:hover { color: var(--text-primary); }
.stepper-step-wrap.active .stepper-step { color: var(--stepper-color); font-weight: 600; }
.stepper-step-num { font-size: .65rem; font-weight: 700; opacity: .6; flex-shrink: 0; }
.stepper-step-wrap.active .stepper-step-num { opacity: 1; }
.stepper-sep { width: 1px; height: 20px; background: var(--border); margin: 0 .65rem; flex-shrink: 0; }

.stepper-add-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  height: var(--arrow-h); padding: 0 1rem;
  margin-left: auto; flex-shrink: 0;
  border-radius: var(--radius-btn);
  background: var(--stepper-color);
  color: #111 !important;
  font-size: .8rem; font-weight: 700;
  text-decoration: none !important;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}
.stepper-add-btn:hover { filter: brightness(1.1); box-shadow: 0 0 10px var(--stepper-color-shadow); }

.stepper-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-btn);
  background: var(--stepper-color-muted);
  border: 1px solid var(--stepper-color);
  color: var(--stepper-color);
  text-decoration: none !important;
  font-size: .95rem; font-weight: 700;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  flex-shrink: 0; margin-right: .75rem;
}
.stepper-info-btn:hover { box-shadow: 0 0 10px var(--stepper-color-shadow); filter: brightness(1.2); }

.stepper-rejected {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .7rem;
  border-radius: .4rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none !important;
  font-size: .78rem;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}
.stepper-rejected:hover { color: var(--badge-rejected-color); border-color: rgba(239,68,68,.4); }
.stepper-rejected.active { color: var(--badge-rejected-color); border-color: rgba(239,68,68,.5); background: var(--badge-rejected-bg); }


/* ══════════════════════════════════════════════════
   DETAIL PAGE (glosowania/szczegoly)
   ══════════════════════════════════════════════════ */
.detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }

.detail-header { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.detail-header-top { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .65rem; flex-wrap: wrap; }
.detail-num { font-size: .72rem; color: var(--text-muted); font-weight: 600; padding-top: 3px; flex-shrink: 0; }
.detail-title { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); flex: 1; line-height: 1.3; }
.detail-nav { display: flex; gap: .35rem; flex-shrink: 0; }
.detail-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: .4rem; border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none !important; font-size: .8rem;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.detail-nav-btn:hover { color: var(--text-primary); border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.04); }
.detail-nav-btn.disabled { opacity: .3; pointer-events: none; }

.detail-meta { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--text-muted); flex-wrap: wrap; }
.detail-meta-sep { opacity: .35; }
.detail-author-link { display: inline-flex; align-items: center; gap: .3rem; text-decoration: none !important; border-radius: .3rem; padding: 1px 5px 1px 1px; margin: -1px -5px -1px -1px; transition: background var(--transition-fast); }
.detail-author-link:hover { background: rgba(255,255,255,.07); }
.detail-author-avatar { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #111; font-size: .58rem; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.detail-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.detail-author-name { color: rgba(232,234,240,.75); font-weight: 500; }
.detail-author-link:hover .detail-author-name { color: var(--text-primary); }

.detail-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 1rem 1.25rem; margin-bottom: .75rem; }
.detail-section-label { font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .5rem; }
.detail-section-label i { color: var(--accent); margin-right: .25rem; }
.detail-section-text { font-size: .9rem; color: var(--text-primary); line-height: 1.65; }
.detail-subsection { padding: .85rem 0; border-bottom: 1px solid var(--border); }
.detail-subsection:first-child { padding-top: 0; }
.detail-subsection:last-child  { padding-bottom: 0; border-bottom: none; }

.args-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: .75rem; }
@media (max-width: 640px) { .args-grid { grid-template-columns: 1fr; } }
.args-col-header { font-size: 1rem; font-weight: 700; margin-bottom: .85rem; display: flex; align-items: center; gap: .45rem; }
.args-col-header.for    { color: var(--badge-approved-color); }
.args-col-header.against { color: var(--badge-rejected-color); }
.args-col-header .col-icon { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 900; flex-shrink: 0; }
.args-col-header.for    .col-icon { border: 2px solid var(--badge-approved-color); color: var(--badge-approved-color); }
.args-col-header.against .col-icon { border: 2px solid var(--badge-rejected-color); color: var(--badge-rejected-color); }

.arg-card { background: var(--bg-card); border: 1px solid var(--border); border-left-width: 3px; border-radius: .55rem; padding: .85rem 1rem; margin-bottom: .6rem; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.arg-card.for    { border-left-color: var(--badge-approved-color); }
.arg-card.against { border-left-color: var(--badge-rejected-color); }
.arg-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.25); }

.arg-card-author { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; text-decoration: none !important; }
.arg-card-author:hover .arg-author-name { color: var(--accent); }
.arg-author-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #111; font-size: .6rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.arg-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.arg-author-info { display: flex; align-items: baseline; gap: .45rem; flex: 1; min-width: 0; }
.arg-author-name { font-size: .82rem; font-weight: 600; color: var(--text-primary); transition: color var(--transition-fast); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arg-author-date { font-size: .68rem; color: var(--text-muted); margin-left: auto; white-space: nowrap; flex-shrink: 0; }
.arg-card-content { font-size: .85rem; color: var(--text-primary); line-height: 1.6; margin-bottom: .5rem; }
.arg-card-footer { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; padding-top: .45rem; border-top: 1px solid var(--border); }
.arg-edit-btn { font-size: .72rem; padding: 2px 8px; border-radius: .3rem; border: 1px solid var(--border); color: var(--text-muted); text-decoration: none !important; background: transparent; transition: color var(--transition-fast), border-color var(--transition-fast); }
.arg-edit-btn:hover { color: var(--text-primary); border-color: rgba(255,255,255,.2); }
.arg-edit-btn.danger:hover { color: var(--badge-rejected-color); border-color: rgba(239,68,68,.4); }
.args-empty { color: var(--text-muted); font-size: .82rem; font-style: italic; padding: .5rem 0; }

.arg-add-toggle { display: inline-flex; align-items: center; gap: .35rem; margin-top: .25rem; padding: .38rem .8rem; border-radius: var(--radius-btn); border: 1px dashed var(--border); background: transparent; color: var(--text-muted); font-size: .8rem; cursor: pointer; transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast); width: 100%; justify-content: center; }
.arg-add-toggle.for:hover    { color: var(--badge-approved-color); border-color: rgba(0,188,140,.5); background: var(--badge-approved-bg); }
.arg-add-toggle.against:hover { color: var(--badge-rejected-color); border-color: rgba(239,68,68,.45); background: var(--badge-rejected-bg); }

.arg-inline-form { margin-top: .6rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: .55rem; padding: .85rem 1rem; display: none; }
.arg-inline-form.visible { display: block; }
.arg-inline-form textarea { width: 100%; background: var(--bg-base); border: 1px solid var(--border); border-radius: .4rem; color: var(--text-primary); padding: .5rem .7rem; font-size: .85rem; resize: vertical; min-height: 80px; margin-bottom: .55rem; }
.arg-inline-form textarea:focus { outline: none; border-color: var(--accent); }
.arg-inline-submit { display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .85rem; border-radius: .4rem; border: none; font-size: .82rem; font-weight: 600; cursor: pointer; transition: background var(--transition-fast); }
.arg-inline-submit.for    { background: var(--badge-approved-bg); color: var(--badge-approved-color); }
.arg-inline-submit.for:hover    { filter: brightness(1.2); }
.arg-inline-submit.against { background: var(--badge-rejected-bg); color: var(--badge-rejected-color); }
.arg-inline-submit.against:hover { filter: brightness(1.2); }

.sidebar-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 1rem 1.1rem; margin-bottom: .75rem; }
.sidebar-card-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: .75rem; display: flex; align-items: center; gap: .3rem; }
.sidebar-card-title i { color: var(--accent); }

.detail-status-badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; padding: .35rem .85rem; border-radius: var(--radius-badge); margin-bottom: .85rem; }
.detail-status-badge.s1 { background: var(--badge-proposition-bg); color: var(--badge-proposition-color); border: 1px solid rgba(59,130,246,.3); }
.detail-status-badge.s2 { background: var(--badge-discussion-bg);  color: var(--badge-discussion-color);  border: 1px solid rgba(168,85,247,.3); }
.detail-status-badge.s3 { background: var(--badge-referendum-bg);  color: var(--badge-referendum-color);  border: 1px solid rgba(249,115,22,.3); }
.detail-status-badge.s4 { background: var(--badge-rejected-bg);    color: var(--badge-rejected-color);    border: 1px solid rgba(239,68,68,.3); }
.detail-status-badge.s5 { background: var(--badge-approved-bg);    color: var(--badge-approved-color);    border: 1px solid rgba(0,188,140,.3); }

.detail-info-row { display: flex; justify-content: space-between; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--border); font-size: .8rem; }
.detail-info-row:last-child { border-bottom: none; }
.detail-info-key { color: var(--text-muted); }
.detail-info-val { color: var(--text-primary); font-weight: 500; text-align: right; }

.action-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; width: 100%; padding: .55rem 1rem; border-radius: .5rem; font-size: .85rem; font-weight: 600; border: none; cursor: pointer; text-decoration: none !important; transition: background var(--transition-fast), box-shadow var(--transition-fast); margin-bottom: .4rem; }
.action-btn-sign    { background: var(--accent); color: #111 !important; }
.action-btn-sign:hover { background: var(--accent-hover); box-shadow: 0 0 10px var(--accent-glow); }
.action-btn-withdraw { background: transparent; color: var(--badge-rejected-color) !important; border: 1px solid rgba(239,68,68,.4); }
.action-btn-withdraw:hover { background: var(--badge-rejected-bg); border-color: var(--badge-rejected-color); }
.action-btn-yes  { background: var(--badge-approved-bg); color: var(--badge-approved-color) !important; border: 1px solid rgba(0,188,140,.4); }
.action-btn-yes:hover  { filter: brightness(1.2); }
.action-btn-no   { background: var(--badge-rejected-bg); color: var(--badge-rejected-color) !important; border: 1px solid rgba(239,68,68,.3); }
.action-btn-no:hover   { filter: brightness(1.2); }
.action-btn-edit { background: transparent; color: var(--text-muted) !important; border: 1px solid var(--border); font-weight: 500; }
.action-btn-edit:hover { color: var(--text-primary) !important; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.04); }


/* ══════════════════════════════════════════════════
   VOTE RESULTS (glosowania/szczegoly)
   ══════════════════════════════════════════════════ */
.result-bar { margin-bottom: .65rem; }
.result-bar-labels { display: flex; justify-content: space-between; font-size: .75rem; margin-bottom: .25rem; }
.result-bar-track { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.result-bar-fill  { height: 100%; border-radius: 3px; background: var(--accent); transition: width .4s ease; }
.voters-list  { font-size: .78rem; color: var(--text-muted); line-height: 1.8; }
.protocol-list { font-size: .75rem; color: var(--text-muted); font-family: monospace; max-height: 160px; overflow-y: auto; line-height: 1.7; }
.protocol-yes { color: var(--badge-approved-color); }
.protocol-no  { color: var(--badge-rejected-color); }

/* Task priority badges */
.badge-critical   { background: var(--badge-rejected-bg);   color: var(--badge-rejected-color); }
.badge-important  { background: var(--badge-referendum-bg);  color: var(--badge-referendum-color); }
.badge-beneficial { background: var(--badge-approved-bg);    color: var(--badge-approved-color); }


/* ══════════════════════════════════════════════════
   TASKS
   ══════════════════════════════════════════════════ */
.tasks-empty { display: flex; flex-direction: column; align-items: center; padding: 3rem 1rem; color: var(--text-muted); gap: .55rem; text-align: center; }
.tasks-section-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); padding: .5rem 0 .3rem; display: flex; align-items: center; gap: .35rem; margin-top: .35rem; }
.tasks-section-label i { color: var(--badge-proposition-color); }
.tasks-section-label:first-child { margin-top: 0; }

.task-assignee-row { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--text-muted); flex-wrap: wrap; }
.task-assignee-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.task-assignee-avatar { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(168,85,247,.25); color: var(--badge-discussion-color); font-size: .6rem; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.task-assignee-avatar img { width: 100%; height: 100%; object-fit: cover; }
.task-assignee-name { color: var(--text-primary); font-weight: 500; }

.task-vote-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.task-vote-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .28rem .7rem; border-radius: .4rem; border: 1px solid var(--border); background: transparent; font-size: .78rem; cursor: pointer; transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast); }
.task-vote-btn.up { color: var(--badge-approved-color); }
.task-vote-btn.up.active-vote { background: var(--badge-approved-bg); border-color: rgba(0,188,140,.4); }
.task-vote-btn.up:hover { border-color: rgba(0,188,140,.4); background: var(--badge-approved-bg); }
.task-vote-btn.down { color: var(--text-muted); }
.task-vote-btn.down.active-vote { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: var(--text-primary); }
.task-vote-btn.down:hover { color: var(--text-primary); border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.04); }

.task-take-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .28rem .7rem; border-radius: .4rem; border: 1px solid rgba(96,165,250,.35); background: rgba(96,165,250,.08); color: var(--badge-proposition-color); font-size: .78rem; font-weight: 500; cursor: pointer; transition: background var(--transition-fast), border-color var(--transition-fast); }
.task-take-btn:hover { background: rgba(96,165,250,.18); border-color: var(--badge-proposition-color); }

.task-resign-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .28rem .7rem; border-radius: .4rem; border: 1px solid rgba(239,68,68,.3); background: transparent; color: var(--badge-rejected-color); font-size: .78rem; font-weight: 500; }

.task-dash-row { border-radius: .35rem; border: 1px solid transparent; padding: 3px 6px; margin: 0 -6px; transition: background var(--transition-fast), border-color var(--transition-fast); }
.task-dash-row:hover { background: var(--accent-muted); border-color: rgba(0,209,178,.35); }
.task-dash-row:hover .task-dash-link { color: var(--accent) !important; }


/* ══════════════════════════════════════════════════
   EMBEDDED CHAT
   ══════════════════════════════════════════════════ */
.ec-section { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1.25rem; }
.ec-section-title { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); display: flex; align-items: center; gap: .45rem; margin-bottom: .5rem; }
.ec-section-title i { color: var(--accent); }
.ec-open-full { margin-left: auto; color: var(--text-muted); font-size: .75rem; text-decoration: none !important; transition: color var(--transition-fast); }
.ec-open-full:hover { color: var(--accent); }
.ec-breadcrumb { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; padding: .25rem .5rem; background: var(--bg-card); border-radius: .35rem; border-left: 3px solid var(--accent); }
.ec-wrapper { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; background: var(--bg-card); }
.ec-messages { max-height: 400px; overflow-y: auto; padding: .5rem .6rem; scroll-behavior: smooth; }
.ec-messages::-webkit-scrollbar { width: 4px; }
.ec-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.ec-loading { color: var(--text-muted); font-size: .82rem; text-align: center; padding: 1rem 0; }
.ec-input-area { border-top: 1px solid var(--border); padding: .5rem; background: var(--bg-card); display: flex; flex-direction: column; gap: .1rem; }
.ec-input-area .message-input-rich { min-height: 4rem; max-height: 120px; }


/* ══════════════════════════════════════════════════
   ACTIVITY FEED
   ══════════════════════════════════════════════════ */
.activity-list .feed-row { display: flex; align-items: flex-start; gap: .75rem; padding: .6rem .75rem; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; transition: background .12s, border-color .12s; position: relative; }
.activity-list .feed-row:last-child { border-bottom: none; }
.activity-list .feed-row:hover { background: var(--accent-muted); border-color: rgba(0,209,178,.25); }
.activity-list .feed-row:hover .feed-title { color: var(--accent); }
.feed-title { font-size: .875rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .12s; }
.feed-desc  { font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-list.view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; padding: .75rem; }
.activity-list.view-grid .feed-row { border: 1px solid var(--border); border-radius: .4rem; flex-direction: column; align-items: flex-start; gap: .4rem; }
.activity-list.view-grid .feed-row:hover { border-color: rgba(0,209,178,.35); }
.activity-list.view-grid .feed-title { white-space: normal; }
.activity-list.view-grid .feed-desc  { white-space: normal; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }


/* ══════════════════════════════════════════════════
   WSPOLNOTA
   ══════════════════════════════════════════════════ */
.wspol-stat-icon { width: 40px; height: 40px; border-radius: .55rem; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.wspol-stat-icon.accent   { background: var(--accent-muted); color: var(--accent); }
.wspol-stat-icon.warning  { background: rgba(243,156,18,.12); color: #f39c12; }
.wspol-stat-icon.success  { background: var(--badge-approved-bg); color: var(--badge-approved-color); }
.wspol-stat-icon.blue     { background: rgba(96,165,250,.12); color: var(--badge-proposition-color); }
.wspol-stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.wspol-stat-label { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }
.wspol-section-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; margin-bottom: .85rem; }
.wspol-section-title i { color: var(--accent); }
.wspol-member-row { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.wspol-member-row:last-child { border-bottom: none; }
.wspol-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-muted); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.wspol-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wspol-member-name { font-size: .875rem; color: var(--accent); font-weight: 500; }
.wspol-member-meta { font-size: .75rem; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.finance-row { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.finance-row:last-child { border-bottom: none; }
.finance-label { font-size: .82rem; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; }
.finance-value { font-size: .9rem; font-weight: 600; }
.finance-value.inc { color: var(--badge-approved-color); }
.finance-value.exp { color: var(--badge-rejected-color); }
.finance-value.bal { color: var(--text-primary); font-size: 1.1rem; }
.cal-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal-table th { text-align: center; font-size: .7rem; color: var(--text-muted); font-weight: 500; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.cal-table td { height: 52px; vertical-align: top; text-align: center; border: 1px solid var(--border); padding: .25rem; }
.cal-day { font-size: .82rem; color: var(--text-muted); }
.cal-day.today { background: var(--accent); color: #111; font-weight: 700; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.cal-day.has-event { color: var(--accent); font-weight: 600; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: inline-block; margin-top: 2px; }
.asset-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--text-muted); padding: .2rem .55rem; border-radius: var(--radius-badge); border: 1px solid var(--border); background: transparent; }
.asset-chip strong { color: var(--text-primary); }
.chat-msg-row { border-radius: .35rem; border: 1px solid transparent; padding: 5px 6px; margin: 0 -6px; transition: background var(--transition-fast), border-color var(--transition-fast); cursor: pointer; }
.chat-msg-row:hover { background: var(--accent-muted); border-color: rgba(0,209,178,.35); }
.chat-msg-row:hover .chat-msg-link { color: var(--accent) !important; }
.chat-msg-link { font-size: .82rem; color: var(--text-primary); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; transition: color var(--transition-fast); }
.chat-msg-meta   { font-size: .72rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.chat-msg-sender { font-size: .75rem; color: var(--accent); font-weight: 600; flex-shrink: 0; }
.chat-msg-room   { font-size: .7rem; color: var(--text-muted); flex-shrink: 0; }
