/* Оформление в стиле Taiga UI: светлые поверхности, крупные скругления, мягкие тени, акцент #526ed3, шрифт Manrope. */
:root {
  --primary: #526ed3; --primary-h: #3e5bc7; --primary-soft: rgba(82,110,211,.12); --hover: rgba(82,110,211,.07);
  --bg: #f6f6f6; --panel: #fff; --panel2: #f6f6f8; --text: #1b1f3b; --muted: #6b6e86; --border: #e4e5ea;
  --danger: #e0454b; --danger-soft: rgba(224,69,75,.12); --warn: #ffa94d; --todo: #9aa0b4; --doing: #526ed3; --done: #3aa857;
  --r-s: .5rem; --r-m: .75rem; --r-l: 1rem;
  --shadow: 0 .125rem .5rem rgba(27,31,59,.08); --shadow-l: 0 .25rem 1.5rem rgba(27,31,59,.14); --weekend: rgba(27,31,59,.035);
  --col-bg: rgba(27,31,59,.045); color-scheme: light;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
:root[data-theme="dark"] {
    --primary: #7d94f2; --primary-h: #9aacf6; --primary-soft: rgba(125,148,242,.18); --hover: rgba(125,148,242,.1);
    --bg: #191a1f; --panel: #24252b; --panel2: #2c2d34; --text: #f2f3f7; --muted: #a3a6b8; --border: #3a3b44;
    --danger: #ff7a80; --danger-soft: rgba(255,122,128,.16); --todo: #7b7f93; --doing: #7d94f2; --done: #56c27a;
    --shadow: 0 .125rem .5rem rgba(0,0,0,.4); --shadow-l: 0 .25rem 1.5rem rgba(0,0,0,.55); --weekend: rgba(255,255,255,.035);
    --col-bg: rgba(255,255,255,.05); color-scheme: dark;
  }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --primary: #7d94f2; --primary-h: #9aacf6; --primary-soft: rgba(125,148,242,.18); --hover: rgba(125,148,242,.1);
    --bg: #191a1f; --panel: #24252b; --panel2: #2c2d34; --text: #f2f3f7; --muted: #a3a6b8; --border: #3a3b44;
    --danger: #ff7a80; --danger-soft: rgba(255,122,128,.16); --todo: #7b7f93; --doing: #7d94f2; --done: #56c27a;
    --shadow: 0 .125rem .5rem rgba(0,0,0,.4); --shadow-l: 0 .25rem 1.5rem rgba(0,0,0,.55); --weekend: rgba(255,255,255,.035);
    --col-bg: rgba(255,255,255,.05); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 14px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; cursor: pointer; transition: color .15s; } a:hover { color: var(--primary-h); text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; } h1 { font-size: 26px; } h2 { font-size: 18px; } h3 { font-size: 14px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .grow { flex: 1; } .hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; } .wrap { flex-wrap: wrap; }
