:root {
  --bg: #e9eff4; --card: #fff; --text: #0c1a2b; --muted: #475a6e; --line: #b9c8d6; --line-soft: #d5dfe8;
  --brand: #2f5f9e; --brand-dark: #244b80; --accent: #7fb0e6; --navy: #1d3557;
  --ok: #0f7a47; --warn: #a85a00; --bad: #c4162f;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "Inter", "Segoe UI", -apple-system, Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
.nav { background: var(--navy); border-bottom: 3px solid var(--accent); color: #fff; display: flex; align-items: center; gap: 4px; padding: 0 20px; height: 52px; flex-wrap: wrap; }
.nav a { color: #dbe7f3; padding: 8px 12px; border-radius: 6px; } .nav a:hover, .nav a.active { background: #2f5f9e; color: #fff; text-decoration: none; }
.nav .brand { font-weight: 700; color: #fff; margin-right: 16px; } .nav .spacer { flex: 1; }
.nav form { margin: 0; } .nav button { background: none; border: 0; color: #dbe7f3; cursor: pointer; font: inherit; padding: 8px 12px; } .nav button:hover { color: #fff; }
main { max-width: 1560px; margin: 0 auto; padding: 22px 20px 60px; }
h1 { font-size: 24px; margin: 0 0 4px; } h2 { font-size: 18px; margin: 26px 0 10px; } .sub { color: var(--muted); margin: 0 0 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(10,37,64,.10); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; }
.btn { font-weight: 600; display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 7px; padding: 8px 14px; font: inherit; cursor: pointer; }
.btn:hover { background: var(--brand-dark); text-decoration: none; } .btn.ghost { background: #fff; color: var(--navy); border: 1px solid #8fa3b6; font-weight: 600; } .btn.ghost:hover { background: #f0f2f6; }
.btn.danger { background: #fff; color: var(--bad); border: 1px solid var(--line); } .btn.small { padding: 4px 9px; font-size: 13px; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid #8fa3b6; border-radius: 7px; background: #fff; max-width: 100%; }
textarea { width: 100%; } .field { margin-bottom: 14px; } .field label { display: block; font-weight: 600; margin-bottom: 4px; } .field .help, .errorlist { color: var(--muted); font-size: 13px; margin: 3px 0 0; padding: 0; list-style: none; } .errorlist { color: var(--bad); }
.form-card { max-width: 640px; } .form-card input[type=text], .form-card input[type=number], .form-card input[type=date], .form-card input[type=password], .form-card select { width: 100%; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; } th { background: #dde8f0; color: var(--navy); font-weight: 700; font-size: 13px; border-bottom: 2px solid #9fb4c6; } tbody tr:hover td { background: #f3f7fc; } td.nowrap, th.nowrap { white-space: nowrap; } tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; } .neg { color: var(--bad); } .pos { color: var(--ok); } .muted { color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; background: #dbe6f0; color: #1f3550; white-space: nowrap; }
.badge.high { background: #fde4e8; color: var(--bad); } .badge.low { background: #eef0f3; color: var(--muted); } .badge.overdue { background: #fde4e8; color: var(--bad); } .badge.ok { background: #dcf3e8; color: var(--ok); }
.messages { list-style: none; padding: 0; margin: 0 0 16px; } .messages li { padding: 10px 14px; border-radius: 8px; background: #dcf3e8; margin-bottom: 6px; } .messages li.error { background: #fde4e8; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; }
.tcard[draggable=true] { cursor: grab; } .tcard.dragging { opacity: .4; } .tcard .t { font-weight: 600; display: block; margin-bottom: 4px; } .tcard .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tcard select { font-size: 12px; padding: 2px 4px; margin-top: 6px; width: 100%; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 8px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; } .kpi .l { color: var(--muted); font-size: 13px; } .kpi .v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.info { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 24px; } .info dt { color: var(--muted); font-size: 12.5px; } .info dd { margin: 0 0 2px; font-weight: 500; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 22px 0 16px; } .tabs button { background: none; border: 0; padding: 10px 16px; font: inherit; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button { color: #34495e; } .tabs button.active { color: var(--brand); border-bottom-width: 3px; border-color: var(--brand); font-weight: 600; } .tab-pane { display: none; } .tab-pane.active { display: block; }
.chat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; height: 520px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; } .msg { max-width: 72%; margin-bottom: 10px; } .msg .who { font-size: 12px; color: var(--muted); } .msg .body { background: #e3eaf1; border-radius: 10px; padding: 8px 12px; white-space: pre-wrap; word-wrap: break-word; }
.msg.mine { margin-left: auto; } .msg.mine .body { background: #dbe8f8; } .msg.mine .who { text-align: right; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); } .chat-form textarea { resize: none; height: 44px; }
.login { max-width: 360px; margin: 90px auto; }
@media (max-width: 900px) { .kanban { grid-template-columns: repeat(4, 260px); } .msg { max-width: 92%; } }

/* статус в шапке заказа, архив, чат */
tr.archived td { text-decoration: line-through; color: var(--muted); }
tr.archived td a { color: var(--muted); }
tr.inactive td { color: var(--muted); }
.mention { background: #dbe7ff; color: #1f3fbf; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.msg .att { margin-top: 4px; }
.chat-form { position: relative; align-items: flex-end; }
.chat-form .attach-btn { padding: 8px 12px; cursor: pointer; }
.chat-attach { padding: 6px 12px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.mention-box { position: absolute; bottom: 100%; left: 60px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); max-height: 200px; overflow-y: auto; min-width: 220px; z-index: 5; }
.mention-box div { padding: 7px 12px; cursor: pointer; } .mention-box div.sel, .mention-box div:hover { background: #eef1f6; }

/* статусы заказа: цвета в списке и яркие флаги в шапке карточки */
.badge.st-tender { background: #dbe7ff; color: #1f3fbf; font-weight: 600; }
.badge.st-in_progress { background: #ffe9b8; color: #8a5200; font-weight: 600; }
.badge.st-closed { background: #e3e6eb; color: #5b6472; font-weight: 600; }
.status-flags { display: inline-flex; gap: 8px; flex-wrap: wrap; vertical-align: middle; }
.flag { border: 2px solid; border-radius: 999px; padding: 5px 16px; font-size: 14px; font-weight: 700; cursor: pointer; background: #fff; font-family: inherit; }
.flag.st-tender { color: #2f6bff; border-color: #2f6bff; } .flag.st-in_progress { color: #d98200; border-color: #f59e0b; } .flag.st-closed { color: #6b7280; border-color: #9ca3af; }
.flag:hover:not(:disabled) { filter: brightness(.95); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.flag.on { color: #fff; cursor: default; opacity: 1; }
.flag.on.st-tender { background: #2f6bff; } .flag.on.st-in_progress { background: #f59e0b; } .flag.on.st-closed { background: #6b7280; }
.flag:disabled { opacity: 1; }

/* логотип и фокус */
.nav .brand { display: inline-flex; align-items: center; gap: 8px; letter-spacing: .01em; }
.nav .brand svg { width: 34px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
h1 { color: var(--navy); }
.login { border-top: 4px solid var(--accent); }
.login .pulse { width: 120px; height: 28px; stroke: var(--brand); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.kpi { border-left: 4px solid var(--brand); }

/* канбан: у каждого статуса свой цвет */
.col { --c: #5b6b7d; --c-bg: #e4eaf0; background: var(--c-bg); border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: 10px; padding: 10px; min-height: 160px; }
.col[data-status=todo] { --c: #2557c9; --c-bg: #dde8fb; }
.col[data-status=doing] { --c: #d27a00; --c-bg: #fdecc8; }
.col[data-status=review] { --c: #7a3fc4; --c-bg: #ebdffa; }
.col[data-status=done] { --c: #0f7a47; --c-bg: #d6efe2; }
.col.over { outline: 3px dashed var(--c); }
.col h3 { margin: 0 0 10px; font-size: 14px; color: var(--c); font-weight: 800; display: flex; justify-content: space-between; align-items: center; }
.col h3 .count { background: var(--c); color: #fff; border-radius: 999px; min-width: 24px; text-align: center; padding: 1px 8px; font-size: 13px; }
.tcard { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 8px; padding: 10px 11px; margin-bottom: 9px; box-shadow: 0 1px 3px rgba(10,37,64,.14); }
.tcard.p-high { box-shadow: 0 1px 3px rgba(10,37,64,.14), inset 0 3px 0 var(--bad); }
.tcard.late { background: #fff3f4; border-color: #e7a0aa; border-left-color: var(--bad); }
.tcard .ord { display: inline-block; font-size: 12px; font-weight: 700; color: var(--brand-dark); background: #e3ecf8; border-radius: 5px; padding: 1px 7px; white-space: nowrap; }
.tcard .who { font-size: 12.5px; color: var(--text); font-weight: 600; }
.badge.st-tender { background: #cfe0ff; color: #12338f; } .badge.st-in_progress { background: #ffdf9c; color: #6b3d00; } .badge.st-closed { background: #d3dae2; color: #3d4957; }
.badge.high, .badge.overdue { background: #fbd0d6; color: #9b0f25; } .badge.ok { background: #c6ead8; color: #0a5c34; }
.col-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 14px 0; }
.cards:has(.tcard) .col-empty { display: none; }
main:has(table) { overflow-x: auto; } td.title-col { min-width: 220px; } th, td { padding: 9px 10px; }

/* поиск, недавние, крошки */
.nav-search input { width: 190px; padding: 5px 10px; border-radius: 999px; border: 1px solid #4f739f; background: #2a4a75; color: #fff; }
.nav-search input::placeholder { color: #9db6cf; }
.recent { position: relative; } .recent summary { cursor: pointer; color: #dbe7f3; padding: 8px 12px; list-style: none; border-radius: 6px; } .recent summary:hover { background: #2a4a75; }
.recent-list { position: absolute; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(10,37,64,.2); min-width: 300px; padding: 4px; }
.recent-list a { display: flex; gap: 8px; padding: 7px 10px; color: var(--text); border-radius: 6px; } .recent-list a:hover { background: #eaf1fa; text-decoration: none; } .recent-list b { color: var(--brand-dark); white-space: nowrap; } .recent-list span { color: var(--muted); }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; } .crumbs b { color: var(--navy); }

/* виды списка и выбор столбцов */
.views { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid #8fa3b6; background: #fff; color: var(--navy); font-weight: 600; font-size: 13.5px; } .chip:hover { background: #eaf1fa; text-decoration: none; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-wrap { display: inline-flex; align-items: center; gap: 2px; } .chip-wrap form { margin: 0; } .chip-wrap .x { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; } .chip-wrap .x:hover { color: var(--bad); }
.save-view { display: inline-flex; gap: 6px; margin: 0 0 0 auto; } .save-view input { width: 240px; padding: 4px 9px; }
.colpick { position: relative; } .colpick summary { list-style: none; cursor: pointer; }
.colpick-list { position: absolute; right: 0; top: 110%; z-index: 15; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(10,37,64,.2); padding: 8px 12px; min-width: 210px; } .colpick-list label { display: block; padding: 3px 0; cursor: pointer; }

/* лимит заданий в колонке */
.col.wip-over { box-shadow: 0 0 0 3px var(--bad); } .col.wip-over h3 .count { background: var(--bad); }
.wip-note { background: var(--bad); color: #fff; font-weight: 600; font-size: 13px; border-radius: 6px; padding: 6px 9px; margin-bottom: 9px; }

/* ===== 1.0.5: спокойная гамма — оттенки синего, пастель ===== */
:root { --bg: #f0f4fa; --line: #c9d5e4; --line-soft: #e0e8f2; }
.nav { border-bottom: 1px solid #101f38; }
.nav .brand svg { stroke: #9ec5f0; }
th { background: #e6edf7; border-bottom: 1px solid #c3d2e5; font-weight: 600; }
.btn { font-weight: 500; } .btn.ghost { font-weight: 500; border-color: #b4c4d9; }
.badge { font-weight: 500; background: #e6edf7; color: #2c4263; }
.badge.st-tender { background: #dce8fb; color: #24467f; font-weight: 500; }
.badge.st-in_progress { background: #e4e1f7; color: #3f3a85; font-weight: 500; }
.badge.st-closed { background: #e8ecf1; color: #5a6676; font-weight: 500; }
.badge.high, .badge.overdue { background: #fbe3e6; color: #a3243a; }
.chip { font-weight: 500; border-color: #b4c4d9; } .chip.on { background: #2f5f9e; border-color: #2f5f9e; }
.kpi { border-left: 3px solid #9ec5f0; }
.login { border-top: 3px solid #9ec5f0; }
.flag { font-weight: 600; }
.flag.st-tender { color: #3b73c9; border-color: #3b73c9; } .flag.on.st-tender { background: #3b73c9; }
.flag.st-in_progress { color: #6a5fc1; border-color: #6a5fc1; } .flag.on.st-in_progress { background: #6a5fc1; }
.flag.st-closed { color: #6b7684; border-color: #a5afbd; } .flag.on.st-closed { background: #7b8696; }
.mention { background: #dce8fb; color: #24467f; }

/* канбан: пастельные колонки, белые карточки, цвет только в полосе сверху */
.col { border: 1px solid var(--line-soft); border-top: 4px solid var(--c); }
.col[data-status=todo] { --c: #6fa0e0; --c-bg: #eaf1fb; }
.col[data-status=doing] { --c: #8a84d8; --c-bg: #eeedfa; }
.col[data-status=review] { --c: #c49ad8; --c-bg: #f5eefa; }
.col[data-status=done] { --c: #7cc4a8; --c-bg: #e9f6f0; }
.col h3 { color: #2c4263; font-weight: 600; }
.col h3 .count { background: #fff; color: #2c4263; border: 1px solid var(--c); font-weight: 600; }
.tcard { border-left: 1px solid var(--line-soft); box-shadow: 0 1px 2px rgba(29,53,87,.08); }
.tcard.p-high { box-shadow: 0 1px 2px rgba(29,53,87,.08); border-left: 3px solid #e08a96; }
.tcard.late { background: #fff; border-color: var(--line-soft); border-left: 3px solid #e08a96; }
.tcard.late .neg { font-weight: 600; }
.tcard .ord { background: #e6edf7; color: #2c4263; font-weight: 500; }
.tcard .who { font-weight: 500; }
.col.wip-over { box-shadow: 0 0 0 2px #e08a96; } .col.wip-over h3 .count { background: #fbe3e6; color: #a3243a; border-color: #e08a96; }
.wip-note { background: #fbe3e6; color: #a3243a; font-weight: 500; }

/* аватары, профиль, сотрудники */
.av { border-radius: 50%; object-fit: cover; vertical-align: middle; flex: none; }
.av.ini { display: inline-flex; align-items: center; justify-content: center; background: #dbe8f8; color: #24467f; font-weight: 600; }
.nav .me { display: inline-flex; align-items: center; gap: 8px; color: #dbe7f3; padding: 4px 10px; } .nav .me .av.ini { background: #7fb0e6; color: #12294a; }
.profile-photo { display: flex; gap: 18px; align-items: center; margin-bottom: 16px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; margin: 0; }
.invite-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; } .invite-form input { min-width: 260px; }
table.staff select { max-width: 190px; } table.staff td { vertical-align: middle; } table.staff form { display: contents; }
.invites input { background: #f3f7fc; }
.msg .who { display: flex; align-items: center; gap: 6px; } .msg.mine .who { justify-content: flex-end; }
.tcard .who { display: inline-flex; align-items: center; gap: 5px; }
