/* ==========================================================================
   Портал Проектного офиса — оформление интерфейса
   ========================================================================== */

:root {
  --paper: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --surface-3: #eef1f7;
  --ink: #16202f;
  --ink-soft: #4a5568;
  --ink-faint: #7b869b;
  --line: #dde2ea;
  --line-soft: #eaeef4;

  --indigo: #1f4e9e;
  --indigo-deep: #163a78;
  --indigo-soft: #e8eefa;
  --gold: #9a7016;
  --gold-soft: #f8f1df;

  --ok: #1f7a4d;
  --ok-soft: #e4f4ea;
  --warn: #a8620f;
  --warn-soft: #fdf0e0;
  --danger: #a52f2f;
  --danger-soft: #fbe9e9;
  --violet: #6f45c9;

  --radius: 8px;
  --radius-sm: 5px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 51, .07);
  --shadow: 0 4px 16px rgba(20, 32, 51, .09);
  --shadow-lg: 0 16px 48px rgba(20, 32, 51, .18);

  --sidebar-w: 250px;
  --header-h: 58px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11151c;
    --surface: #191f28;
    --surface-2: #1e252f;
    --surface-3: #252d39;
    --ink: #e7eaf0;
    --ink-soft: #a9b2c1;
    --ink-faint: #7b8497;
    --line: #303948;
    --line-soft: #242c37;
    --indigo: #7ea3ec;
    --indigo-deep: #a2bdf4;
    --indigo-soft: #1e2a41;
    --gold: #d3a94f;
    --gold-soft: #2c2617;
    --ok: #5fbf90;
    --ok-soft: #14291f;
    --warn: #d7994f;
    --warn-soft: #2c2114;
    --danger: #e07878;
    --danger-soft: #2e1a1a;
    --violet: #a184e8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .6);
  }
}

:root[data-theme="dark"] {
  --paper: #11151c; --surface: #191f28; --surface-2: #1e252f; --surface-3: #252d39;
  --ink: #e7eaf0; --ink-soft: #a9b2c1; --ink-faint: #7b8497;
  --line: #303948; --line-soft: #242c37;
  --indigo: #7ea3ec; --indigo-deep: #a2bdf4; --indigo-soft: #1e2a41;
  --gold: #d3a94f; --gold-soft: #2c2617;
  --ok: #5fbf90; --ok-soft: #14291f; --warn: #d7994f; --warn-soft: #2c2114;
  --danger: #e07878; --danger-soft: #2e1a1a; --violet: #a184e8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 4px 16px rgba(0,0,0,.45); --shadow-lg: 0 16px 48px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 3px; }

/* ---------- Вход в систему ------------------------------------------------ */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--surface);
}
.login-hero {
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(255, 255, 255, .16), transparent 60%),
    linear-gradient(155deg, #163a78 0%, #1f4e9e 52%, #2a63c0 100%);
  color: #fff;
  padding: 52px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-hero .emblem {
  width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .55);
  display: grid; place-items: center; font-size: 24px; margin-bottom: 26px;
}
.login-hero h1 { font-size: 30px; line-height: 1.22; margin-bottom: 14px; max-width: 17ch; }
.login-hero .ministry { font-size: 12.5px; letter-spacing: .09em; text-transform: uppercase; opacity: .82; margin-bottom: 30px; max-width: 40ch; }
.login-hero p.lead { font-size: 15.5px; opacity: .92; max-width: 46ch; }
.login-hero ul { list-style: none; padding: 0; margin: 26px 0 0; font-size: 14px; opacity: .9; }
.login-hero ul li { padding-left: 22px; position: relative; margin-bottom: 8px; }
.login-hero ul li::before { content: "—"; position: absolute; left: 0; opacity: .65; }
.login-hero .foot { font-size: 12px; opacity: .7; }

