/* assets/style.css — Panem Dev. Графітова тема з пшеничним акцентом. */

:root {
  --bg: #14161d;
  --surface: #1b1e27;
  --elevated: #222634;
  --border: #2c3040;
  --ink: #e9ebf3;
  --muted: #8b90a5;
  --wheat: #e8a33d;
  --wheat-soft: rgba(232, 163, 61, .14);
  --blue: #4d9fff;
  --green: #3fcf8e;
  --red: #ef6461;
  --violet: #c96de0;
  --radius: 10px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* Світла тема */
html[data-theme="light"] {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --elevated: #eef0f5;
  --border: #dcdfe8;
  --ink: #23262f;
  --muted: #6b7085;
  --wheat: #c67c14;
  --wheat-soft: rgba(198, 124, 20, .12);
  --blue: #2f7fe0;
  --green: #1fa971;
  --red: #d94b48;
  --violet: #a24bc0;
  --shadow: 0 10px 30px rgba(30, 40, 60, .14);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 800; }
a { color: var(--wheat); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--font-mono); font-size: .85em; letter-spacing: .02em; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, [tabindex]:focus-visible, a:focus-visible {
  outline: 2px solid var(--wheat);
  outline-offset: 1px;
}
input.overdue { border-color: var(--red); color: var(--red); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
label input, label select, label textarea { margin-top: 5px; }
textarea { resize: vertical; }
::placeholder { color: #5c6175; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------ кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--elevated); border: 1px solid var(--border);
  color: var(--ink); border-radius: 8px; padding: 8px 14px;
  font-weight: 600; font-size: 13.5px; transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: #2a2f40; }
.btn-primary { background: var(--wheat); border-color: var(--wheat); color: #201607; }
.btn-primary:hover { background: #f0b155; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #f0807d; }
.btn-danger-ghost { color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--elevated); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn .icon { width: 15px; height: 15px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; gap: 8px; margin-top: 8px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none;
  background: transparent; border: none; border-radius: 7px; color: var(--muted);
  transition: background .15s, color .15s; position: relative;
}
.icon-btn:hover { background: var(--elevated); color: var(--ink); }
.icon { width: 16px; height: 16px; flex: none; }

/* ------------------------------------------------ каркас ---------- */
.shell { display: flex; height: 100vh; }
.sidebar {
  width: 232px; flex: none; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 6px 16px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--wheat), #c77f1c);
  color: #201607; font: 800 17px/30px var(--font-display); text-align: center;
}
.brand-name { font: 800 16.5px var(--font-display); letter-spacing: -.01em; }
.brand-name em { font-style: normal; color: var(--wheat); }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 4px 6px 5px; }
.company-row { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; }
.company-row select { background: var(--bg); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; color: var(--muted);
  font-weight: 600; font-size: 13.5px;
}
.nav-item:hover { background: var(--elevated); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--wheat-soft); color: var(--wheat); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); padding-top: 12px; }
.side-user { display: flex; align-items: center; gap: 9px; flex: 1; padding: 6px 8px; border-radius: 8px; color: var(--ink); min-width: 0; }
.side-user:hover { background: var(--elevated); text-decoration: none; }
.side-user.active { background: var(--wheat-soft); }
.side-user-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: relative;
}
.content { flex: 1; overflow: auto; padding: 22px; }

