/* KDM BUSINESS OS — визуальная система: глубокий navy, светлый фон, белые рабочие карточки, цвет со смыслом */
:root {
  --navy: #14213D; --navy-2: #1C2B4A; --navy-3: #2A3B5F; --bg: #F4F6FA; --card: #FFFFFF; --line: #E3E8F0; --line-2: #EEF1F6;
  --text: #1B2333; --muted: #6B7689; --accent: #3B5BDB; --accent-2: #4C6EF5; --ok: #2F9E44; --warn: #F76707; --bad: #E03131; --soon: #F59F00;
  --r: 10px; --r-s: 7px; --sh: 0 1px 2px rgba(20,33,61,.06), 0 2px 8px rgba(20,33,61,.04); --sh-2: 0 10px 30px rgba(20,33,61,.18);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: -.01em; } h2 { font-size: 16px; margin: 0; } h3 { font-size: 14px; margin: 16px 0 8px; } h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
p { margin: 4px 0; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .pre { white-space: pre-wrap; word-break: break-word; } .nowrap { white-space: nowrap; } .center { text-align: center; } .hidden { display: none !important; }
.grow { flex: 1; } .row { display: flex; align-items: center; } .gap { gap: 8px; } .wrap { flex-wrap: wrap; } .stack { display: flex; flex-direction: column; gap: 10px; }
.pad { padding: 16px; } .pad-t { padding-top: 12px; } .pad-b { padding-bottom: 12px; } .pad-s { padding: 8px 10px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; } .clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ico { flex-shrink: 0; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #C9D2E3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; color: #fff; text-decoration: none !important; }
.brand b { display: block; font-size: 15px; letter-spacing: .04em; } .brand small { color: #8E9BB5; font-size: 11px; }
.logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #4C6EF5, #7048E8); color: #fff; display: grid; place-items: center; font-weight: 800; }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 8px; display: flex; flex-direction: column; gap: 1px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: #C9D2E3; text-decoration: none !important; font-size: 13.5px; }
.nav-item:hover { background: var(--navy-2); color: #fff; } .nav-item.active { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 0 #748FFC; }
.side-foot { padding: 10px 14px; border-top: 1px solid #22304F; display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #E03131; flex-shrink: 0; } .live-dot.on { background: #40C057; box-shadow: 0 0 0 3px rgba(64,192,87,.2); }
.save-state.ok { color: #8E9BB5; } .save-state.busy { color: #FFD43B; } .save-state.err { color: #FF8787; font-weight: 600; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 22px; background: rgba(244,246,250,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.search-wrap { position: relative; display: flex; align-items: center; width: min(460px, 50vw); } .search-wrap .ico { position: absolute; left: 10px; color: var(--muted); } .search-wrap .input { padding-left: 32px; }
.search-wrap.small { width: 240px; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; padding: 4px 6px; border-radius: 8px; } .user-btn:hover { background: #E9EDF5; }
.user-btn b { display: block; font-size: 13px; } .user-btn small { color: var(--muted); font-size: 11.5px; }
.bell { position: relative; } .badge { position: absolute; top: -2px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; background: var(--bad); color: #fff; border-radius: 9px; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.badge.on { position: static; }
main { padding: 22px 26px 60px; outline: none; }
.page { max-width: 1500px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; } .page.narrow { max-width: 860px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-loading { display: grid; place-items: center; height: 40vh; }
.mobile-only { display: none; }

/* ---------- элементы ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: var(--r-s); border: 1px solid var(--line); background: #fff; color: var(--text); font: 500 13.5px var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { border-color: #C5CEDD; background: #FAFBFD; } .btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:hover { background: #364FC7; }
.btn.danger { color: var(--bad); border-color: #F5C2C2; } .btn.danger:hover { background: #FFF5F5; }
.modal-foot .btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.small { height: 27px; padding: 0 9px; font-size: 12.5px; } .btn.wide { width: 100%; justify-content: center; height: 40px; }
.icon-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 6px; border-radius: 7px; cursor: pointer; color: var(--muted); font: inherit; font-size: 12.5px; } .icon-btn:hover { background: #E9EDF5; color: var(--text); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-align: left; } .link-btn.strong { color: var(--text); font-weight: 600; } .link-btn:hover { text-decoration: underline; }
.input { width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; font: 13.5px var(--font); color: var(--text); }
.input:focus { outline: 2px solid rgba(59,91,219,.25); border-color: var(--accent); } textarea.input { resize: vertical; min-height: 60px; }
.input.slim { width: auto; min-height: 30px; padding: 3px 8px; font-size: 12.5px; }
.field { display: flex; flex-direction: column; gap: 4px; } .field > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .span2 { grid-column: span 2; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.req { color: var(--bad); margin-left: 2px; }
.form-error { color: var(--bad); font-size: 13px; min-height: 18px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 20px; border: 1px solid transparent; font-size: 12px; font-weight: 600; white-space: nowrap; background: #EEF1F6; color: #495057; }
.pill-solid { color: #fff; } .pill .x { border: 0; background: none; cursor: pointer; color: inherit; padding: 0 2px; }
.pills { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 29px; padding: 0 11px; border-radius: 16px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: 12.5px var(--font); color: var(--text); }
.chip.on { background: #EDF2FF; border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip-select { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0; border: 2px solid #fff; }
.avatars { display: inline-flex; } .avatars .avatar + .avatar { margin-left: -7px; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; }
.nil { color: #B5BDCB; } .overdue { color: var(--bad); font-weight: 600; } .due-today { color: var(--warn); font-weight: 600; }
.check-on { color: var(--ok); }
.progress { display: inline-flex; align-items: center; gap: 6px; width: 120px; } .progress span { height: 6px; background: var(--ok); border-radius: 3px; } .progress em { font-style: normal; font-size: 12px; color: var(--muted); }
.progress::before { content: ''; }
.ext-link { max-width: 260px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.link-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 6px; background: #EDF2FF; color: #364FC7; font-size: 12.5px; border: 0; cursor: pointer; }
.link-chip .x { border: 0; background: none; cursor: pointer; color: #364FC7; }
.lookup { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; } .lookup-item { text-align: left; border: 1px solid var(--line); background: #fff; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.lookup-item:hover { background: #F1F4FA; }
.secret { font: 600 18px/1.3 ui-monospace, Consolas, monospace; padding: 12px 14px; background: #F1F4FA; border: 1px dashed #B8C2D6; border-radius: 8px; user-select: all; word-break: break-all; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 34px 16px; color: var(--muted); }
.spinner { width: 26px; height: 26px; border: 3px solid #DCE2EC; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 30px auto; } @keyframes spin { to { transform: rotate(360deg); } }
.test-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .05em; background: #FFE066; color: #5C4600; border-radius: 4px; padding: 0 5px; margin-right: 6px; vertical-align: middle; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; } .swatch { width: 24px; height: 24px; border-radius: 6px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; } .swatch.on { box-shadow: 0 0 0 2px var(--text); }
.color-in { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }

/* ---------- панели и сетки ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 .count, h2 .count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; border-radius: 10px; background: #868E96; color: #fff; font-size: 11.5px; margin-left: 8px; padding: 0 6px; vertical-align: 2px; }
.panel.help { background: #F8F9FF; border-style: dashed; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.board-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); color: var(--text); text-decoration: none !important; border-top: 3px solid var(--c, var(--accent)); }
.board-card:hover { box-shadow: 0 4px 14px rgba(20,33,61,.1); } .admin-card { border-top-color: var(--accent); } .admin-card .ico { color: var(--accent); }
.board-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; } .board-dot.big { width: 18px; height: 18px; border-radius: 5px; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.dept-card { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r); color: var(--text); text-decoration: none !important; cursor: pointer; font: inherit; box-shadow: var(--sh); }
.dept-card:hover { box-shadow: 0 4px 14px rgba(20,33,61,.1); }
.dept-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .stat b { display: block; font-size: 18px; } .stat span { font-size: 11px; color: var(--muted); line-height: 1.2; display: block; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.team-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); color: var(--text); text-decoration: none !important; box-shadow: var(--sh); } .team-card.over { border-color: #FFC078; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: #fff; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, #ADB5BD); }
.kpi-ok { --c: var(--ok); } .kpi-warn { --c: var(--soon); } .kpi-bad { --c: var(--bad); } .kpi-neutral { --c: var(--accent); } .kpi-none { --c: #DEE2E6; background: #FBFCFD; }
.kpi-title { font-size: 12px; color: var(--muted); font-weight: 500; } .kpi-val { font-size: 22px; letter-spacing: -.02em; }
.kpi-sub { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--muted); } .kpi-sub .up { color: var(--ok); font-weight: 600; } .kpi-sub .down { color: var(--bad); font-weight: 600; }
.kpi-bar { height: 4px; background: #EEF1F6; border-radius: 2px; overflow: hidden; } .kpi-bar span { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 2px; }
.spark { width: 100%; height: 26px; color: var(--c, var(--accent)); opacity: .8; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.kpi.mini b { font-size: 22px; } .kpi.mini span { font-size: 12px; color: var(--muted); }
.bar-row { display: grid; grid-template-columns: 170px 1fr 60px; align-items: center; gap: 10px; margin: 6px 0; font-size: 13px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bar { height: 10px; background: #F1F3F7; border-radius: 5px; overflow: hidden; } .bar span { display: block; height: 100%; border-radius: 5px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 12px; }

/* ---------- приоритеты и ленты ---------- */
.prio-list { display: flex; flex-direction: column; gap: 6px; }
.prio { display: grid; grid-template-columns: 10px 1fr 14px; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); text-decoration: none !important; border-left: 3px solid var(--c); }
.prio:hover { background: #FAFBFD; } .prio-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.feed { display: flex; flex-direction: column; } .feed-item { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); color: var(--text); text-decoration: none !important; font-size: 13px; }
.feed.big .feed-item { padding: 10px 6px; } .feed-item.unread { background: #F5F8FF; } .feed-item:last-child { border: 0; }
.task-list { display: flex; flex-direction: column; gap: 4px; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.task-row:hover { border-color: #C5CEDD; background: #FAFBFD; }
.k-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* ---------- доска ---------- */
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; background: none; cursor: pointer; font: 500 13.5px var(--font); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); } .tab:hover { color: var(--text); }
.tabs.small .tab { padding: 7px 11px; font-size: 13px; }
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-body { min-height: 200px; }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.k-col { flex: 0 0 286px; background: #EEF1F6; border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 250px); border-top: 3px solid var(--col); }
.k-col.over { background: #E2E8F5; outline: 2px dashed var(--col); }
.k-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px; } .k-count { margin-left: auto; background: #fff; border-radius: 10px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.k-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 20px; }
.k-card { border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(20,33,61,.12); transition: transform .08s, box-shadow .12s; }
.k-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(20,33,61,.16); } .k-card:focus { outline: 2px solid var(--accent); }
.k-card.filled { color: #fff; } .k-card.filled .k-title { font-weight: 600; } .k-card.filled .k-extra, .k-card.filled .k-meta { color: rgba(255,255,255,.88); }
.k-card.filled .k-due.late { background: rgba(255,255,255,.25); color: #fff; } .k-card.filled .k-prio { background: rgba(255,255,255,.22); color: #fff; }
.k-card.light { background: #fff; border-left: 4px solid; color: var(--text); }
.k-card.late.light { box-shadow: 0 0 0 1px #FFC9C9, 0 1px 2px rgba(20,33,61,.1); }
.k-title { font-size: 13.5px; line-height: 1.35; word-break: break-word; }
.k-extra { font-size: 12px; } .k-extra .pill { background: rgba(255,255,255,.85); }
.k-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.k-due { display: inline-flex; align-items: center; gap: 3px; } .k-due.late { color: var(--bad); font-weight: 700; background: #FFF0F0; border-radius: 5px; padding: 0 5px; }
.k-prio { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 5px; background: #EEF1F6; }
.k-add { border: 1px dashed #C5CEDD; background: transparent; border-radius: 8px; padding: 6px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 4px; font: inherit; font-size: 12.5px; }
.k-add:hover { background: #fff; color: var(--text); }
.flash { animation: flash 1.2s ease-out; } @keyframes flash { 0% { box-shadow: 0 0 0 3px #FFD43B; } 100% { box-shadow: 0 0 0 0 transparent; } }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); max-height: calc(100vh - 230px); }
.panel .table-wrap { max-height: none; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.grid th { position: sticky; top: 0; z-index: 2; background: #F8F9FC; text-align: left; font-weight: 600; font-size: 12px; color: #4A5468; padding: 8px 10px; border-bottom: 1px solid var(--line); border-top: 3px solid transparent; white-space: nowrap; }
.grid th.rot { font-size: 11px; white-space: normal; min-width: 64px; text-align: center; }
.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; max-width: 420px; }
.grid tr:hover td { background: #FAFBFE; } .grid td.editable { cursor: cell; } .grid td.editable:hover { box-shadow: inset 0 0 0 1px #C5D0EA; }
.grid.compact td { padding: 6px 9px; }
.sticky-col { position: sticky; left: 0; background: #fff; z-index: 1; } th.sticky-col { z-index: 3; background: #F8F9FC; }
.test-row td { background: #FFFBEA; }
.t-longtext span.clamp { -webkit-line-clamp: 3; }
.today-list { display: flex; flex-direction: column; gap: 6px; }
.today-row { display: grid; grid-template-columns: 2.2fr 110px 190px 1.2fr 140px; gap: 12px; align-items: start; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.today-row.done { opacity: .62; }
.calendar { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; } .cal-head b { text-transform: capitalize; min-width: 160px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: 12px; color: var(--muted); text-align: center; padding: 4px; font-weight: 600; }
.cal-cell { min-height: 104px; border: 1px solid var(--line-2); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 3px; background: #FCFDFE; overflow: hidden; }
.cal-cell.off { background: transparent; border-color: transparent; } .cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day { font-size: 12px; font-weight: 600; color: var(--muted); }
.cal-item { text-align: left; font: 11.5px var(--font); padding: 2px 5px; border: 0; border-left: 3px solid; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }

/* ---------- карточка записи ---------- */
.drawer-back { position: fixed; inset: 0; background: rgba(20,33,61,.28); z-index: 50; display: flex; justify-content: flex-end; }
.drawer { width: min(720px, 100vw); height: 100%; background: #fff; box-shadow: var(--sh-2); display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { padding: 14px 20px 10px; border-top: 4px solid; display: flex; flex-direction: column; gap: 8px; } .drawer-head h2 { font-size: 19px; }
.drawer-head select.input { width: auto; }
.drawer .tabs { padding: 0 14px; } .drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 40px; }
.kv { display: flex; flex-direction: column; } .kv-row { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-2); align-items: start; }
.kv-k { font-size: 12.5px; color: var(--muted); padding-top: 7px; display: flex; gap: 4px; align-items: center; } .kv-v { min-width: 0; }
.comments { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; } .comment { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.comment-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.backlink { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; cursor: pointer; text-align: left; font: inherit; }
.timeline { display: flex; flex-direction: column; gap: 12px; } .tl-item { display: grid; grid-template-columns: 12px 1fr; gap: 10px; } .tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
.files { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; } .file-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* ---------- модальные окна ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20,33,61,.38); z-index: 70; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: min(520px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--sh-2); }
.modal-wide { width: min(860px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); } .modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px 18px; overflow-y: auto; } .modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.action-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 9px; box-shadow: var(--sh-2); max-width: 420px; font-size: 13.5px; transition: opacity .3s; }
.toast-ok { background: #2B8A3E; } .toast-error { background: #C92A2A; } .toast.out { opacity: 0; }

/* ---------- сообщения ---------- */
.chat-page { display: grid; grid-template-columns: 300px 1fr; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); height: calc(100vh - 120px); overflow: hidden; max-width: none; }
.chat-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #FAFBFD; }
.chan-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; }
.chan { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--text); text-decoration: none !important; border: 0; border-bottom: 1px solid var(--line-2); background: none; text-align: left; font: inherit; cursor: pointer; }
.chan:hover { background: #F1F4FA; } .chan.active { background: #EDF2FF; } .chan .grow { min-width: 0; display: flex; flex-direction: column; }
.chan-ico { width: 30px; height: 30px; border-radius: 8px; background: #E7ECF7; display: grid; place-items: center; color: var(--accent); flex-shrink: 0; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; } .chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; align-items: flex-start; } .msg.mine { flex-direction: row-reverse; } .bubble { background: #F1F4FA; border-radius: 12px; padding: 8px 12px; max-width: 70%; } .msg.mine .bubble { background: #E7EEFF; }
.composer { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; } .composer textarea { min-height: 44px; }
.perm-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; } .perm-layout .chat-side { border: 1px solid var(--line); border-radius: var(--r); max-height: 75vh; }
.perm-body { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.perm-grid td:first-child { min-width: 220px; }
.nav-edit { display: grid; grid-template-columns: 34px 34px 1fr 180px 130px; gap: 8px; align-items: center; }

/* ---------- вход ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% 0%, #24365E, var(--navy)); padding: 20px; }
.login-card { width: min(400px, 100%); background: #fff; border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--sh-2); }
.brand-big { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; } .brand-big .logo { width: 42px; height: 42px; font-size: 20px; } .brand-big b { display: block; letter-spacing: .03em; } .brand-big small { color: var(--muted); }

/* ---------- адаптивность ---------- */
@media (max-width: 1100px) { .dash-cols, .cols-2 { grid-template-columns: 1fr; } .today-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; } .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--sh-2); } .mobile-only { display: inline-flex; }
  main { padding: 14px; } .user-btn span { display: none; } .form-grid { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .kv-row { grid-template-columns: 1fr; gap: 2px; } .chat-page { grid-template-columns: 1fr; } .chat-side { max-height: 240px; } .perm-layout { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 110px 1fr 46px; } .feed-item { grid-template-columns: 1fr; gap: 0; } .dept-stats { grid-template-columns: repeat(2, 1fr); }
}
@media print { body:not(.printing) { display: none !important; } body.printing { display: block !important; } }   /* 29.11: друк дозволено лише кнопками «Друк» дошки директора */

/* таймлайн */
.timeline-view { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; overflow-x: auto; }
.tlv-head, .tlv-row { display: grid; grid-template-columns: 280px 1fr; gap: 10px; align-items: center; min-width: 820px; }
.tlv-head { height: 30px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.tlv-row { height: 32px; border-bottom: 1px solid var(--line-2); }
.tlv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.tlv-track { position: relative; height: 100%; }
.tlv-month { position: absolute; top: 8px; font-size: 11px; text-transform: capitalize; border-left: 1px solid var(--line); padding-left: 4px; }
.tlv-today { position: absolute; top: 0; bottom: -2000px; border-left: 2px solid var(--bad); opacity: .5; }
.tlv-bar { position: absolute; top: 8px; height: 16px; border-radius: 8px; border: 0; cursor: pointer; opacity: .9; }
.review h3 { margin-top: 0; }

/* Пилот: эффект системы и запросы директору */
.kpi { border: 1px solid var(--line, #E9ECEF); border-radius: 12px; padding: 12px 14px; background: #fff; }
.kpi-v { font-size: 28px; font-weight: 700; color: #1C2B4A; line-height: 1.1; }
.kpi-l { color: #6C757D; font-size: 13px; margin-top: 4px; }
.panel.request { border-left: 4px solid #F08C00; }
.note { background: #FFF4E5; border-left: 4px solid #F08C00; padding: 8px 12px; border-radius: 6px; }

/* 29.11: Дошка директора (макет директора) */

.db{font-family:inherit;color:#1F2937}.db *{box-sizing:border-box}
.db .card{background:#fff;border:1px solid #E5E7EB;border-radius:16px;box-shadow:0 2px 6px rgba(16,24,40,.05)}
.db .pill{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:8px;font-size:12px;font-weight:700;white-space:nowrap}
.db select.bare{border:0;border-radius:8px;font-size:12px;font-weight:700;padding:4px 6px;cursor:pointer;appearance:auto}
.db .day{border:1px solid #E5E7EB;border-radius:14px;background:#fff;min-height:210px;display:flex;flex-direction:column}
.db .day.today{border:2px solid #51CF66;background:#F4FCF6}
.db .dh{padding:10px 12px;border-radius:14px 14px 0 0;background:#F8FAFC;border-bottom:1px solid #EEF0F3}
.db .day.today .dh{background:#D3F9D8}.db .day.mon .dh{background:#E7F0FF}
.db .it{padding:7px 10px;border-bottom:1px solid #F3F4F6;cursor:pointer;font-size:13px}.db .it:hover{background:#F8F9FA}
.db table{width:100%;border-collapse:collapse;font-size:14px}.db th{color:#6B7280;font-weight:600;font-size:12px;text-align:left;padding:8px;border-bottom:1px solid #EEF0F3}
.db td{padding:9px 8px;border-bottom:1px solid #F3F4F6;vertical-align:middle}.db tr.sel td{background:#F3F0FF}
.db .tile{flex:1;min-width:170px;display:flex;gap:14px;align-items:center;padding:20px;border-radius:16px}
.db .ic{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:20px;color:#fff}
.db .chip{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:12px;background:#fff;border:1px solid #FFD8D8;font-size:14px;font-weight:600;cursor:pointer}
.db .lbl{color:#6B7280;width:140px;flex:none}.db .row{display:flex;align-items:center;gap:10px;margin:8px 0}
/* 29.11: «На весь екран» для блоків Дошки директора */
.db .card{position:relative}
.db .fsb{position:absolute;top:10px;right:12px;border:1px solid #E5E7EB;background:#fff;border-radius:8px;padding:4px 10px;font-size:13px;cursor:pointer;z-index:2}
.db .card.full{position:fixed;inset:0;z-index:1000;margin:0!important;border-radius:0;overflow:auto;padding:28px 32px!important;max-height:none}
.db .card.full > div[style*="max-height"]{max-height:none!important}
.db .card.full .fsb{position:fixed;top:14px;right:18px;background:#2563EB;color:#fff;border-color:#2563EB}
.db .hdr-pad{padding-right:140px}
/* 29.11: компактна таблиця й план (директор: «менший шрифт, щоб усе було видно») */
.db table{font-size:12px}
.db th{font-size:11px;padding:5px 4px}
.db td{padding:4px 4px}
.db select.bare{font-size:11px;padding:2px 3px;max-width:140px}
.db td input[type=date]{font-size:11px!important;padding:2px 3px!important;width:118px}
.db td.tt{max-width:260px;font-weight:600;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;border-bottom:0}
.db td button{font-size:11px!important;padding:4px 8px!important}
.db .pill{font-size:11px;padding:2px 7px}
.db td select.bare{max-width:120px}
.db td .tt{max-width:300px!important}
.db td select.bare{max-width:105px}
/* 29.11: друк блоків Дошки директора */
@media print {
  body.printing .sidebar, body.printing .topbar, body.printing .fsb, body.printing .prb, body.printing .no-print { display:none!important }
  body.printing .shell, body.printing .content, body.printing main { display:block!important; margin:0!important; padding:0!important; overflow:visible!important }
  body.printing .db > *:not(.print-on) { display:none!important }
  body.printing .db { padding:0!important; background:#fff!important }
  body.printing .db .card, body.printing .db section { break-inside:avoid; box-shadow:none!important; position:static!important; transform:none!important; max-height:none!important; overflow:visible!important }
  body.printing .db [style*="max-height"] { max-height:none!important; overflow:visible!important }
  body.printing .db .print-day { display:block!important }
  * { -webkit-print-color-adjust:exact; print-color-adjust:exact }
}
.db .print-day { display:none }
.db .prb{position:absolute;top:10px;right:150px;border:1px solid #E5E7EB;background:#fff;border-radius:8px;padding:4px 10px;font-size:13px;cursor:pointer;z-index:2}