kbd { font: 600 11px var(--font); background: var(--panel2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }

/* ---- поля и кнопки ---- */
input, select, textarea { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid transparent; border-radius: var(--r-m);
  padding: 0 12px; height: 36px; min-width: 0; transition: border-color .15s, background .15s, box-shadow .15s; }
textarea { height: auto; padding: 8px 12px; width: 100%; resize: vertical; min-height: 84px; }
input:hover, textarea:hover, select:hover { border-color: var(--border); background: var(--panel); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); background: var(--panel); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=checkbox] { height: auto; width: 16px; accent-color: var(--primary); cursor: pointer; }
input[type=color] { padding: 2px; width: 40px; cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:disabled, textarea:disabled { opacity: .65; cursor: not-allowed; }
.btn { font: 600 14px var(--font); cursor: pointer; border: 0; background: var(--panel2); color: var(--text); border-radius: var(--r-m); height: 36px;
  padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .1s, color .15s; }
.btn:hover { background: var(--primary-soft); color: var(--primary); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; } .btn.primary:hover { background: var(--primary-h); color: #fff; box-shadow: 0 .25rem .75rem var(--primary-soft); }
.btn.danger { color: var(--danger); background: var(--danger-soft); } .btn.danger:hover { background: var(--danger); color: #fff; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: var(--r-s); }
.btn.ghost { background: transparent; } .btn.ghost:hover { background: var(--hover); color: var(--primary); }
.btn.active { background: var(--primary); color: #fff; } .btn:disabled { opacity: .45; cursor: default; pointer-events: none; }

/* ---- каркас: боковая панель + основная область ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 264px; flex: none; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; z-index: 70; transition: width .2s ease, left .2s ease; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; font-weight: 800; font-size: 19px; color: var(--text); cursor: pointer; white-space: nowrap; }
.side-brand:hover { text-decoration: none; color: var(--primary); }
.side-logo { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), #9a6cf0); color: #fff; display: grid; place-items: center; font-size: 18px; flex: none; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 12px; border-radius: var(--r-m); color: var(--text); font-weight: 600;
  white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.side-link:hover { background: var(--hover); color: var(--primary); text-decoration: none; }
.side-link.on { background: var(--primary-soft); color: var(--primary); }
.side-ico { width: 22px; text-align: center; font-size: 16px; flex: none; }
.side-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 18px 24px 6px; white-space: nowrap; }
.side-proj > .side-link .chip { margin-left: auto; }
.side-sub { margin: 0 12px 4px 34px; padding-left: 10px; border-left: 2px solid var(--border); }
.side-sub a { display: block; padding: 5px 10px; border-radius: var(--r-s); color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.side-sub a:hover { background: var(--hover); color: var(--primary); text-decoration: none; } .side-sub a.on { color: var(--primary); background: var(--primary-soft); }
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); }
.layout.collapsed .sidebar { width: 72px; }
.layout.collapsed .side-text, .layout.collapsed .side-label, .layout.collapsed .side-sub, .layout.collapsed .side-proj .chip { display: none; }
.layout.collapsed .side-link { justify-content: center; padding: 10px 0; margin: 2px 10px; } .layout.collapsed .side-brand { justify-content: center; padding-left: 0; padding-right: 0; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.main.loading::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 300; background: linear-gradient(90deg, transparent, var(--primary), transparent);
  background-size: 40% 100%; background-repeat: no-repeat; animation: load 1s linear infinite; }
@keyframes load { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.main.loading .page { opacity: .55; transition: opacity .2s; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 0 24px; height: 60px; background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--primary); } .crumbs b { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.topbar input[type=search] { width: 260px; } .topbar .btn.ghost { padding: 0 10px; }
.userbtn { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 2rem; cursor: pointer; font-weight: 600; transition: background .15s; }
.userbtn:hover { background: var(--hover); } .user-wrap { position: relative; }
.menu-panel { position: absolute; right: 0; top: 46px; min-width: 220px; background: var(--panel); border-radius: var(--r-l); box-shadow: var(--shadow-l); padding: 6px; z-index: 120; border: 1px solid var(--border); }
.menu-panel a { display: flex; gap: 10px; padding: 9px 12px; border-radius: var(--r-s); color: var(--text); font-weight: 600; cursor: pointer; }
.menu-panel a:hover { background: var(--hover); color: var(--primary); text-decoration: none; }
.sb-backdrop { display: none; }
.page { padding: 24px 28px 48px; max-width: 1640px; width: 100%; margin: 0 auto; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -290px; width: 280px; box-shadow: var(--shadow-l); }
  body.sb-open .sidebar { left: 0; } body.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(27,31,59,.4); z-index: 65; }
  .page { padding: 16px; } .topbar { padding: 0 12px; } .topbar input[type=search] { width: 130px; } .crumbs { display: none; }
}

/* ---- карточки, сетки ---- */
.card { background: var(--panel); border-radius: var(--r-l); padding: 20px; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.project-card { cursor: pointer; border: 2px solid transparent; }
.project-card:hover { border-color: var(--primary); box-shadow: var(--shadow-l); transform: translateY(-2px); }
.progress { height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--done), #62c97f); border-radius: 4px; transition: width .4s; }
.login { max-width: 380px; margin: 12vh auto; padding: 0 16px; } .login .card { display: flex; flex-direction: column; gap: 12px; padding: 28px; box-shadow: var(--shadow-l); }
.err { color: var(--danger); font-weight: 600; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); } .empty .big { font-size: 44px; margin-bottom: 8px; } .empty h3 { color: var(--text); font-size: 16px; }
.proj-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 700; border-radius: var(--r-m) var(--r-m) 0 0; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: background .15s, color .15s; }
.tabs a:hover { background: var(--hover); color: var(--primary); text-decoration: none; } .tabs a.on { color: var(--primary); border-color: var(--primary); }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.chipbtn { height: 30px; padding: 0 12px; border-radius: 2rem; font: 700 12px var(--font); background: var(--panel); color: var(--muted); border: 1px solid var(--border); cursor: pointer; transition: all .15s; }
.chipbtn:hover { border-color: var(--primary); color: var(--primary); background: var(--hover); } .chipbtn.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- бейджи ---- */
.tbadge { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; font-size: 11px; font-weight: 800; color: #fff; flex: none; }
.prio { font-size: 12px; font-weight: 800; white-space: nowrap; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: 10px; font-weight: 800; color: #fff; flex: none; box-shadow: 0 0 0 2px var(--panel); }
.chip { display: inline-block; padding: 1px 9px; border-radius: 1rem; font-size: 11px; font-weight: 700; background: var(--panel2); color: var(--muted); }
.st { display: inline-block; padding: 2px 10px; border-radius: 1rem; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.st.todo { background: rgba(154,160,180,.2); color: var(--muted); } .st.doing { background: var(--primary-soft); color: var(--primary); } .st.done { background: rgba(58,168,87,.16); color: var(--done); }
.key { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; } .done-title { text-decoration: line-through; color: var(--muted); }

/* ---- доска ---- */
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 14px; }
.col { background: var(--col-bg); border-radius: var(--r-l); width: 300px; flex: none; display: flex; flex-direction: column; max-height: calc(100vh - 250px); transition: background .15s, outline-color .15s; outline: 2px solid transparent; outline-offset: -2px; }
.col h3 { padding: 14px 16px 8px; text-transform: uppercase; font-size: 12px; letter-spacing: .05em; color: var(--muted); display: flex; justify-content: space-between; margin: 0; }
.col h3 span { background: var(--panel); border-radius: 1rem; padding: 0 8px; font-weight: 800; }
.col .cards { padding: 4px 10px 8px; overflow-y: auto; overflow-x: hidden; min-height: 60px; flex: 1; }
.col.over { outline-color: var(--primary); background: var(--primary-soft); }
.ic { position: relative; background: var(--panel); border-radius: var(--r-m); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer; transition: box-shadow .15s; }
.ic:hover, .ic:focus-visible { box-shadow: inset 0 0 0 2px var(--primary), var(--shadow); outline: none; } .ic.dragging { opacity: .4; }
.ic .title { margin-bottom: 10px; word-break: break-word; font-weight: 600; } .ic .meta { display: flex; align-items: center; gap: 8px; }
.blocked { color: var(--danger); font-size: 11px; font-weight: 800; } .overdue { color: var(--danger); font-weight: 700; } .soon { color: #e8801f; font-weight: 700; }
.sprint-banner { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; background: var(--panel); border-left: 4px solid var(--primary); border-radius: var(--r-m); padding: 10px 16px; margin-bottom: 14px; box-shadow: var(--shadow); font-size: 13px; }

/* ---- таблицы ---- */
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
.tbl th, .tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl th { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--panel2); user-select: none; white-space: nowrap; }
.tbl th.sort { cursor: pointer; } .tbl th.sort:hover { color: var(--primary); }
.tbl tbody tr { transition: background .12s; } .tbl tbody tr:hover td { background: var(--hover); } .tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

/* ---- диаграмма Ганта ---- */
.gantt { background: var(--panel); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: auto; position: relative; }
.g-inner { position: relative; } .g-head, .g-row { display: flex; }
.g-head { position: sticky; top: 0; z-index: 10; background: var(--panel2); border-bottom: 1px solid var(--border); }
.g-left { width: 340px; flex: none; position: sticky; left: 0; z-index: 8; background: var(--panel); border-right: 1px solid var(--border); padding: 0 12px; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.g-head .g-left { background: var(--panel2); z-index: 11; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.g-row { height: 34px; border-bottom: 1px solid var(--border); position: relative; }
.g-row:hover::after { content: ''; position: absolute; inset: 0; background: var(--hover); pointer-events: none; z-index: 1; } .g-row:hover .g-left { background: var(--panel2); }
.g-row .g-left .tt { overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-weight: 600; } .g-row .g-left .tt:hover { color: var(--primary); text-decoration: underline; }
.g-line { position: relative; flex: none; }
.g-months { display: flex; height: 22px; } .g-days { display: flex; height: 20px; }
.g-months > div, .g-days > div { flex: none; font-size: 11px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--border); padding-left: 4px; overflow: hidden; white-space: nowrap; }
.g-days > div.we { background: var(--weekend); }
.g-bar { position: absolute; top: 7px; height: 20px; border-radius: 6px; background: var(--doing); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; padding: 0 7px;
  cursor: grab; user-select: none; z-index: 6; box-shadow: var(--shadow); transition: filter .12s, box-shadow .12s; overflow: visible; }
.g-bar:hover { filter: brightness(1.12); box-shadow: 0 .25rem .75rem rgba(27,31,59,.3); z-index: 7; }
.g-bar.todo { background: var(--todo); } .g-bar.done { background: var(--done); } .g-bar.epic { background: #904ee2; height: 14px; top: 10px; line-height: 14px; }
.g-bar.ro { cursor: pointer; } .g-bar.drag { opacity: .85; }
.g-bar .lbl { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-bar .h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; } .g-bar .h:hover { background: rgba(255,255,255,.35); } .g-bar .h.l { left: 0; border-radius: 6px 0 0 6px; } .g-bar .h.r { right: 0; border-radius: 0 6px 6px 0; }
.g-bar .dot { position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--panel); border: 2px solid var(--primary); cursor: crosshair; opacity: 0; z-index: 3; transition: transform .12s, opacity .12s; }
.g-bar .dot.dr { right: -17px; } .g-bar .dot.dl { left: -17px; } .g-bar:hover .dot, .gantt.linking .g-bar .dot { opacity: 1; } .g-bar .dot:hover { background: var(--primary); transform: scale(1.3); }
.g-bar.link-target { outline: 3px solid var(--done); outline-offset: 1px; }
.gantt.linking, .gantt.linking * { cursor: crosshair !important; } .gantt.linking .g-svg path.hit { pointer-events: none; }
.g-hint { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 10px; font-size: 11px; color: var(--muted); cursor: crosshair; opacity: 0; transition: opacity .12s; }
.g-row:hover .g-hint { opacity: 1; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 3; pointer-events: none; opacity: .7; }
.g-svg { position: absolute; pointer-events: none; z-index: 4; overflow: visible; }
.g-svg path { fill: none; stroke: var(--muted); stroke-width: 1.5; } .g-svg path.bad { stroke: var(--danger); stroke-width: 2; }
.g-svg marker path { fill: var(--muted); stroke: none; } .g-svg marker#ab path { fill: var(--danger); }
.g-svg path.hit { stroke: transparent; stroke-width: 12; pointer-events: stroke; cursor: pointer; } .g-svg path.hit:hover + path.dep { stroke: var(--danger); stroke-width: 3; }
.g-svg path.tmp { stroke: var(--primary); stroke-width: 2; stroke-dasharray: 6 4; pointer-events: none; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; } .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }

/* ---- модальные окна: шапка и подвал закреплены, прокручивается только содержимое ---- */
.overlay { position: fixed; inset: 0; background: rgba(27,31,59,.5); backdrop-filter: blur(3px); z-index: 100; display: flex; justify-content: center; align-items: center; padding: 3vh 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal { background: var(--panel); border-radius: var(--r-l); width: 100%; max-width: 1020px; max-height: 94vh; box-shadow: var(--shadow-l); display: flex; flex-direction: column; overflow: hidden; animation: pop .18s; }
.modal.narrow { max-width: 540px; }
.issue-root { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal > div:not(.modal-h):not(.modal-b):not(.modal-f) { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--border); flex: none; background: var(--panel); }
.modal-b { padding: 22px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex: none; background: var(--panel); }
.issue-cols { display: grid; grid-template-columns: 1fr 290px; gap: 28px; }
@media (max-width: 800px) { .issue-cols { grid-template-columns: 1fr; } .g-left { width: 200px; } }
.title-input { width: 100%; font-size: 22px; font-weight: 800; height: 46px; background: transparent; padding: 0 8px; margin-left: -8px; }
.side { background: var(--panel2); border-radius: var(--r-l); padding: 6px 16px; align-self: start; }
.field { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border); } .field:last-child { border: 0; }
.field > label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; }
.field select, .field input:not([type=checkbox]) { width: 100%; } .side .field input, .side .combo-input { background-color: var(--panel); }
.section { margin-top: 24px; } .section > h3 { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-m); margin-bottom: 6px; background: var(--panel2); border: 2px solid transparent; transition: border-color .12s, background .12s; }
.list-item:hover { border-color: var(--primary); background: var(--hover); } .list-item .tt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-weight: 600; }
.comment { display: flex; gap: 12px; margin-bottom: 14px; } .comment .body { white-space: pre-wrap; word-break: break-word; background: var(--panel2); padding: 10px 14px; border-radius: 0 var(--r-m) var(--r-m) var(--r-m); margin-top: 4px; }
.hist { font-size: 12px; color: var(--muted); padding: 5px 8px; border-radius: var(--r-s); } .hist:hover { background: var(--hover); } .hist b { color: var(--text); font-weight: 700; }
.subtabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.desc { white-space: pre-wrap; padding: 10px; border-radius: var(--r-m); min-height: 50px; }
.changed { box-shadow: 0 0 0 2px var(--warn) !important; background: rgba(255,169,77,.1) !important; } .combo.changed .combo-input { box-shadow: 0 0 0 2px var(--warn); background-color: rgba(255,169,77,.1); }
.savebar { display: none; align-items: center; gap: 12px; padding: 12px 22px; background: var(--panel2); border-top: 2px solid var(--warn); flex: none; }
.dirty-pill { background: rgba(255,169,77,.2); color: #b36a12; border-radius: 1rem; padding: 2px 10px; font-size: 12px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; } .form-grid input:not([type=checkbox]), .form-grid select { width: 100%; }
.quick { padding: 0 10px 10px; } .quick input { width: 100%; background: var(--panel); border-color: var(--primary); } .quick .btn { width: 100%; justify-content: flex-start; color: var(--muted); background: transparent; }
.quick .btn:hover { background: var(--panel); color: var(--primary); }

/* ---- вложения ---- */
.dropzone { border: 2px dashed var(--border); border-radius: var(--r-l); padding: 18px; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 10px; }
.att { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r-m); background: var(--panel2); border: 2px solid transparent; transition: border-color .12s, background .12s; }
.att:hover { border-color: var(--primary); background: var(--hover); }
.att-thumb { width: 48px; height: 48px; border-radius: var(--r-s); background: var(--panel); display: grid; place-items: center; font-size: 22px; overflow: hidden; flex: none; cursor: pointer; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; } .att-info { min-width: 0; flex: 1; } .att-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.upbar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 6px; } .upbar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .15s; }
.lightbox { text-align: center; } .lightbox img { max-width: 100%; max-height: 74vh; border-radius: var(--r-m); }