/* ------------------------------------------------ аватари --------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; font-weight: 700; flex: none;
}
.avatar-md { width: 34px; height: 34px; font-size: 13px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-xs { width: 22px; height: 22px; font-size: 9.5px; }
.avatar-empty { background: var(--elevated); color: var(--muted); }

/* ------------------------------------------------ пошук ----------- */
.search-wrap { position: relative; flex: 1; max-width: 460px; display: flex; align-items: center; }
.search-ico { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
#global-search { padding-left: 34px; background: var(--bg); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 380px; overflow: auto;
}
.search-row {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 12px; background: none; border: none; border-bottom: 1px solid var(--border);
  text-align: left; font-size: 13px;
}
.search-row:last-child { border-bottom: none; }
.search-row:hover { background: var(--wheat-soft); }
.search-row .muted { margin-left: auto; font-size: 12px; flex: none; }
.search-row span:not(.mono):not(.muted) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------ сповіщення ------ */
.bell { width: 36px; height: 36px; }
.badge {
  position: absolute; top: 2px; right: 0;
  background: var(--red); color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 1; padding: 3px 5px;
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 25%; width: 384px; z-index: 70;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.notif-head b { font-size: 14.5px; }
.notif-head-actions { display: flex; align-items: center; gap: 4px; }
.notif-scroll { max-height: 62vh; overflow-y: auto; }
.notif-row {
  display: flex; align-items: baseline; gap: 10px; width: 100%;
  background: none; border: none; border-bottom: 1px solid var(--border);
  padding: 12px 16px; text-align: left; font-size: 13px; line-height: 1.45;
}
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--wheat-soft); }
.notif-row .muted { flex: none; font-size: 11.5px; margin-left: auto; white-space: nowrap; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; flex: none; align-self: center; }
.notif-row.unread .notif-dot { background: var(--wheat); }
.notif-row.unread .notif-text { font-weight: 600; }
.notif-text { min-width: 0; }
.notif-all { display: block; text-align: center; padding: 12px; font-weight: 600; font-size: 13px; color: var(--wheat); border-top: 1px solid var(--border); }
.notif-all:hover { background: var(--wheat-soft); }
.notif-page .notif-row { border-radius: 0; }

/* ------------------------------------------------ сторінки -------- */
.page-head { margin-bottom: 20px; }
.page-head.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-sub { color: var(--muted); margin: 5px 0 0; font-size: 13.5px; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.panel-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-state .icon { width: 34px; height: 34px; color: var(--wheat); margin-bottom: 10px; }
.empty-state h3 { color: var(--ink); margin-bottom: 6px; }
.empty-state .btn { margin-top: 14px; }
.empty-note { color: var(--muted); font-size: 13.5px; }
.hint { color: var(--muted); font-size: 12.5px; margin: -4px 0 12px; }

/* ------------------------------------------------ дашборд --------- */
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-num { font: 800 26px var(--font-display); }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tone-wheat .stat-num { color: var(--wheat); }
.tone-red .stat-num { color: var(--red); }

.prio-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.prio-label { width: 74px; flex: none; font-size: 13px; color: var(--muted); }
.prio-track { flex: 1; height: 7px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.prio-fill { height: 100%; border-radius: 99px; transition: width .3s; }
.prio-num { width: 44px; text-align: right; font-family: var(--font-mono); font-size: 12px; color: var(--muted); flex: none; }

.proj-progress {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 6px; border-radius: 8px; color: var(--ink); font-size: 13.5px;
}
.proj-progress:hover { background: var(--elevated); text-decoration: none; }
.proj-progress .proj-name { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.activity-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; border-bottom: 1px solid var(--border);
  padding: 9px 4px; text-align: left; font-size: 13px;
}
.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: var(--elevated); }
.activity-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.activity-time { margin-left: auto; flex: none; color: var(--muted); font-size: 11.5px; }

/* ------------------------------------------------ проєкти --------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.proj-card {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--pc, var(--wheat));
  border-radius: var(--radius); transition: transform .15s, border-color .15s;
  display: block; color: var(--ink);
}
.proj-card:hover { transform: translateY(-2px); text-decoration: none; }
.proj-card-body { display: block; padding: 16px; color: var(--ink); }
.proj-card-body:hover { text-decoration: none; }
.proj-card-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.proj-key { color: var(--pc, var(--wheat)); font-weight: 600; }
.proj-team { color: var(--muted); font-size: 12px; }
.proj-desc { color: var(--muted); font-size: 13px; margin: 6px 0 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.proj-meta { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.proj-meta .icon { width: 13px; height: 13px; }
.proj-card-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.proj-card:hover .proj-card-actions, .proj-card:focus-within .proj-card-actions { opacity: 1; }
.team-card .role-badge { margin-top: 12px; display: inline-block; }

.role-badge {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px;
  background: var(--elevated); color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
}
.role-admin { background: var(--wheat-soft); color: var(--wheat); }
.role-manager { background: rgba(77, 159, 255, .15); color: var(--blue); }
.role-executor { background: rgba(63, 207, 142, .14); color: var(--green); }
.role-supervisor { background: rgba(201, 109, 224, .15); color: var(--violet); }

/* ------------------------------------------------ дошка ----------- */
.board-head { margin-bottom: 6px; }
.board-title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.crumb { color: var(--muted); font-size: 13px; }
.crumb-sep { color: var(--muted); }
.team-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; background: var(--elevated); border-radius: 99px; padding: 4px 10px; }
.team-tag .icon { width: 13px; height: 13px; }