.login-form-wrap { display: grid; place-items: center; padding: 40px 32px; }
.login-form { width: 100%; max-width: 384px; }
.login-form h2 { font-size: 21px; margin-bottom: 6px; }
.login-form .hint { color: var(--ink-faint); font-size: 13px; margin-bottom: 26px; }
.demo-box {
  margin-top: 26px; padding: 14px 16px; background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: var(--radius); font-size: 12.5px; color: var(--ink-soft);
}
.demo-box b { color: var(--ink); }
.demo-box code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 3px; }
.demo-accounts { display: grid; gap: 4px; margin-top: 8px; }
.demo-accounts button {
  text-align: left; background: none; border: none; padding: 3px 0; cursor: pointer;
  color: var(--indigo); font-size: 12.5px; font-family: inherit;
}
.demo-accounts button:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 34px 26px; }
  .login-hero h1 { font-size: 24px; }
  .login-hero ul, .login-hero .foot { display: none; }
}

/* ---------- Каркас приложения --------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--indigo-deep);
  color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { padding: 18px 20px; border-bottom: 1px solid rgba(255, 255, 255, .13); }
.sidebar-brand .title { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.sidebar-brand .sub { font-size: 11px; opacity: .68; letter-spacing: .05em; text-transform: uppercase; margin-top: 4px; }

.nav { padding: 12px 10px; flex: 1; }
.nav-group-title {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  opacity: .5; padding: 14px 10px 6px; font-weight: 600;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .87); font-size: 13.5px; text-decoration: none; margin-bottom: 1px;
}
.nav a:hover { background: rgba(255, 255, 255, .1); text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .17); color: #fff; font-weight: 600; }
.nav a .icon { width: 18px; text-align: center; font-size: 14px; opacity: .95; flex: none; }
.nav a .badge {
  margin-left: auto; background: #d64545; color: #fff; border-radius: 10px;
  padding: 0 6px; font-size: 11px; font-weight: 700; min-width: 18px; text-align: center;
}
.sidebar-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.13); font-size: 11px; opacity: .55; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; position: sticky; top: 0; z-index: 30;
}
.burger { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ink); }

.search-box { position: relative; flex: 1; max-width: 460px; }
.search-box input {
  width: 100%; height: 34px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 0 12px 0 32px; font-size: 13.5px; color: var(--ink); font-family: inherit;
}
.search-box .mag { position: absolute; left: 10px; top: 8px; opacity: .45; font-size: 13px; pointer-events: none; }
.search-box kbd {
  position: absolute; right: 8px; top: 7px; font-size: 10.5px; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; background: var(--surface);
}
.search-results {
  position: absolute; top: 40px; left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 460px; overflow-y: auto; z-index: 60;
}
.search-results .group-title {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
  padding: 10px 14px 4px; font-weight: 600;
}
.search-results a { display: block; padding: 8px 14px; color: var(--ink); border-bottom: 1px solid var(--line-soft); }
.search-results a:hover { background: var(--surface-2); text-decoration: none; }
.search-results .r-title { font-weight: 500; font-size: 13.5px; }
.search-results .r-meta { font-size: 12px; color: var(--ink-faint); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: none; cursor: pointer; font-size: 15px; color: var(--ink-soft); position: relative;
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn .dot {
  position: absolute; top: 4px; right: 4px; background: #d64545; color: #fff;
  font-size: 9.5px; font-weight: 700; border-radius: 9px; padding: 0 4px; min-width: 15px; line-height: 15px;
}
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 5px;
  border-radius: 20px; cursor: pointer; border: 1px solid var(--line); background: var(--surface-2);
}
.user-chip:hover { background: var(--surface-3); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--indigo); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none;
}
.user-chip .u-name { font-size: 12.5px; font-weight: 500; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .u-role { font-size: 10.5px; color: var(--ink-faint); }

.content { padding: 22px 24px 60px; flex: 1; min-width: 0; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .titles { min-width: 0; flex: 1 1 260px; }
.page-head .subtitle { color: var(--ink-faint); font-size: 13px; margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumbs { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 8px; }
.breadcrumbs a { color: var(--ink-faint); }

@media (max-width: 700px) {
  .page-head { flex-direction: column; align-items: stretch; }
  /* в колоночной раскладке flex-basis влияет на высоту — сбрасываем его */
  .page-head .titles { flex: none; }
  .page-actions { width: 100%; }
  .page-actions .btn, .page-actions a.btn { flex: 1 1 auto; justify-content: center; }
  .filters { grid-template-columns: 1fr; }
  .filters .field.wide { grid-column: span 1; }
  .modal { max-height: 100vh; border-radius: 0; }
  .modal-scrim { padding: 0; }
  .def-list { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 19px; }
  .kanban-col, .kanban-col { width: 84vw; min-width: 84vw; }
  .cal-cell { min-height: 66px; font-size: 11px; }
  .notif-panel { right: 6px; left: 6px; width: auto; }
}

