/* ==========================================================
   ТехУчёт — веб-приложение учёта ИТ-оборудования
   Основная таблица стилей
   ========================================================== */

/* ---------- 1. Дизайн-токены (переменные) ---------- */
:root {
  --red: #EF3124;          /* фирменный акцентный цвет (графика, индикаторы) */
  --red-ui: #D4271B;       /* фон кнопок: контраст с белым 5,1:1 */
  --red-dark: #B5211A;     /* состояние :hover и красный текст */
  --red-soft: #FDECEA;     /* фон выделений */
  --ink: #0B1F35;          /* основной текст */
  --ink-2: #5B6B7D;        /* второстепенный текст */
  --line: #E3E7EC;         /* границы и разделители */
  --bg: #F3F4F6;           /* фон страницы */
  --surface: #FFFFFF;      /* фон карточек */
  --green: #08763B;
  --green-soft: #E3F6EC;
  --amber: #8F5B00;
  --amber-soft: #FFF3D6;
  --blue: #2457C5;
  --blue-soft: #E6EEFE;
  --grey-soft: #EDEFF2;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 31, 53, .06), 0 4px 16px rgba(11, 31, 53, .06);
  --sidebar-w: 248px;
  --font: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
}

/* Тёмная тема: переопределяются только токены */
[data-theme="dark"] {
  --ink: #EEF1F5;
  --ink-2: #9AA7B6;
  --line: #2A3442;
  --bg: #0F151D;
  --surface: #17202B;
  --red-dark: #FF7A6E;
  --red-soft: #3A1A18;
  --green: #4ADE80;
  --green-soft: #12301F;
  --amber: #F5B942;
  --amber-soft: #3A2C0E;
  --blue: #7FA6FF;
  --blue-soft: #16264A;
  --grey-soft: #222C38;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

/* ---------- 2. Базовые стили ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p  { margin: 0; }
a  { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.muted { color: var(--ink-2); }

/* ---------- 3. Каркас приложения ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  /* фон левой колонки тянется на всю высоту страницы */
  background: linear-gradient(90deg, var(--surface) calc(var(--sidebar-w) - 1px),
    var(--line) calc(var(--sidebar-w) - 1px) var(--sidebar-w), var(--bg) var(--sidebar-w));
}

/* Боковое меню */
.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column; gap: 24px;
  padding: 24px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand img { width: 40px; height: 40px; }
.brand__name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.brand__sub  { font-size: 12px; color: var(--ink-2); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav__link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav__link svg { width: 20px; height: 20px; flex: none; }
.nav__link:hover { background: var(--grey-soft); color: var(--ink); }
.nav__link.is-active { background: var(--red-soft); color: var(--red-dark); font-weight: 600; }
.nav__count {
  margin-left: auto; min-width: 24px; padding: 0 8px;
  border-radius: 12px; background: var(--red-ui); color: #fff;
  font-size: 12px; font-weight: 600; text-align: center;
}

.sidebar__footer { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }

/* Основная область */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 32px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .topbar__burger { display: none; }
.topbar__search { flex: 1; max-width: 480px; position: relative; }
.topbar__search input { padding-left: 40px; }
.topbar__search svg {
  position: absolute; left: 12px; top: 50%;
  width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-2);
}
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--ink); color: var(--surface);
  font-weight: 700; font-size: 14px;
}
.user__name { font-weight: 600; font-size: 14px; }
.user__role { font-size: 12px; color: var(--ink-2); }

.content { padding: 32px; display: flex; flex-direction: column; gap: 24px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; color: var(--ink-2); }

/* ---------- 4. Компоненты ---------- */

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--red-ui); color: #fff; }
.btn--primary:hover { background: #B5211A; }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--secondary:hover { border-color: var(--ink-2); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--grey-soft); }
.btn--icon { width: 44px; padding: 0; }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Поля форм */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea { border-color: var(--red-ui); }
.field__error { display: none; font-size: 13px; color: var(--red-dark); }
.field.is-invalid .field__error { display: block; }

/* Карточки */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 24px 0;
}
.card__body { padding: 20px 24px 24px; }

/* Статусы */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--amber { background: var(--amber-soft); color: var(--amber); }
.badge--blue  { background: var(--blue-soft);  color: var(--blue); }
.badge--red   { background: var(--red-soft);   color: var(--red-dark); }
.badge--grey  { background: var(--grey-soft);  color: var(--ink-2); }

/* Сетка показателей (KPI) */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { padding: 20px 24px; display: flex; flex-direction: column; gap: 8px; }
.kpi__label { font-size: 14px; color: var(--ink-2); }
.kpi__value { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.kpi__trend { font-size: 13px; font-weight: 600; }
.kpi__trend.up { color: var(--green); }
.kpi__trend.down { color: var(--red-dark); }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }

/* Диаграммы */
.chart { width: 100%; height: 240px; }
.chart text { fill: var(--ink-2); font-size: 12px; font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--ink-2); }
.legend__dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.legend__dot--created { background: var(--ink-2); }
.legend__dot--closed { background: var(--red); }

/* Списки */
.list { list-style: none; margin: 0; padding: 0; }
.list__item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.list__item:last-child { border-bottom: 0; }
.list__main { flex: 1; min-width: 0; }
.list__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__meta { font-size: 13px; color: var(--ink-2); }

/* Панель фильтров */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.toolbar .input { max-width: 320px; }
.toolbar .select { width: auto; min-width: 170px; }
.toolbar__spacer { flex: 1; }

/* Таблица */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 14px 24px; text-align: left; border-bottom: 1px solid var(--line); }
.table th {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-2); white-space: nowrap; cursor: pointer; user-select: none;
}
.table th[aria-sort="ascending"]::after  { content: " ↑"; }
.table th[aria-sort="descending"]::after { content: " ↓"; }
.table tbody tr { transition: background .1s; cursor: pointer; }
.table tbody tr:hover { background: var(--grey-soft); }
.table .inv { font-weight: 700; font-variant-numeric: tabular-nums; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; font-size: 14px; color: var(--ink-2); }
.pager__btns { display: flex; gap: 8px; }

.empty { padding: 48px 24px; text-align: center; color: var(--ink-2); }

/* Карточка оборудования */
.item-hero { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.item-hero__pic {
  aspect-ratio: 1; display: grid; place-items: center;
  border-radius: var(--radius); background: var(--grey-soft); color: var(--ink-2);
}
.item-hero__pic svg { width: 96px; height: 96px; }
.item-title { margin-top: 8px; }
.specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 32px; margin-top: 20px; }
.specs dt { font-size: 13px; color: var(--ink-2); }
.specs dd { margin: 2px 0 0; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Лента событий */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 20px 32px; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--red);
}
.timeline time { font-size: 13px; color: var(--ink-2); }

/* Канбан-доска заявок */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.column { background: var(--grey-soft); border-radius: var(--radius); padding: 12px; min-height: 320px; transition: background .15s; }
.column.is-over { background: var(--red-soft); outline: 2px dashed var(--red); }
.column__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 12px; font-size: 15px; font-weight: 700; }
.column__count { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.ticket {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 10px; cursor: grab; box-shadow: var(--shadow);
}
.ticket.is-dragging { opacity: .5; }
.ticket__top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-2); }
.ticket__title { margin: 6px 0 10px; font-weight: 600; }
.ticket__meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-2); }

/* Склад */
.zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.zone__bar { height: 8px; border-radius: 4px; background: var(--grey-soft); overflow: hidden; margin: 12px 0 8px; }
.zone__bar span { display: block; height: 100%; background: var(--red); border-radius: 4px; }
.inventory { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.progress-ring { width: 120px; height: 120px; }

/* Модальное окно */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 16px; background: rgba(11, 31, 53, .5);
}
.modal.is-open { display: flex; }
.modal__dialog {
  width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border-radius: var(--radius); padding: 24px;
  animation: pop .18s ease-out;
}
.modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.modal__foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* Всплывающее уведомление */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  padding: 14px 20px; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--surface); font-weight: 500;
  box-shadow: var(--shadow);
  transform: translateY(150%); transition: transform .25s ease;
}
.toast.is-show { transform: none; }

/* ---------- 5. Страница входа ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth__promo {
  background: var(--red-ui); color: #fff; padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth__promo h1 { font-size: 40px; max-width: 420px; }
.auth__promo p { margin-top: 16px; max-width: 420px; }
.auth__facts { display: flex; gap: 32px; }
.auth__facts b { display: block; font-size: 28px; }
.auth__form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.auth__box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 20px; }
.auth__title { font-size: 24px; }
.auth__hint { margin-top: 4px; color: var(--ink-2); }
.auth__note { font-size: 13px; color: var(--ink-2); }
.password { position: relative; }
.password .btn { position: absolute; right: 2px; top: 2px; height: 40px; }

/* ---------- 6. Адаптивность ---------- */

/* Ноутбуки и небольшие мониторы */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