.board-tabs { display: flex; align-items: center; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
.board-tab {
  padding: 6px 13px; border-radius: 8px; font-weight: 600; font-size: 13px;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border);
}
.board-tab:hover { color: var(--ink); text-decoration: none; }
.board-tab.active { background: var(--wheat-soft); border-color: transparent; color: var(--wheat); }
.board-tab.ghost { background: transparent; border-style: dashed; }

.board-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.board-filters select { width: auto; padding: 7px 9px; font-size: 13px; background: var(--surface); }
.filter-search { position: relative; display: flex; align-items: center; }
.filter-search .icon { position: absolute; left: 9px; color: var(--muted); width: 14px; height: 14px; pointer-events: none; }
.filter-search input { width: 200px; padding: 7px 9px 7px 30px; font-size: 13px; background: var(--surface); }

.board-scroll { overflow-x: auto; padding-bottom: 12px; }
.board { display: flex; gap: 13px; align-items: flex-start; min-height: 62vh; }
/* Дошка займає всю доступну висоту, а картки прокручуються всередині колонки */
.content:has(.board-scroll) { display: flex; flex-direction: column; overflow: hidden; }
.content:has(.board-scroll) .board-head { flex: none; }
.content:has(.board-scroll) .board-scroll { flex: 1; overflow: auto; min-height: 0; }
.content:has(.board-scroll) .board { min-height: 0; height: 100%; }
.content:has(.board-scroll) .column { max-height: 100%; }
.column {
  width: 288px; flex: none; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  max-height: calc(100vh - 250px);
}
.column-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px; }
.column-head h3 { font-size: 13.5px; font-weight: 700; }
.column-tick { width: 8px; height: 8px; border-radius: 3px; background: var(--cc, var(--muted)); flex: none; }
.column-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); background: var(--bg); border-radius: 99px; padding: 2px 8px; }
.column-menu-wrap { margin-left: auto; }
.column-body { flex: 1; overflow-y: auto; padding: 3px 9px 9px; display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.column-body.drop-over { background: var(--wheat-soft); border-radius: 0 0 var(--radius) var(--radius); }
.add-task-btn, .add-column-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: none; border: none; color: var(--muted);
  padding: 10px; font-weight: 600; font-size: 13px; border-radius: 0 0 var(--radius) var(--radius);
}
.add-task-btn:hover { color: var(--wheat); background: var(--wheat-soft); }
.add-column-btn {
  width: 250px; flex: none; border: 1px dashed var(--border); border-radius: var(--radius); padding: 14px;
}
.add-column-btn:hover { color: var(--wheat); border-color: var(--wheat); }

.task-card {
  background: var(--elevated); border: 1px solid var(--border); border-radius: 9px;
  padding: 11px 12px; cursor: pointer; transition: border-color .15s, transform .1s;
}
.task-card:hover { border-color: #3d425a; }
.task-card.dragging { opacity: .45; }
.card-labels { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 7px; }
.label-chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.label-chip.big { font-size: 12.5px; padding: 4px 10px; display: inline-flex; align-items: center; gap: 5px; margin: 0 6px 6px 0; }
.chip-x { background: none; border: none; color: inherit; font-size: 14px; padding: 0; line-height: 1; opacity: .7; }
.chip-x:hover { opacity: 1; }
.card-title { font-size: 13.5px; font-weight: 600; font-family: var(--font-body); line-height: 1.35; }
.card-meta { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.card-key { color: var(--muted); }
.prio-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.card-deadline, .card-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--muted);
}
.card-deadline .icon, .card-chip .icon { width: 12px; height: 12px; }
.card-deadline.overdue { color: var(--red); font-weight: 700; }
.card-avatar { margin-left: auto; }