@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 100;
    transform: translateX(-100%); transition: transform .2s ease; height: 100%;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .burger { display: block; }
  .content { padding: 16px 14px 60px; }
  .search-box kbd { display: none; }
  .user-chip .u-name, .user-chip .u-role { display: none; }
}

.scrim { position: fixed; inset: 0; background: rgba(10, 16, 26, .45); z-index: 90; }

/* ---------- Кнопки -------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-weight: 500; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn-primary:hover { background: var(--indigo-deep); border-color: var(--indigo-deep); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-ghost { border-color: transparent; background: none; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-lg { height: 40px; font-size: 15px; padding: 0 20px; }

/* ---------- Карточки ------------------------------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.card-head > .muted { flex: 0 1 auto; text-align: right; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 11px 16px; border-top: 1px solid var(--line-soft); background: var(--surface-2); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(310px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

/* Колонка сетки: карточки внутри остаются в своей ячейке */
.col-stack { min-width: 0; }
.col-stack > .card:last-child { margin-bottom: 0; }

/* ---------- Показатели ---------------------------------------------------- */
.kpi {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--indigo); }
.kpi.gold::before { background: var(--gold); }
.kpi.ok::before { background: var(--ok); }
.kpi.warn::before { background: var(--warn); }
.kpi.danger::before { background: var(--danger); }
.kpi .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); font-weight: 600; }
.kpi .value { font-size: 25px; font-weight: 700; margin-top: 5px; letter-spacing: -.01em; }
.kpi .value.sm { font-size: 19px; }
.kpi .note { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }

/* ---------- Таблицы ------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 600; padding: 9px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; z-index: 2;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--indigo); }
table.data th .arrow { opacity: .55; font-size: 9px; margin-left: 3px; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data.registry { min-width: 1180px; }
table.data.registry td:nth-child(2) { min-width: 300px; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tr.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
table.data tr.row-stale td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .code { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
table.data .strong { font-weight: 500; }
.t-main { font-weight: 500; }
.t-sub { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }

/* ---------- Значки и метки ------------------------------------------------ */
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  border-radius: 20px; padding: 2px 9px; background: var(--surface-3); color: var(--ink-soft); white-space: nowrap;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-indigo { background: var(--indigo-soft); color: var(--indigo); }
.tag-gold { background: var(--gold-soft); color: var(--gold); }
.tag-plain { background: transparent; border: 1px solid var(--line); }

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }

.progress { height: 5px; background: var(--surface-3); border-radius: 4px; overflow: hidden; min-width: 60px; }
.progress > span { display: block; height: 100%; background: var(--ok); border-radius: 4px; }

