/* Оформление по кабинету Астры (astra-ui.css, home.css, head.css), фон свой: темный без картинки. */
@font-face {
  font-family: Inter;
  src: url('/static/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --space-950: #050911;
  --space-900: #09121e;
  --space-800: #111d2a;
  --card: #eff2f8;
  --card-row: #f6f8fc;
  --line: #dde4ee;
  --text-strong: #111a2a;
  --text-muted: #536580;
  --text-on-dark: #f5f8ff;
  --sub-on-dark: #c9ced6;
  --ice-glow: #aed8ff;
  --accent: #2485ff;
  --accent-tint: #e1efff;
  --danger: #ef5264;
  --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --rail-w: 76px;
  --rail-w-open: 268px;
  --focus-ring: 0 0 0 3px rgb(36 133 255 / 28%);
  --timing: 200ms;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--space-950); color: var(--text-on-dark); font: 400 15px/1.5 var(--font); }
body { touch-action: manipulation; }
input, textarea, select, button { font: inherit; font-size: 16px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* фон: темный, неподвижный, с мягкой подсветкой сверху слева */
.app { position: relative; min-height: 100vh; }
.app::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 600px at 18% -10%, rgb(36 133 255 / 16%), transparent 70%),
    radial-gradient(800px 700px at 100% 110%, rgb(120 160 220 / 9%), transparent 70%),
    linear-gradient(180deg, var(--space-900), var(--space-950));
}

/* рейл: во всю высоту, раскрывается поверх контента, полупрозрачный */
.rail {
  position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: var(--rail-w);
  display: flex; flex-direction: column; overflow: hidden; padding: 0 0 18px;
  border-right: 1px solid rgb(170 190 210 / 16%); background: rgb(5 9 12 / 62%);
  transition: width var(--timing) ease-out;
}
.rail[data-expanded='true'] {
  width: var(--rail-w-open); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 24px 0 60px rgb(0 0 0 / 45%);
}
.rail__top { flex: none; height: 104px; width: var(--rail-w); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.rail__mark { font: 800 19px/1 var(--font); letter-spacing: .06em; color: var(--text-on-dark); text-shadow: 0 0 14px rgb(174 216 255 / 45%); }
.rail__word { font: 500 8.5px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--ice-glow); }
.rail__item {
  position: relative; isolation: isolate; display: grid; grid-template-columns: 52px 1fr; align-items: center;
  min-height: 48px; margin: 3px 12px; padding: 0; border: 0; border-radius: 10px; background: transparent;
  color: var(--text-on-dark); text-decoration: none; text-align: left; font: 500 15px/1 var(--font); cursor: pointer;
}
.rail__item > svg { width: 22px; height: 22px; justify-self: center; }
.rail__item:hover { background: rgb(174 216 255 / 8%); }
.rail__item:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.rail__item[aria-current='page']::before {
  content: ''; position: absolute; left: 1px; top: 7px; bottom: 7px; width: 3px; border-radius: 2px;
  background: #f5f8ff; box-shadow: 0 0 8px rgb(174 216 255 / 75%), 0 0 18px rgb(174 216 255 / 35%);
}
.rail__item[aria-current='page']::after { content: ''; position: absolute; z-index: -1; left: 6px; right: 0; top: 0; bottom: 0; border-radius: 10px; background: rgb(255 255 255 / 4%); }
.rail__label { opacity: 0; visibility: hidden; white-space: nowrap; }
.rail[data-expanded='true'] .rail__label { opacity: 1; visibility: visible; transition: opacity 120ms 80ms ease-out; }
.rail__spacer { flex: 1; }
.rail__avatar {
  flex: none; width: 42px; height: 42px; margin: 10px auto 0 17px; border-radius: 50%;
  display: grid; place-items: center; background: #2a3039; color: #f5f8ff; font: 600 15px/1 var(--font);
}