/* ------------------------------------------------ мої задачі ------ */
.my-table { display: flex; flex-direction: column; gap: 7px; }
.my-row {
  display: grid; grid-template-columns: 74px 1fr 150px 14px 92px 130px 190px;
  gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  padding: 11px 14px; text-align: left; font-size: 13.5px;
}
.my-row:hover { border-color: #3d425a; }
.my-row.row-overdue { border-left: 3px solid var(--red); }
.my-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.my-deadline { font-size: 12.5px; color: var(--muted); }
.my-deadline.overdue { color: var(--red); font-weight: 700; }
.my-relation { font-size: 12px; color: var(--muted); }
.my-project { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------ команда --------- */
.member-row { display: flex; align-items: center; gap: 11px; padding: 8px 2px; border-bottom: 1px solid var(--border); }
.proj-members-list { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.proj-members-list .member-row:last-child { border-bottom: none; }
.member-row:last-child { border-bottom: none; }
.member-row.pending { opacity: .8; }
.member-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.member-info b { font-size: 13.5px; }
.member-info .muted { font-size: 12px; }
.member-row select { width: 170px; flex: none; padding: 6px 8px; font-size: 12.5px; }
.inline-add { display: flex; gap: 7px; align-items: center; margin-top: 8px; }
.inline-add input { flex: 1; }
.inline-add select { width: 56px; flex: none; }
.inline-add .btn { flex: none; }

/* ------------------------------------------------ модалки --------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 12, 18, .66);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 24px; overflow-y: auto;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow);
  width: 100%; max-width: 460px; padding: 18px 20px 20px;
  animation: pop .16s ease-out;
}
.modal-wide { max-width: 880px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.modal-head h3 { flex: 1; font-size: 16.5px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.confirm-text { margin: 0 0 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.swatch input { position: absolute; opacity: 0; width: 0; }
.swatch span { display: block; width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg); }
.swatch input:focus-visible + span { outline: 2px solid var(--wheat); outline-offset: 2px; }

.label-picker { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.watcher-picker { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 180px; overflow-y: auto; }
.watcher-picker .label-check { display: block; }
.watcher-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 4px 8px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; width: 100%; }
.watcher-picker .label-check input { position: absolute; opacity: 0; width: 0; }
.watcher-picker .label-check input:checked + .watcher-chip { background: var(--wheat-soft); border-color: var(--wheat); color: var(--ink); }
.watcher-chip:hover { background: var(--elevated); }
.label-check input { position: absolute; opacity: 0; width: 0; }
.label-check .label-chip { cursor: pointer; opacity: .75; border: 1px solid transparent; }
.label-check input:checked + .label-chip { opacity: 1; border-color: currentColor; }
.label-check input:focus-visible + .label-chip { outline: 2px solid var(--wheat); }
.label-check input:disabled + .label-chip { cursor: default; }

/* ------------------------------------------------ картка задачі --- */
.task-head { border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.task-key { font-weight: 700; font-size: 13px; }
.task-proj { color: var(--muted); font-size: 13px; }
.task-grid { display: grid; grid-template-columns: 1fr 250px; gap: 22px; margin-top: 14px; }
.task-title { font-size: 20px; line-height: 1.3; cursor: default; display: flex; align-items: baseline; gap: 8px; }
.task-title[data-action] { cursor: pointer; }
.title-pencil { opacity: 0; width: 14px; height: 14px; color: var(--muted); transition: opacity .15s; flex: none; }
.task-title:hover .title-pencil { opacity: 1; }
.title-edit { display: flex; gap: 8px; align-items: center; }
.title-edit input { font-size: 17px; font-weight: 700; }
.title-edit .btn { flex: none; }

.task-section { margin-top: 18px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 9px; }
.task-desc { font-size: 14px; line-height: 1.6; border-radius: 8px; }
.task-desc.editable { cursor: pointer; padding: 8px; margin: -8px; }
.task-desc.editable:hover { background: var(--elevated); }

.subtask-track { margin-bottom: 10px; }
.subtasks { list-style: none; margin: 0; padding: 0; }
.subtask { display: flex; align-items: center; gap: 6px; padding: 5px 0; }
.subtask-check { display: flex; align-items: center; gap: 9px; margin: 0; flex: 1; color: var(--ink); font-size: 13.5px; cursor: pointer; }
.subtask-check input { width: 15px; height: 15px; accent-color: var(--green); margin: 0; flex: none; }
.subtask.done .subtask-check span { text-decoration: line-through; color: var(--muted); }
.subtask-actions { display: flex; opacity: 0; transition: opacity .15s; }
.subtask:hover .subtask-actions, .subtask:focus-within .subtask-actions { opacity: 1; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: none; padding: 9px 13px;
  color: var(--muted); font-weight: 600; font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--wheat); border-bottom-color: var(--wheat); }
.tab-count { background: var(--elevated); border-radius: 99px; padding: 1px 7px; font-size: 11px; }
.task-tabs { margin-top: 22px; }
.tab-body { padding-top: 14px; }
.auth-form .tabs, .auth-card .tabs { border-bottom: none; gap: 8px; margin-bottom: 16px; }
.auth-card .tab { flex: 1; justify-content: center; background: var(--elevated); border-radius: 8px; border-bottom: none; margin-bottom: 0; padding: 9px; }
.auth-card .tab.active { background: var(--wheat-soft); color: var(--wheat); }

.comments { display: flex; flex-direction: column; gap: 13px; }
.comment { display: flex; gap: 10px; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.comment-head .muted { font-size: 11.5px; }
.comment-head .icon-btn { width: 24px; height: 24px; opacity: 0; }
.comment:hover .comment-head .icon-btn { opacity: 1; }
.comment-head .icon-btn .icon { width: 13px; height: 13px; }
.comment-text { margin: 3px 0 0; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; word-break: break-word; }
.comment-text a, .task-desc a { color: var(--wheat); text-decoration: underline; overflow-wrap: anywhere; }
.comment-text a:hover, .task-desc a:hover { color: #f0b155; }
.task-desc { overflow-wrap: anywhere; word-break: break-word; }
.rte-content ul, .rte-content ol { margin: 6px 0; padding-left: 22px; }
.rte-content li { margin: 2px 0; }
.rte-content p { margin: 6px 0; }
.rte-toolbar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; background: var(--elevated); border: 1px solid var(--border); border-bottom: none; border-radius: 8px 8px 0 0; padding: 5px 6px; }
.rte-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 6px; background: transparent; border: none; border-radius: 6px; color: var(--muted); font-size: 13px; }
.rte-btn:hover { background: var(--bg); color: var(--ink); }
.rte-btn .icon { width: 15px; height: 15px; }
.rte-sep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; }
.rte-editor { min-height: 120px; max-height: 340px; overflow-y: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 0 0 8px 8px; padding: 10px 12px; font-size: 14px; line-height: 1.6; outline: none; }
.rte-editor:focus { border-color: var(--wheat); }
.rte-editor ul, .rte-editor ol { margin: 6px 0; padding-left: 22px; }
.rte-editor a { color: var(--wheat); }
.comment-form { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.comment-form textarea { width: 100%; }
.comment-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.comment-image-preview { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); background: var(--elevated); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.comment-image-preview .icon { width: 15px; height: 15px; }
.comment-image-preview span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-image { max-width: 260px; max-height: 220px; border-radius: 8px; margin-top: 6px; display: block; border: 1px solid var(--border); }
.comment-file { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; background: var(--elevated); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 13px; text-decoration: none; }
.comment-file:hover { border-color: var(--wheat); }
.comment-file .icon { width: 15px; height: 15px; }
.comment.editing { flex-direction: column; }

.files { display: flex; flex-direction: column; gap: 9px; }
.file-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--elevated); border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px;
}
.file-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 7px; flex: none; }
.file-ico { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 7px; color: var(--muted); flex: none; }
.file-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-info a { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info .muted { font-size: 11.5px; }
.upload-row { display: flex; align-items: center; gap: 10px; margin-top: 13px; }

.history { list-style: none; margin: 0; padding: 0; }
.history-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.history-row:last-child { border-bottom: none; }
.history-text { min-width: 0; }
.history-row .muted { margin-left: auto; flex: none; font-size: 11.5px; }

.task-side { border-left: 1px solid var(--border); padding-left: 20px; }
.side-field { margin-bottom: 13px; font-size: 12.5px; }
.side-meta { margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }

/* ------------------------------------------------ авторизація ----- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 30px 28px; box-shadow: var(--shadow);
}
.auth-brand { justify-content: center; padding-bottom: 4px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13.5px; margin: 4px 0 20px; }
.onboard-title { text-align: center; margin-top: 8px; }

/* ------------------------------------------------ тости ----------- */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--elevated); border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: 9px; padding: 11px 16px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .25s; max-width: 360px;
}
.toast.show { opacity: 1; transform: none; }
.toast-err { border-left-color: var(--red); }