/* ---------- Формы --------------------------------------------------------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
.field .req { color: var(--danger); margin-left: 2px; }
.field .help { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="url"], input[type="search"], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 13.5px; font-family: inherit; color: var(--ink);
  background: var(--surface); min-height: 34px;
}
textarea { min-height: 82px; resize: vertical; line-height: 1.5; }
select { cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--ink-faint); cursor: not-allowed; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; cursor: pointer; margin-bottom: 8px; }
.checkbox input { width: 15px; height: 15px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--indigo); }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.form-section-title {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
  font-weight: 700; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft);
}
.form-section-title:first-child { margin-top: 0; }

.filters {
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); margin-bottom: 14px; align-items: end;
}
.filters .field { margin: 0; min-width: 0; }
.filters .field.wide { grid-column: span 2; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 20px;
  padding: 4px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit; color: var(--ink-soft);
}
.chip:hover { border-color: var(--indigo); color: var(--indigo); }
.chip.active { background: var(--indigo); border-color: var(--indigo); color: #fff; font-weight: 600; }

/* ---------- Модальные окна ------------------------------------------------ */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(11, 18, 30, .55);
  display: grid; place-items: center; z-index: 200; padding: 20px; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px; max-height: 92vh; display: flex; flex-direction: column;
}
.modal.wide { max-width: 900px; }
.modal.narrow { max-width: 440px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 10px 10px; }

/* ---------- Уведомления --------------------------------------------------- */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: 400px; }
.toast {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--indigo);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 11px 15px; font-size: 13.5px;
}
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast .t-title { font-weight: 600; margin-bottom: 2px; }
.toast .t-body { color: var(--ink-soft); font-size: 12.5px; }

.notif-panel {
  position: fixed; top: var(--header-h); right: 12px; width: 400px; max-width: calc(100vw - 24px);
  max-height: 74vh; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 120; display: flex; flex-direction: column;
}
.notif-panel .head { padding: 12px 15px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.notif-list { overflow-y: auto; }
.notif-item { padding: 11px 15px; border-bottom: 1px solid var(--line-soft); display: block; color: var(--ink); }
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item.unread { background: var(--indigo-soft); }
.notif-item .n-title { font-weight: 600; font-size: 13px; }
.notif-item .n-body { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; white-space: pre-line; }
.notif-item .n-time { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }

/* ---------- Прочие элементы ----------------------------------------------- */
.empty { padding: 42px 20px; text-align: center; color: var(--ink-faint); }
.empty .icon { font-size: 30px; opacity: .35; margin-bottom: 10px; }
.empty h3 { color: var(--ink-soft); margin-bottom: 5px; }

.callout {
  border-left: 3px solid var(--gold); background: var(--gold-soft);
  padding: 11px 15px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; margin-bottom: 14px;
}
.callout.info { border-color: var(--indigo); background: var(--indigo-soft); }
.callout.danger { border-color: var(--danger); background: var(--danger-soft); }
.callout.ok { border-color: var(--ok); background: var(--ok-soft); }

.spinner {
  width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--indigo);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  border: none; background: none; padding: 9px 14px; font-size: 13.5px; font-family: inherit;
  color: var(--ink-soft); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--indigo); border-bottom-color: var(--indigo); font-weight: 600; }

.def-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 22px; }
.def-list dt { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; margin-bottom: 3px; }
.def-list dd { margin: 0; font-size: 13.5px; }
.def-list > div { min-width: 0; }

/* Дорожная карта */
.step-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.step-row:last-child { border-bottom: none; }
.step-check {
  width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--line);
  background: var(--surface); cursor: pointer; flex: none; display: grid; place-items: center;
  font-size: 12px; color: transparent; margin-top: 1px;
}
.step-check.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.step-check:disabled { cursor: not-allowed; opacity: .55; }
.step-main { flex: 1; min-width: 0; }
.step-title { font-weight: 500; }
.step-title.done { text-decoration: line-through; color: var(--ink-faint); }
.step-meta { font-size: 12px; color: var(--ink-faint); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }

.gantt { display: grid; gap: 4px; margin-top: 6px; }
.gantt-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 12px; align-items: center; font-size: 12.5px; }
.gantt-track { position: relative; height: 20px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.gantt-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; min-width: 5px; }
.gantt-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .75; }

