/* ТендерРасчёт — общий слой интерфейса (сессия 54): шрифт, фон, единая шапка, чипы.
   Подключается из base.html. Старый style.css не трогаем. */

@font-face {
  font-family: "Inter";
  font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-cyrillic-wght.woff2") format("woff2-variations"), url("/static/fonts/inter-cyrillic-wght.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-latin-wght.woff2") format("woff2-variations"), url("/static/fonts/inter-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ui-ink: #2f2a4a;
  --ui-muted: #797586;
  --ui-accent: #754df0;
  --ui-accent-soft: #e6e3fe;
  --ui-hdr: #e8eaf9;
  --ui-line: #eceaf5;
  --ui-tile: #f3f4f8;
  --ui-font: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Фон: спокойный градиент вместо цветных пятен */
body { background: linear-gradient(180deg, #f3f4f8 0%, #eef0fb 100%) fixed; min-height: 100vh; }
.bg-glow { display: none; }

/* ---------- Единая шапка ---------- */
.apphdr {
  position: sticky; top: 10px; z-index: 60;
  width: calc(100% - 32px); max-width: 1440px; margin: 10px auto 6px;
  background: var(--ui-hdr); border-radius: 14px;
  box-shadow: 0 6px 18px rgba(47, 42, 74, 0.08);
  font-family: var(--ui-font); color: var(--ui-ink);
}
.apphdr-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  min-height: 52px; padding: 6px 14px;
}
.apphdr-brand { flex: none; display: flex; align-items: center; }
.apphdr-brand img { height: 30px; width: auto; display: block; }
.apphdr-nav { display: flex; align-items: center; gap: 2px; flex: 1 1 320px; min-width: 0; flex-wrap: wrap; }
.apphdr-nav > a, .apphdr-nav .nav-dd > summary {
  display: block; padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 500;
  color: var(--ui-muted); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s;
}
.apphdr-nav > a:hover, .apphdr-nav .nav-dd > summary:hover { background: rgba(117, 77, 240, 0.08); color: var(--ui-ink); }
.apphdr-nav > a.active, .apphdr-nav .nav-dd.active > summary, .apphdr-nav .nav-dd[open] > summary {
  background: #fff; color: var(--ui-accent); font-weight: 600;
}
.apphdr details.nav-dd { position: relative; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.nav-dd > summary { list-style: none; user-select: none; }
.nav-dd > summary::-webkit-details-marker { display: none; }
.nav-dd > summary::after { content: ""; display: inline-block; margin-left: 7px; width: 5px; height: 5px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .6; }
.nav-dd-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px; z-index: 1100; padding: 6px;
  background: #fff; border: 1px solid var(--ui-line); border-radius: 12px; box-shadow: 0 12px 32px rgba(47, 42, 74, 0.16);
}
.apphdr-nav .nav-dd-menu a {
  display: block; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--ui-ink); text-decoration: none; white-space: nowrap;
}
.apphdr-nav .nav-dd-menu a:hover { background: var(--ui-tile); }
.apphdr-nav .nav-dd-menu a.active { background: var(--ui-accent-soft); color: var(--ui-accent); font-weight: 600; }

.apphdr-status { flex: none; display: flex; align-items: center; gap: 8px; }
.apphdr-clock { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15;
  padding-left: 14px; border-left: 1px solid rgba(47, 42, 74, 0.12); }
.apphdr-clock .tc-time { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.apphdr-clock .tc-date { font-size: 10.5px; color: var(--ui-muted); white-space: nowrap; }

.apphdr-user { flex: none; display: flex; align-items: center; gap: 10px; }
#notif-bell-wrap { margin: 0 !important; }
#notif-bell-btn { width: 36px; height: 36px; border-radius: 50% !important; padding: 0 !important; background: #fff !important;
  box-shadow: none !important; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.apphdr-who { display: flex; align-items: center; gap: 9px; }
.apphdr-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ui-accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.tu-name { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.tu-name b { font-size: 12.5px; font-weight: 600; }
.tu-name span { font-size: 10.5px; color: var(--ui-muted); }
.apphdr-logout { margin: 0; }
.apphdr-logout button { background: #fff !important; color: var(--ui-ink) !important; box-shadow: none !important;
  padding: 7px 12px !important; font-size: 12px !important; border-radius: 10px !important; font-family: var(--ui-font); }
.apphdr-sub { padding: 0 16px 10px; font-size: 12px; color: var(--ui-muted); }
.apphdr-sub:empty { display: none; }

@media (max-width: 1150px) { .apphdr-clock .tc-date { display: none; } }
@media (max-width: 1000px) { .tu-name { display: none; } }
@media (max-width: 980px) { .apphdr-clock { display: none; } }
@media (max-width: 760px) {
  .apphdr-nav { order: 5; flex: 1 1 100%; padding-bottom: 4px; }
  .apphdr-user { margin-left: auto; }
}
@media (max-width: 560px) {
  .apphdr { width: calc(100% - 20px); top: 6px; }
  .tu-name { display: none; }
}

/* ---------- Чипы-метки ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.4; white-space: nowrap;
  background: var(--ui-tile); color: var(--ui-muted); border: 1px solid transparent;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip--ok   { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.chip--warn { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.chip--bad  { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.chip--info { background: var(--ui-accent-soft); color: var(--ui-accent); border-color: #dbd6f0; }
.chip--mute { background: var(--ui-tile); color: var(--ui-muted); }
.chip--plain::before { display: none; }

/* Страница шире для редизайненных экранов */
.page.page-rd { max-width: 1440px; padding: 8px clamp(12px, 2vw, 28px) 60px; }