/* ------------------------------------------------ спінер ---------- */
.spinner-wrap { display: flex; justify-content: center; padding: 70px; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--wheat);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------ адаптив --------- */
@media (max-width: 960px) {
  .dash-cols { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .task-grid { grid-template-columns: 1fr; }
  .task-side { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; }
  .my-row { grid-template-columns: 64px 1fr 14px 90px; }
  .my-status, .my-relation, .my-project { display: none; }
}
@media (max-width: 720px) {
  .shell { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; }
  .brand { padding: 0; }
  .side-label { display: none; }
  .company-row { margin: 0; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item span { display: none; }
  .side-foot { margin: 0; border: none; padding: 0; margin-left: auto; }
  .side-user-name { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 14px; }
  .notif-panel { right: 8px; left: 8px; width: auto; }
}

/* ---- Аватар-фото ---- */
.avatar.avatar-photo { padding: 0; overflow: hidden; }
.avatar.avatar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Стилізований вибір людей (виконавець / спостерігачі) ---- */
.people-picker { position: relative; margin-top: 6px; }
.people-selected { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; }
.people-selected.is-edit { cursor: pointer; }
.people-selected.is-edit:hover { border-color: var(--wheat); }
.people-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; align-items: center; }
.people-caret { color: var(--muted); display: inline-flex; }
.people-caret .icon { width: 16px; height: 16px; }
.person-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--elevated); border: 1px solid var(--border); border-radius: 20px; padding: 3px 8px 3px 3px; font-size: 12.5px; }
.person-chip-name { font-weight: 600; }
.person-chip-x { display: inline-flex; background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 50%; }
.person-chip-x:hover { background: var(--bg); color: var(--red); }
.person-chip-x .icon { width: 13px; height: 13px; }
.people-drop { position: absolute; z-index: 40; top: calc(100% + 5px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 7px; }
.people-search { width: 100%; margin-bottom: 6px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--ink); font-size: 13px; }
.people-search:focus { outline: none; border-color: var(--wheat); }
.people-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.people-opt { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: transparent; border: none; border-radius: 8px; padding: 7px 9px; cursor: pointer; color: var(--ink); font-size: 13.5px; }
.people-opt:hover { background: var(--elevated); }
.people-opt.on { background: var(--wheat-soft); }
.people-opt-name { flex: 1; }
.people-opt-check { color: var(--wheat); display: inline-flex; }
.people-opt-check .icon { width: 15px; height: 15px; }

/* ---- Завантаження аватара у профілі ---- */
.avatar-edit { display: flex; align-items: center; gap: 16px; margin: 6px 0 14px; }
.avatar-edit .avatar { width: 68px; height: 68px; font-size: 24px; }
.avatar-edit-actions { display: flex; flex-direction: column; gap: 6px; }