/* Лента комментариев */
.feed-item { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.feed-item:last-child { border-bottom: none; }
.feed-body { flex: 1; min-width: 0; }
.feed-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.feed-author { font-weight: 600; font-size: 13px; }
.feed-time { font-size: 11.5px; color: var(--ink-faint); }
.feed-text { font-size: 13.5px; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.feed-text .mention { color: var(--indigo); font-weight: 600; }

/* Файлы */
.file-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.file-row:last-child { border-bottom: none; }
.file-icon { width: 30px; height: 30px; border-radius: 5px; background: var(--indigo-soft); color: var(--indigo); display: grid; place-items: center; font-size: 13px; flex: none; }
.file-name { font-size: 13.5px; font-weight: 500; word-break: break-all; }
.file-meta { font-size: 11.5px; color: var(--ink-faint); }
.dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 20px;
  text-align: center; color: var(--ink-faint); font-size: 13px; cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-soft); }

/* Kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban-col { min-width: 268px; width: 268px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius); flex: none; }
.kanban-col.drag-over { border-color: var(--indigo); background: var(--indigo-soft); }
.kanban-col-head { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.kanban-col-head .count { margin-left: auto; background: var(--surface-3); border-radius: 10px; padding: 0 7px; font-size: 11.5px; color: var(--ink-soft); }
.kanban-cards { padding: 8px; display: grid; gap: 7px; min-height: 60px; max-height: 66vh; overflow-y: auto; }
.kanban-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 10px; font-size: 13px; box-shadow: var(--shadow-sm); cursor: grab; }
.kanban-card:hover { border-color: var(--indigo); }
.kanban-card.dragging { opacity: .45; }
.kanban-card .kc-code { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.kanban-card .kc-title { font-weight: 500; margin: 3px 0 6px; }
.kanban-card .kc-meta { font-size: 11.5px; color: var(--ink-faint); display: flex; gap: 8px; flex-wrap: wrap; }

/* Календарь */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.cal-dow { background: var(--surface-2); padding: 7px; text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 600; }
.cal-cell { background: var(--surface); min-height: 104px; padding: 5px 6px; min-width: 0; }
.cal-cell.other { background: var(--surface-2); }
.cal-cell.today { background: var(--indigo-soft); }
.cal-daynum { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 3px; }
.cal-cell.today .cal-daynum { color: var(--indigo); }
.cal-event { display: block; font-size: 11px; padding: 2px 5px; border-radius: 3px; margin-bottom: 2px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event:hover { text-decoration: none; filter: brightness(1.1); }

/* Карта мира */
.worldmap { width: 100%; height: auto; display: block; }
.worldmap .region { cursor: pointer; transition: opacity .15s; stroke: var(--surface); stroke-width: 1.4; }
.worldmap .region:hover { opacity: .82; }
.worldmap .region-label {
  font-size: 15px; font-weight: 600; pointer-events: none;
  paint-order: stroke; stroke-width: 4px; stroke-linejoin: round;
}
.worldmap .region-count {
  font-size: 27px; font-weight: 700; pointer-events: none;
  paint-order: stroke; stroke-width: 4px; stroke-linejoin: round;
}
.worldmap .region:hover path { opacity: .85; }

/* Диаграммы */
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; font-size: 12.5px; }
.chart-legend .item { display: flex; align-items: center; gap: 6px; }
.chart-legend .swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.bar-list { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2.2fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 18px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; min-width: 3px; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; white-space: nowrap; }

.attention-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.attention-item:last-child { border-bottom: none; }
.attention-item .marker { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: none; }
.attention-item .a-title { font-size: 13px; font-weight: 500; }
.attention-item .a-meta { font-size: 11.5px; color: var(--ink-faint); }
.attention-item .a-right { margin-left: auto; font-size: 11.5px; white-space: nowrap; }

.audit-change { font-size: 12px; font-family: var(--mono); }
.audit-change .from { color: var(--danger); text-decoration: line-through; }
.audit-change .to { color: var(--ok); }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

.pagination { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 14px; font-size: 13px; }
