/* ts-sidebar.css — те, що в боковому меню Tariscope СВОЄ.
   Спільна частина (рядки, плитки значків, вікно підменю, «рейка», закріплені, капсула, висувне меню, анімації) — css/fregat-sidebar.css:
   його збирає агент Атласа зі свого app.css, руками не правити; потрібна зміна — до нього. Цей файл підключається ПІСЛЯ спільного. */

/* Розміри піктограм у плитках задає спільний файл (з 18.11 20:40); тут — лише шпилька */
.nav-row-ic, .rail-fly-ico { position: relative; }
.nav-pin svg, .nav-pins-t svg { width: 14px; height: 14px; }
.nav-row, .nav-back, .rail-btn { background-color: transparent; border: 0; cursor: pointer; text-decoration: none; }

/* Логотип у шапці меню — у кольорі іконки Tariscope (бурштин, як favicon.svg; Артьом 18.11: «у кожної системи свій колір») */
#sidebar .atlas-logo { background-image: radial-gradient(circle at 30% 20%, rgba(255,255,255,.35), rgba(255,255,255,0) 60%), linear-gradient(135deg, #fcd34d, #d97706 55%, #92400e); }
#sidebar-logo-container:hover .atlas-logo { box-shadow: 0 6px 20px rgba(217,119,6,.45); }