/* ---- главная ---- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.hero h1 { margin: 0; font-size: 28px; } .stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--panel); border-radius: var(--r-l); padding: 16px 18px; box-shadow: var(--shadow); cursor: pointer; border: 2px solid transparent; transition: all .15s; display: flex; gap: 14px; align-items: center; }
.stat:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-l); }
.stat .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--primary-soft); flex: none; }
.stat .num { font-size: 26px; font-weight: 800; line-height: 1.1; } .stat.bad .num { color: var(--danger); } .stat.bad .ico { background: var(--danger-soft); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 26px; }
.tile { background: var(--panel); border-radius: var(--r-l); padding: 18px; box-shadow: var(--shadow); cursor: pointer; border: 2px solid transparent; transition: all .15s; color: var(--text); }
.tile:hover { border-color: var(--primary); background: var(--hover); transform: translateY(-2px); box-shadow: var(--shadow-l); text-decoration: none; color: var(--text); }
.tile .ico { font-size: 28px; margin-bottom: 8px; } .tile b { display: block; font-size: 15px; } .tile span { color: var(--muted); font-size: 13px; }
.home-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; } @media (max-width: 1000px) { .home-cols { grid-template-columns: 1fr; } }
.quick-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; } .sec-title h2 { margin: 0; }
.act-row { display: flex; gap: 10px; padding: 8px 6px; border-radius: var(--r-s); font-size: 13px; } .act-row:hover { background: var(--hover); }

/* ---- уведомления ---- */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 400; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #1b1f3b; color: #fff; padding: 12px 18px; border-radius: var(--r-m); box-shadow: var(--shadow-l); max-width: 400px; animation: pop .2s; display: flex; gap: 12px; align-items: center; font-weight: 600; }
.toast.err { background: var(--danger); } .toast a { color: #b9c6ff; font-weight: 800; white-space: nowrap; } .toast.err a { color: #fff; }
.bell-wrap { position: relative; } .bell { position: relative; font-size: 17px; padding: 0 10px; }
.badge { position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; border-radius: 9px; padding: 0 5px; line-height: 16px; }
.notif-panel { position: absolute; right: 0; top: 46px; width: 400px; max-width: 92vw; max-height: 70vh; overflow-y: auto; background: var(--panel); border-radius: var(--r-l); box-shadow: var(--shadow-l); border: 1px solid var(--border); z-index: 120; }
.notif { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; } .notif:hover { background: var(--hover); }
.notif.unread { background: var(--primary-soft); font-weight: 700; }

/* ---- отчёты ---- */
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.kpi { background: var(--panel); border-radius: var(--r-l); padding: 12px 18px; min-width: 130px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; } .kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-l); }
.kpi-v { font-size: 26px; font-weight: 800; } .kpi-v.bad { color: var(--danger); } .kpi-v.ok { color: var(--done); }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; padding: 2px 4px; border-radius: var(--r-s); } .bar-row:hover { background: var(--hover); }
.bar-label { width: 130px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bar-track { flex: 1; height: 14px; background: var(--panel2); border-radius: 7px; overflow: hidden; display: flex; } .bar-fill { height: 100%; border-radius: 7px; } .bar-val { width: 70px; flex: none; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.cols-chart { overflow-x: auto; } .cols-area { display: flex; align-items: flex-end; gap: 6px; border-bottom: 1px solid var(--border); padding: 0 4px; min-width: min-content; }
.cols-group { display: flex; align-items: flex-end; gap: 2px; width: 34px; height: 100%; flex: none; border-radius: 6px 6px 0 0; transition: background .12s; } .cols-group:hover { background: var(--hover); }
.cols-bar { flex: 1; min-height: 1px; border-radius: 4px 4px 0 0; } .cols-labels { display: flex; gap: 6px; padding: 0 4px; min-width: min-content; }
.cols-labels div { width: 34px; flex: none; font-size: 10px; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.burndown svg { background: var(--panel); border-radius: var(--r-m); }

/* ---- бэклог ---- */
.bl-section { background: var(--panel); border-radius: var(--r-l); margin-bottom: 16px; box-shadow: var(--shadow); overflow: hidden; }
.bl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: var(--panel2); } .bl-head.active { box-shadow: inset 4px 0 0 var(--primary); } .bl-goal { padding: 8px 16px 0; }
.bl-list { min-height: 44px; padding: 8px 12px; transition: background .15s; } .bl-list.over { outline: 2px dashed var(--primary); outline-offset: -4px; background: var(--primary-soft); }
.bl-empty { padding: 12px; text-align: center; border: 2px dashed var(--border); border-radius: var(--r-m); }
.bl-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-m); margin: 5px 0; background: var(--panel2); cursor: pointer; border: 2px solid transparent; transition: border-color .12s, background .12s, transform .12s; }
.bl-row:hover { border-color: var(--primary); background: var(--hover); } .bl-row.dragging { opacity: .4; }
.bl-row .tt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; } .bl-row .est { width: 46px; text-align: right; }
.bl-add { padding: 0 12px 10px; } .bl-add .quick { padding: 0; } .bl-closed { margin: 18px 0; } .bl-closed summary { cursor: pointer; font-weight: 700; margin-bottom: 10px; }
.chip.st-active { background: var(--primary-soft); color: var(--primary); } .chip.st-planned { background: rgba(154,160,180,.22); } .chip.st-closed { background: rgba(58,168,87,.16); color: var(--done); }