/* рабочая область и шапка раздела: название, одна строка описания, высота 72 */
.work { position: relative; z-index: 1; margin-left: 110px; padding: 25px 30px 40px 0; min-width: 0; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 20px; height: 72px; margin: 0 0 20px; }
.head > :first-child { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.title { margin: 0; font: 700 34px/42px var(--font); color: #f5f8ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { margin: 6px 0 0; font: 400 16px/24px var(--font); color: var(--sub-on-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head > :not(:first-child) { flex: none; }
.acc { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; max-width: 320px; }
.acc__name { font: 600 15px/1.3 var(--font); color: var(--text-on-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.acc__role { font: 400 13px/1.3 var(--font); color: #8fa0b8; }

/* переход между разделами: новый проявляется, когда пришли данные */
.work > section { transition: opacity 200ms ease-out; }
body.is-routing .work > section { opacity: 0; transition: none; }

/* карточки и кнопки */
.card { overflow: hidden; background: var(--card); border: 1px solid rgb(255 255 255 / 55%); border-radius: 14px; box-shadow: 0 9px 24px rgb(0 0 0 / 18%); color: var(--text-strong); }
.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.bar__grow { flex: 1; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px;
  border: 1px solid rgb(174 216 255 / 30%); background: rgb(17 29 42 / 72%); color: var(--text-on-dark);
  font: 500 15px/1 var(--font); cursor: pointer;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: rgb(174 216 255 / 60%); background: rgb(24 40 58 / 85%); }
.btn:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.btn--primary { border: 0; background: linear-gradient(180deg, #dbe7fe, #c4dbfe); color: #0d1220; box-shadow: 0 0 22px rgb(70 135 230 / 35%); }
.btn--primary:hover { background: linear-gradient(180deg, #e6efff, #cfe2ff); }
.btn:disabled { opacity: .55; cursor: default; }
.search { display: flex; align-items: center; gap: 8px; height: 42px; width: 300px; max-width: 100%; padding: 0 12px; border-radius: 10px;
  border: 1px solid rgb(174 216 255 / 22%); background: rgb(9 18 30 / 70%); color: #9fb0c6; }
.search:focus-within { border-color: rgb(174 216 255 / 70%); box-shadow: var(--focus-ring); }
.search svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text-on-dark); }
.search input:focus, .search input:focus-visible { outline: none; box-shadow: none; }
.search input::placeholder { color: #8394aa; }

/* таблица справочника */
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl th { padding: 14px 16px; background: #e3eaf3; text-align: left; font: 600 13px/1.2 var(--font); color: #3a4352; }
.tbl th:first-child { border-top-left-radius: 14px; }
.tbl th:last-child { border-top-right-radius: 14px; }
.tbl td { padding: 11px 16px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--text-strong); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .c-type { width: 150px; } .tbl .c-own { width: 170px; } .tbl .c-date { width: 130px; }
.tbl td.c-date, .tbl td.c-muted { color: var(--text-muted); }
.tbl tr.grp td { cursor: pointer; }
.tbl tr.grp td:first-child { font-weight: 600; }
.gname { display: flex; align-items: center; min-width: 0; }
.gname > span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tbl tr.grp:hover td { background: #e8eef7; }
.tbl tr.item td { background: var(--card-row); }
.tbl tr.item td:first-child { padding-left: 52px; }
.tbl tr.note td { background: var(--card-row); color: var(--text-muted); font-style: italic; padding-left: 52px; }
.tbl tr:last-child td:first-child { border-bottom-left-radius: 14px; }
.tbl tr:last-child td:last-child { border-bottom-right-radius: 14px; }
.tg { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; margin-right: 10px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; padding: 0; }
.tg svg { width: 14px; height: 14px; stroke-width: 2.4; }
.tg:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.cnt { margin-left: 8px; font-weight: 400; color: var(--text-muted); font-size: 13px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; line-height: 18px; background: #e3e8ef; color: #3b4250; }
.badge--own { background: var(--accent-tint); color: #1d5fc0; }

/* разделы в работе */
.todo { padding: 26px 28px; max-width: 760px; }
.todo h2 { margin: 0 0 8px; font: 650 19px/1.3 var(--font); }
.todo p { margin: 0 0 10px; color: #3a4352; }
.todo ul { margin: 0; padding-left: 20px; color: #3a4352; }
.empty { padding: 22px 16px; color: var(--text-muted); }

/* окно добавления */
.ovl { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgb(3 6 10 / 62%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dlg { width: 100%; max-width: 520px; padding: 22px 24px 24px; }
.dlg h2 { margin: 0 0 16px; font: 650 20px/1.3 var(--font); }
.fld { display: block; margin: 0 0 14px; }
.fld > span { display: block; margin-bottom: 6px; font: 500 13.5px/1.2 var(--font); color: #3a4352; }
.fld input, .fld select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #c9d4e3; border-radius: 10px; background: #fff; color: var(--text-strong); }
.fld input:focus, .fld select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.dlg__err { min-height: 20px; margin: 0 0 10px; color: #c93a3f; font-size: 14px; }
.dlg__btns { display: flex; justify-content: flex-end; gap: 10px; }
.dlg .btn { background: #fff; color: var(--text-strong); border-color: #c9d4e3; }
.dlg .btn--primary { background: var(--accent); color: #fff; border: 0; box-shadow: none; }

@media (max-width: 899px) {
  .rail { width: 60px; }
  .rail__top { width: 60px; height: 64px; }
  .rail__item { margin: 4px 4px; }
  .rail__avatar { margin-left: 9px; }
  .work { margin-left: 76px; padding: 16px 16px 32px 0; }
  .head { height: auto; flex-direction: column; align-items: stretch; gap: 10px; }
  .head > :first-child { height: 64px; }
  .title { font-size: 26px; line-height: 34px; }
  .sub { font-size: 15px; line-height: 22px; }
  .acc { align-items: flex-start; }
  .tbl { table-layout: auto; }
  .tbl .c-own, .tbl .c-date { display: none; }
  .tbl .c-type { width: 104px; }
  .tbl td:first-child { white-space: normal; overflow-wrap: anywhere; }
  .tbl th, .tbl td { padding-left: 12px; padding-right: 10px; }
  .tbl tr.item td:first-child, .tbl tr.note td { padding-left: 44px; }
  .rail__word { font-size: 7px; letter-spacing: .06em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
