/* Навігація ядра: верхня смуга, шухляда, чіп заходу, іконки. */

.ico { display: inline-grid; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; display: block; }

/* Лічильник біля пункту: кількість відкритих заявок. Колір — «увага до
   стану», не дія: це не кнопка, це те, що чекає. */
.tag { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--crit-bg); color: var(--crit); font: 600 11.5px var(--mono); }

/* ─── знак продукту ─── */
.brand { display: flex; align-items: center; gap: 0; flex: none; font-size: 16px; letter-spacing: -.01em; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; margin-right: 9px; display: grid; place-items: center;
  background: var(--action); color: var(--action-ink); }
.brand-mark .ico { width: 17px; height: 17px; }
.brand b { font-weight: 700; }
.brand .tld { color: var(--muted); }

/* ─── верхня смуга ─── */
.bar {
  display: flex; align-items: center; gap: var(--gap-sm);
  padding: 0 var(--gap-sm); height: 56px; flex: none;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.bar h1 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.bar .sub { font-size: 12px; color: var(--dim); }
.bar .grow { flex: 1; }
.bar .icon-btn { color: var(--ink); background: none; }
.bar .icon-btn:hover { background: var(--fill); }
.bar-title { min-width: 0; }
.bar-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar > .brand { display: none; margin: 0 8px 0 2px; }
/* ☰ і знак — одна кнопка шухляди: одне тло при наведенні на обидва. */
.bar-home { display: flex; align-items: center; gap: 4px; padding: 0 10px 0 0; border: 0; border-radius: var(--r);
  background: none; color: var(--ink); font: inherit; cursor: pointer; }
.bar-home:hover { background: var(--fill); }
.bar .bar-home .icon-btn, .bar .bar-home .icon-btn:hover { background: none; }
.bar-home .brand { display: none; }

/* Основні розділи — перемикач-сегмент, лише на широкому екрані. */
.bar-nav { display: none; align-items: center; gap: 2px; padding: 3px; height: 38px;
  background: var(--fill); border-radius: var(--r); }
.bar-nav a { display: flex; align-items: center; gap: 7px; height: 100%; padding: 0 14px;
  border-radius: var(--r-sm); color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.bar-nav a .ico { width: 17px; height: 17px; }
.bar-nav a:hover { color: var(--ink); }
.bar-nav a.on { color: var(--ink); background: var(--seg-on); box-shadow: var(--seg-shadow); }
.bar-nav .tag { min-width: 18px; height: 18px; font-size: 11px; }
@media (min-width: 900px) {
  .bar-nav { display: flex; }
  /* На основних розділах замість заголовка — знак продукту: розділ уже
     видно в сегменті, заголовок його лише повторював би. */
  .bar.on-primary .bar-title { display: none; }
  .bar.on-primary > .brand { display: flex; }
  .bar.on-primary .bar-home .brand { display: flex; }
}

.bar-clock { font: 500 15px var(--sans); color: var(--muted); font-variant-numeric: tabular-nums;
  padding: 0 var(--gap-xs); }
@media (max-width: 560px) { .bar-clock { display: none; } }

/* ─── захід у верхній смузі ─── */
/* Рамка для всього на екрані. Колір крапки — стан заходу; захід, що йде,
   дихає — єдиний рух у смузі, і він каже: дані живі. */
.projchip {
  display: flex; align-items: center; gap: 8px; flex: none; max-width: 46vw;
  background: var(--fill); border: 0; border-radius: var(--r);
  padding: 0 10px 0 12px; height: 38px; cursor: pointer;
  color: var(--ink); font: inherit;
}
.projchip:hover { background: var(--line-str); }
.projchip .dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.projchip.st-active .dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--ok); opacity: 0; animation: live 2.4s ease-out infinite; }
@keyframes live { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .projchip.st-active .dot::after { animation: none; } }
.projchip.st-setup    .dot { background: var(--warn); }
.projchip.st-archived .dot { background: var(--off); }
.projchip .txt { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.projchip .open { display: none; }
.projchip .n { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projchip .st { font-size: 12.5px; color: var(--muted); flex: none; }
.projchip .cv { color: var(--muted); font-size: 11px; flex: none; }
@media (max-width: 560px) { .projchip .st { display: none; } }

/* ─── шухляда меню ─── */
/* Лишається шухлядою (постійної лівої колонки немає). Групи — фоном
   --card, без рамок; заголовок групи тихий і без великих літер. */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: 320px; max-width: 88vw; z-index: 41;
  background: var(--surface); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px; padding: 16px 12px 12px; overflow-y: auto;
}
/* Рух шухляди: виїжджає зліва й ховається назад рівномірно (плавний розгін
   і гальмування), 0,6 с; тло темнішає разом з нею. Без .in — за краєм. */
.scrim:has(> .drawer) { transition: background-color .6s cubic-bezier(.45, 0, .55, 1); }
.scrim:has(> .drawer):not(.in) { background-color: rgba(0,0,0,0); }
.scrim > .drawer { transition: transform .6s cubic-bezier(.45, 0, .55, 1), box-shadow .6s cubic-bezier(.45, 0, .55, 1);
  will-change: transform; }
.scrim:not(.in) > .drawer { transform: translateX(-100%); box-shadow: none; }
.drawer > .brand { padding: 2px 8px 4px; }
.drawer .who { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--card); border-radius: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--action-soft); color: var(--action); font: 600 14px var(--sans); }
.who-t { min-width: 0; }
.drawer .who .n { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer .who .r { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.drawer nav { flex: 1; display: flex; flex-direction: column; }
.drawer .grp { font-size: 11.5px; font-weight: 600; color: var(--dim); padding: 14px 10px 6px; }
.navgrp .items { background: var(--card); border-radius: 12px; overflow: hidden; }
.drawer a {
  display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 46px;
  color: var(--ink); text-decoration: none; cursor: pointer; font-size: 15px;
}
.drawer a + a { box-shadow: inset 0 1px 0 var(--line); }
.drawer a .ico { color: var(--action); }
.drawer a .chev { width: 16px; height: 16px; color: var(--dim); }
.drawer a .lbl { flex: 1; }
.drawer a:hover { background: var(--fill); }
.drawer a.sel { background: var(--action-soft); }

/* Унизу три однакові кнопки: мова, тема, вихід. */
.drawer .foot-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 4px; }
.foot-row .foot-btn, .foot-row .langsel {
  height: var(--touch); width: 100%; min-width: 0; padding: 0 6px; border: 0; border-radius: var(--r);
  background: var(--fill); color: var(--ink); font: 600 14px var(--sans); cursor: pointer;
  text-align: center; text-align-last: center; appearance: none; -webkit-appearance: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.foot-row .foot-btn:hover, .foot-row .langsel:hover { background: var(--line-str); }