/* Каркас: меню на компʼютері стоїть у потоці (згортання до 68 px зсуває сторінку), на телефоні — висувне поверх */
@media (min-width: 1024px) { #sidebar { position: relative; transform: none !important; } }
#main-content { scroll-padding-top: 16px; }

/* Мобільна шапка: назва розділу дрібно над назвою сторінки (як в Атласі) */
#mobile-header { position: relative; z-index: 10; }
/* телефон: мітка розділу й назва сторінки — як в Атласі (typography/README.md, розділ 2) */
#mobile-sec { font-size: 10px; font-weight: 600; letter-spacing: .12em; color: #9333ea; }   /* суцільний: .8-прозорий давав 2,93 (поправка стандарту 19.11) */
html.dark #mobile-sec { color: rgba(216, 180, 254, .7); }
#mobile-title { font-size: 15px; font-weight: 600; line-height: 1.25; }

@media print { #sidebar, #sidebar-overlay, #mobile-header, #rail-flyout { display: none !important; } }

/* ═══ Шапка меню як у Fregat CRM (Артьом 19.11: «дописать как в шапке црм уведомления и поиск лупы с анимацией чтобы в одном стиле было»;
       зразок — /Users/Shared/fregat-ui-kit/bell-popover/). Назва зліва, праворуч блок 86 × 40: дзвіночок і лупа, обидві 40 × 40. ═══ */
.sb-tri { z-index: 0; }
#sidebar.sidebar-collapsed .sb-tri, #sidebar.sidebar-rail .sb-tri { display: none; }
.sb-head-title { position: relative; flex: 1 1 auto; min-width: 0; line-height: 1.25; }
/* назва системи — як «Атлас» у шапці Атласа: 16 px / 700, purple-600 (темна — purple-400), звичайний інтервал */
.sb-head-name { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.25; color: #9333ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.dark .sb-head-name { color: #c084fc; }
/* підпис під назвою — як «Fregat ISP» в Атласі: 10 px / 400, рядок 1.5, ОДИН відтінок #6b7280 в обох темах (Артьом 19.11: «оттенок фрегат исп у всех одинаковый») */
.sb-head-sub { margin: 0; font-size: 10px; font-weight: 400; line-height: 1.5; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-head-actions { position: relative; flex: 0 0 auto; width: 86px; height: 40px; z-index: 1; }
.sb-head-actions .bell { position: absolute; left: 0; top: 0; }
.sb-head-search, .sb-head-actions .bell-btn {
  width: 40px; height: 40px; border-radius: 12px; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: #a855f7; background: rgba(255, 255, 255, .7); border: 1px solid #f3e8ff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .15s, transform .15s; }
.sb-head-search { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.sb-head-search:hover { background: #faf5ff; transform: translateY(-50%) scale(1.05); }
.sb-head-actions .bell-btn:hover { background: #faf5ff; transform: scale(1.05); }
html.dark .sb-head-search, html.dark .sb-head-actions .bell-btn { color: #d8b4fe; background: rgba(31, 41, 55, .7); border-color: rgba(107, 33, 168, .5); }
html.dark .sb-head-search:hover, html.dark .sb-head-actions .bell-btn:hover { background: rgba(88, 28, 135, .4); }
.sb-head-search svg, .sb-head-actions .bell-btn svg { width: 20px; height: 20px; }

/* вузькі режими: лупа й дзвіночок — плитками 44 × 44 під логотипом */
#sb-search-wrap { flex-direction: column; align-items: center; gap: 2px; }
#sb-search-wrap .bell-btn { width: 44px; height: 44px; border-radius: 13px; border: none; background: transparent; color: var(--fsb-accent);
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, transform .12s; }
#sb-search-wrap .bell-btn:hover { background: rgba(var(--fsb-accent-rgb), .08); }
html.dark #sb-search-wrap .bell-btn { color: var(--fsb-soft); }
#sb-search-wrap .bell-btn svg { width: 20px; height: 20px; }
#sidebar.sidebar-collapsed #sidebar-logo-container, #sidebar.sidebar-rail #sidebar-logo-container { justify-content: center; padding: 0; }
#sidebar.sidebar-collapsed .atlas-logo, #sidebar.sidebar-rail .atlas-logo { margin-right: 0; }

/* мобільна шапка: дзвіночок поруч із лупою */
#mobile-header .bell-btn { position: relative; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #a855f7; }
html.dark #mobile-header .bell-btn { color: #d8b4fe; }
#mobile-header .bell-btn:hover { background: rgba(139, 92, 246, .08); }
#mobile-header .bell-btn svg { width: 22px; height: 22px; }
#mobile-header > :not(svg) { position: relative; }

/* ── Дзвіночок: лічильник, рух (гойдається від верхівки + кільце, як лупа; кадри sbRing — зі спільного файла) ── */
.bell-btn { position: relative; overflow: visible; isolation: isolate; }
.bell-count { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border-radius: 999px;
  background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; border: 2px solid #fff; z-index: 2; }
html.dark .bell-count { border-color: #1f2937; }
.bell-count[hidden] { display: none; }
.sb-head-actions .bell-btn::before, #sb-search-wrap .bell-btn::before, #mobile-header .bell-btn::before {
  content: ''; position: absolute; inset: -2px; border-radius: 14px; border: 2px solid rgba(var(--fsb-violet-rgb), .55); opacity: 0; transform: scale(.85); pointer-events: none; }
.bell-btn svg { transform-origin: 50% 12%; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.bell-btn:hover svg, .bell-btn:focus-visible svg { animation: bellSwing 1.2s ease-in-out infinite; }
.bell-btn:hover::before, .bell-btn:focus-visible::before { animation: sbRing 1.4s ease-out infinite; }
.sb-head-actions .bell-btn:active, #sb-search-wrap .bell-btn:active, #mobile-header .bell-btn:active { transform: scale(.88) !important; transition: transform .08s; }
.bell-btn:active svg { animation: none; transform: rotate(14deg) scale(1.12); }
@keyframes bellSwing {
  0%, 100% { transform: rotate(0); } 8% { transform: rotate(18deg); } 20% { transform: rotate(-15deg); } 32% { transform: rotate(11deg); }
  44% { transform: rotate(-7deg); } 56% { transform: rotate(4deg); } 68% { transform: rotate(-2deg); } 80% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .bell-btn svg, .bell-btn::before { animation: none !important; } }
html.fx-off .bell-btn svg, html.fx-off .bell-btn::before, html.fx-off .sb-head-search svg, html.fx-off .sb-head-search::before, html.fx-off .sb-head-search::after { animation: none !important; }

/* ── Маленьке вікно сповіщень: під кнопкою, як випадне меню гайдбука (розділ 14) ── */
.bell-panel { position: fixed; z-index: 80; width: 340px; max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; padding: 6px;
  background: #fff; border: 1px solid rgba(148, 163, 184, .25); border-radius: 14px; box-shadow: 0 18px 44px -18px rgba(20, 10, 50, .45), 0 2px 6px rgba(20, 10, 50, .06); }
html.dark .bell-panel { background: #1f2937; border-color: rgba(148, 163, 184, .16); }
.bell-panel[hidden] { display: none; }
.bell-panel.bell-in { animation: bellDrop .18s cubic-bezier(.2, .8, .2, 1) both; transform-origin: top left; }
@keyframes bellDrop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 6px; font-weight: 700; font-size: 13px; color: #111827; }
html.dark .bell-head { color: #f9fafb; }
.bell-readall { border: 0; background: rgba(139, 92, 246, .12); color: #6d28d9; font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 10px; cursor: pointer; }
.bell-readall:hover { background: rgba(139, 92, 246, .2); }
html.dark .bell-readall { background: rgba(139, 92, 246, .22); color: #ddd6fe; }
.bell-empty { padding: 22px; text-align: center; color: #6b7280; font-size: 13px; }
html.dark .bell-empty { color: #9ca3af; }
.bell-row { position: relative; border-radius: 10px; overflow: hidden; margin-bottom: 2px; transition: opacity .2s, max-height .23s ease, margin .23s; max-height: 160px; }
.bell-row.bell-gone { opacity: 0; max-height: 0; margin: 0; }
.bell-item { position: relative; z-index: 1; display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; background: #fff; touch-action: pan-y; user-select: none;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), background-color .15s; }
html.dark .bell-item { background: #1f2937; }
.bell-item:hover { background: #f8f5ff; }
html.dark .bell-item:hover { background: #2a2540; }
.bell-item.unread { background: #f3effe; }
html.dark .bell-item.unread { background: #2b2445; }
.bell-item.bell-down { box-shadow: inset 3px 0 0 #dc2626; } .bell-item.bell-busy { box-shadow: inset 3px 0 0 #f59e0b; }
.bell-item:focus-visible { outline: 2px solid #8b5cf6; outline-offset: -2px; }
.bell-ico { flex: 0 0 auto; font-size: 17px; line-height: 1.2; }
.bell-txt { display: flex; flex-direction: column; min-width: 0; }
.bell-title { font-size: 13px; font-weight: 600; color: #111827; overflow-wrap: anywhere; }
html.dark .bell-title { color: #f3f4f6; }
.bell-body { font-size: 12px; color: #6b7280; margin-top: 1px; overflow-wrap: anywhere; }
.bell-time { font-size: 11px; color: #6b7280; margin-top: 2px; }
html.dark .bell-body, html.dark .bell-time { color: #9ca3af; }
/* змахування: під рядком — червоний хрестик із того боку, куди тягнуть; на компʼютері хрестик ще й на наведенні */
.bell-x { position: absolute; top: 0; bottom: 0; width: 52px; z-index: 0; border: 0; background: #ef4444; color: #fff; font-size: 15px; cursor: pointer; opacity: 0; right: 0; transition: opacity .15s; }
.bell-row.bell-x-l .bell-x { opacity: 1; right: 0; left: auto; }
.bell-row.bell-x-r .bell-x { opacity: 1; left: 0; right: auto; }
@media (hover: hover) and (pointer: fine) {
  .bell-row:hover .bell-x { opacity: 1; z-index: 2; width: 26px; height: 26px; top: 8px; bottom: auto; right: 8px; border-radius: 8px; background: rgba(148, 163, 184, .2); color: #6b7280; font-size: 12px; }
  .bell-row:hover .bell-x:hover { background: rgba(239, 68, 68, .14); color: #b91c1c; }
  .bell-row.bell-x-l .bell-x, .bell-row.bell-x-r .bell-x { width: 52px; height: auto; top: 0; bottom: 0; border-radius: 0; background: #ef4444; color: #fff; font-size: 15px; z-index: 0; }
}
.bell-hint { margin: 6px 10px 4px; font-size: 11px; color: #9ca3af; }
html:not(.dark) .bell-hint { color: #6b7280; }
@media (prefers-reduced-motion: reduce) { .bell-panel.bell-in, .bell-item, .bell-row { animation: none !important; transition: none !important; } }

/* ── Вікно пошуку (⌘K) — як в Атласі й CRM: затемнення з розмиттям, вікно «виростає» з лупи ── */
#cmdk { display: none; }
#cmdk.cmdk-open { display: block; }
.cmdk-back { position: fixed; inset: 0; z-index: 95; background: rgba(18, 16, 30, .6); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: cmdkFade .18s ease both; }
.cmdk-panel { position: fixed; z-index: 100; left: 50%; top: min(12vh, 120px); width: min(600px, calc(100vw - 24px)); max-height: min(72vh, 640px);
  display: flex; flex-direction: column; overflow: hidden; transform: translateX(-50%);
  background: #fff; border: 1px solid rgba(148, 163, 184, .2); border-radius: 20px; box-shadow: 0 24px 70px -20px rgba(20, 10, 50, .55);
  animation: cmdkGrow .42s cubic-bezier(.2, 1.25, .35, 1) both; }
html.dark .cmdk-panel { background: #1f2937; border-color: rgba(148, 163, 184, .14); }
#cmdk.cmdk-closing .cmdk-panel { animation: cmdkShrink .23s ease-in both; }
#cmdk.cmdk-closing .cmdk-back { animation: cmdkFade .2s ease reverse both; }
@keyframes cmdkGrow { from { opacity: 0; transform: translateX(-50%) translate(var(--dx, 0px), var(--dy, -12px)) scale(.2); } 60% { opacity: 1; } to { opacity: 1; transform: translateX(-50%); } }
@keyframes cmdkShrink { from { opacity: 1; transform: translateX(-50%); } to { opacity: 0; transform: translateX(-50%) translate(var(--dx, 0px), var(--dy, -12px)) scale(.2); } }
@keyframes cmdkFade { from { opacity: 0; } to { opacity: 1; } }
html.fx-off .cmdk-panel, html.fx-off .cmdk-back { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .cmdk-panel, .cmdk-back { animation: none !important; } }
.cmdk-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(148, 163, 184, .2); }
.cmdk-top-ic { display: flex; color: #8b5cf6; } .cmdk-top-ic svg { width: 20px; height: 20px; }
.cmdk-input { flex: 1; min-width: 0; border: 0 !important; outline: none; background: transparent; box-shadow: none !important; font: inherit; font-size: 16px; font-weight: 500; color: #111827; padding: 4px 0; }
html.dark .cmdk-input { color: #f9fafb; }
.cmdk-input::placeholder { color: #9ca3af; font-weight: 400; }
.cmdk-input::-webkit-search-cancel-button { display: none; }
.cmdk-kbd { flex: 0 0 auto; font: 600 11px/1 Inter, sans-serif; padding: 4px 7px; border-radius: 7px; cursor: pointer; color: #6b7280; border: 1px solid rgba(148, 163, 184, .45); background: transparent; }
.cmdk-results { overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.cmdk-group { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; padding: 10px 10px 4px; }
html.dark .cmdk-group { color: #9ca3af; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.cmdk-item.active { background: rgba(139, 92, 246, .1); }
html.dark .cmdk-item.active { background: rgba(139, 92, 246, .2); }
.cmdk-ico { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.cmdk-ico.nav-icon-box { display: flex; align-items: center; justify-content: center; } .cmdk-ico svg { width: 16px; height: 16px; }
.cmdk-ava { border-radius: 50%; background: #f3e8ff; color: #7e22ce; }
html.dark .cmdk-ava { background: rgba(88, 28, 135, .4); color: #d8b4fe; }
.cmdk-all { background: rgba(139, 92, 246, .12); color: #7c3aed; }
.cmdk-txt { display: flex; flex-direction: column; min-width: 0; }
.cmdk-main { font-size: 13.5px; font-weight: 600; color: #111827; display: flex; align-items: center; gap: 6px; min-width: 0; }
html.dark .cmdk-main { color: #f3f4f6; }
.cmdk-sub { font-size: 11.5px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.dark .cmdk-sub { color: #9ca3af; }
.cmdk-tag { flex: 0 0 auto; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: rgba(37, 99, 235, .1); color: #2563a8; }
html.dark .cmdk-tag { background: rgba(96, 165, 250, .16); color: #93c5fd; }
.cmdk-empty { padding: 18px; text-align: center; color: #6b7280; font-size: 13px; }
html.dark .cmdk-empty { color: #9ca3af; }
.cmdk-foot { border-top: 1px solid rgba(148, 163, 184, .2); margin-top: 6px; padding-top: 6px; }
@media (max-width: 640px) { .cmdk-panel { top: 8px; max-height: calc(100dvh - 16px); } }
.cmdk-wait { padding: 6px 10px 2px; font-size: 11.5px; color: #6b7280; } html.dark .cmdk-wait { color: #9ca3af; }

/* «Вийти» — мʼяка червона заливка: кнопка = межа + заливка + напис (Артьом 19.11; sidebar-footer/README.md) */
#logout-btn, #logout-btn-compact { background-color: #fef2f2; }
html.dark #logout-btn, html.dark #logout-btn-compact { background-color: rgba(127, 29, 29, .2); }
/* ── 19.11 «Вийти»: на наведенні (лише миша) й натиску червоне наповнення наростає зліва направо за 0,5 с, а не спалахує одразу
   (Артьом: «чтобы она … анимированно наполнялась красным а не сразу загоралась вот как кнопки лупы и колокольчика»); червоне кільце,
   як у лупи; натиск — пружинка. Наповнення — псевдоелемент під написом; без руху — одразу заповнено, без кільця. Стилі — з Атласа. ── */
.sb-logout { position: relative; overflow: hidden; isolation: isolate; transition: color .3s, border-color .3s, transform .2s cubic-bezier(.3,1.6,.5,1); }
.sb-logout::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, #fecaca, #fca5a5); transform: scaleX(0); transform-origin: left center; transition: transform .5s cubic-bezier(.22,.8,.3,1); }
.dark .sb-logout::before { background: linear-gradient(90deg, rgba(185,28,28,.45), rgba(220,38,38,.6)); }
@media (hover: hover) {
  .sb-logout:hover::before, .sb-logout:focus-visible::before { transform: scaleX(1); }
  .sb-logout:hover { color: #991b1b; border-color: #fca5a5; animation: logoutRing 1.4s ease-out infinite; }
  .dark .sb-logout:hover { color: #fee2e2; border-color: #dc2626; }
}
.sb-logout:active::before { transform: scaleX(1); transition-duration: .28s; }
.sb-logout:active { transform: scale(.96); transition-duration: .08s; }
@keyframes logoutRing { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); } 100% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }
@media (prefers-reduced-motion: reduce) { .sb-logout::before { transition: none; } .sb-logout { animation: none !important; } }
html.fx-off .sb-logout::before { transition: none; }                      /* свій вимикач анімацій — так само, як системне «менше руху» */
html.fx-off .sb-logout { animation: none !important; }