/* ---- список с поиском ---- */
.combo { position: relative; display: inline-block; min-width: 150px; } .field .combo, .form-grid .combo { display: block; width: 100%; }
.combo-input { width: 100%; cursor: pointer; padding-right: 28px; text-overflow: ellipsis;
  background: var(--panel2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239aa0b4'/%3E%3C/svg%3E") no-repeat right 12px center; }
.combo-input:hover, .combo-input:focus { background-color: var(--panel); } .combo.disabled .combo-input { cursor: not-allowed; opacity: .65; }
.combo-list { position: fixed; left: 0; top: 0; min-width: 100%; max-width: 440px; max-height: 270px; overflow-y: auto; z-index: 500; background: var(--panel); border-radius: var(--r-m); box-shadow: var(--shadow-l); padding: 4px; border: 1px solid var(--border); }
.combo-opt { padding: 7px 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: var(--r-s); }
.combo-opt:hover { background: var(--hover); } .combo-opt.active { background: var(--primary-soft); color: var(--primary); } .combo-opt.sel { font-weight: 800; } .combo-empty { padding: 10px; color: var(--muted); }

@media print { .sidebar, .topbar, .tabs, .filters, .btn, #toasts { display: none !important; } body { background: #fff; } .page { padding: 0; } }

/* ---- иконки (Lucide / Taiga UI) ---- */
.i-svg { display: inline-flex; vertical-align: -0.18em; line-height: 0; flex: none; } .i-svg svg { display: block; }
.i-spin svg { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.side-ico { color: var(--muted); display: inline-flex; justify-content: center; } .side-link:hover .side-ico, .side-link.on .side-ico { color: inherit; }
.side-logo .i-svg { color: #fff; }
.stat .ico, .tile .ico { color: var(--primary); } .stat.bad .ico { color: var(--danger); } .tile .ico { margin-bottom: 10px; display: block; }
.empty .big { display: flex; justify-content: center; color: var(--muted); opacity: .55; margin-bottom: 10px; }
.btn .i-svg, .chipbtn .i-svg { margin-right: 2px; } .menu-panel a .i-svg { color: var(--muted); } .menu-panel a:hover .i-svg { color: inherit; }
.att-thumb { color: var(--muted); } .notif .i-svg { margin-top: 2px; } .notif .k-overdue { color: var(--danger); } .notif .k-due_soon { color: #e8801f; } .notif .k-assigned { color: var(--primary); }
.blocked .i-svg, .overdue .i-svg, .soon .i-svg { vertical-align: -0.2em; }

/* ---- контраст на сером фоне страницы ---- */
.page .btn:not(.primary):not(.danger):not(.ghost):not(.active) { background: var(--panel); box-shadow: inset 0 0 0 1px var(--border); }
.page .btn:not(.primary):not(.danger):not(.ghost):not(.active):hover { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.filters input:not([type=checkbox]), .filters .combo-input, .hero input, .rep-filters input { background-color: var(--panel); border-color: var(--border); }
.page > .row input, .page .row > input, .page .row > .combo .combo-input, .page .row > label input { background-color: var(--panel); border-color: var(--border); }
.card input:not([type=checkbox]), .card .combo-input, .card textarea { background-color: var(--panel2); }
/* ---- пустые поля даты не показывают маску «дд.мм.гггг» (иконка календаря остаётся; при фокусе маска появляется) ---- */
input[type=date].no-val:not(:focus)::-webkit-datetime-edit { opacity: 0; }
input[type=date].no-val:not(:focus)::-moz-datetime-edit { opacity: 0; }
/* ---- высота диаграммы Ганта ---- */
.g-resizer { height: 14px; display: flex; align-items: center; justify-content: center; cursor: ns-resize; margin-top: 4px; border-radius: var(--r-s); }
.g-resizer span { width: 56px; height: 4px; border-radius: 2px; background: var(--border); transition: background .15s, width .15s; }
.g-resizer:hover { background: var(--hover); } .g-resizer:hover span { background: var(--primary); width: 80px; }