/* Планшеты: меню становится выезжающим */
@media (max-width: 992px) {
  .app { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50;
    width: var(--sidebar-w);
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.is-open { transform: none; }
  .topbar .topbar__burger { display: inline-flex; }
  .topbar { padding: 12px 24px; }
  .content { padding: 24px; }
  .board { grid-template-columns: 1fr 1fr; }
  .zones { grid-template-columns: 1fr 1fr; }
  .user__text { display: none; }
}

/* Большие смартфоны и маленькие планшеты */
@media (max-width: 768px) {
  h1 { font-size: 24px; }
  .auth { grid-template-columns: 1fr; }
  .auth__promo { padding: 32px 24px; gap: 24px; }
  .auth__promo h1 { font-size: 28px; }
  .item-hero { grid-template-columns: 1fr; }
  .item-hero__pic { aspect-ratio: auto; height: 160px; }
  .board { grid-template-columns: 1fr; }
  .zones { grid-template-columns: 1fr; }

  /* Таблица превращается в список карточек */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table td { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border: 0; }
  .table td::before { content: attr(data-label); color: var(--ink-2); font-size: 13px; }
}

/* Смартфоны */
@media (max-width: 480px) {
  .topbar { padding: 12px 16px; gap: 8px; }
  .topbar__search { display: none; }
  .content { padding: 16px; gap: 16px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 16px; }
  .kpi__value { font-size: 24px; }
  .card__head { padding: 16px 16px 0; }
  .card__body { padding: 16px; }
  .toolbar { padding: 12px 16px; }
  .toolbar .input, .toolbar .select { max-width: none; width: 100%; }
  .specs { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .page-head .btn { width: 100%; }
  .toast { left: 16px; right: 16px; bottom: 16px; }
}

/* Уважение к настройкам ОС: уменьшение анимаций */
/* Дополнительные интерактивные стили для демонстрации практики */
.btn--danger { background: #DC2626; color: #fff; }
.btn--danger:hover { background: #B91C1C; }
.btn--success { background: #16A34A; color: #fff; }
.btn--success:hover { background: #15803D; }

.kpi--interactive {
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.kpi--interactive:hover {
  transform: translateY(-2px);
  border-color: var(--red-dark);
  box-shadow: 0 4px 18px rgba(11, 31, 53, .12);
}

.list__item--interactive {
  cursor: pointer;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background .12s ease;
}
.list__item--interactive:hover {
  background: var(--grey-soft);
}

.modal__dialog--lg {
  max-width: 840px;
}

/* Печатные официальные документы (Акты) */
.doc-sheet {
  background: var(--surface);
  color: var(--ink);
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
}
.doc-sheet h3 {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 4px;
  font-size: 17px;
}
.doc-sheet .doc-subtitle {
  text-align: center;
  color: var(--ink-2);
  margin-bottom: 20px;
  font-size: 13px;
}
.doc-props {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  margin-bottom: 20px;
  font-size: 13px;
}
.doc-props dt { color: var(--ink-2); font-size: 12px; }
.doc-props dd { margin: 0; font-weight: 600; }
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 13px;
}
.doc-table th, .doc-table td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}
.doc-table th {
  background: var(--grey-soft);
  font-weight: 600;
  color: var(--ink);
}
.doc-sign-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.doc-sign-line {
  border-bottom: 1px solid var(--ink);
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-2);
}

/* Счётчики расходников */
.stock-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.stock-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.stock-btn:hover {
  background: var(--grey-soft);
  border-color: var(--ink-2);
}

/* Уведомления и меню профиля */
.bell-wrap { position: relative; }
.bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.notif-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
  display: none;
  animation: pop .15s ease-out;
}
.notif-menu.is-open { display: block; }
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.notif-head h3 { font-size: 15px; }
.notif-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 0;
}
.notif-item {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  cursor: pointer;
  transition: background .1s;
}
.notif-item:hover { background: var(--grey-soft); }
.notif-item:last-child { border-bottom: 0; }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex: none;
}
.notif-dot--red { background: var(--red); }
.notif-dot--amber { background: var(--amber); }
.notif-dot--blue { background: var(--blue); }

.user-wrap { position: relative; cursor: pointer; }
.user-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
  padding: 16px;
  display: none;
  animation: pop .15s ease-out;
}
.user-menu.is-open { display: block; }
.user-menu__badge {
  display: inline-block;
  padding: 3px 8px;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.auth__demo-box {
  background: var(--grey-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Печатная версия */
@media print {
  .sidebar, .topbar, .pager, .toolbar, .actions, .modal__head button, .modal__foot, .btn, .nav, .sidebar__footer {
    display: none !important;
  }
  .app {
    display: block !important;
    background: #fff !important;
  }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  .modal {
    position: static !important;
    display: block !important;
    background: none !important;
    padding: 0 !important;
  }
  .modal__dialog {
    max-width: 100% !important;
    max-height: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
  .doc-sheet {
    border: none !important;
    padding: 0 !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
