/* ═══════════════════════════════════════════════════════════
   ESSENCE THEMES — 5 тем: void, sakura, slate, rose-gold, arctic
   Каждая тема определяет полный набор CSS переменных.
   Подключается ДО components.css.
═══════════════════════════════════════════════════════════ */

/* ──────────────────── VOID ──────────────────────────────
   Чистый чёрный. Акцент приглушённый фиолетовый.
──────────────────────────────────────────────────────── */
[data-theme="void"] {
  --bg:      #0a0a0f;
  --bg2:     #0e0c17;
  --surface: #13111f;
  --s2:      #1a1729;
  --border:  rgba(136,120,192,0.12);
  --text:    #e8e0f8;
  --t2:      #a898c4;
  --t3:      #1a1729;

  --ac:      #8878c0;
  --acg:     rgba(136,120,192,.13);
  --acb:     rgba(136,120,192,.28);
  --ac3:     rgba(136,120,192,.06);

  --red:     #e05c7a;
  --yellow:  #d4a84b;
  --purple:  #a870e0;
  --green:   #3cc89a;

  --shadow-sm: 0 2px 8px  rgba(0,0,0,.45);
  --shadow-md: 0 8px 28px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.8);
  --overlay:   rgba(0,0,0,.7);
  --scrim:     rgba(10,10,15,.92);
  --glow:      rgba(136,120,192,.18);

  --banner-1: linear-gradient(135deg,#0a0a0f,#13111f);
  --banner-2: linear-gradient(135deg,#0e0012,#1a0030);
  --banner-3: linear-gradient(135deg,#050a12,#0e1a28);
  --banner-4: linear-gradient(135deg,#100010,#200020);
}
html[data-theme="void"] body {
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(136,120,192,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(88,60,180,.04) 0%, transparent 45%);
}

/* ──────────────────── SAKURA ────────────────────────────
   Тёмно-розовый. Тёплый, выразительный.
──────────────────────────────────────────────────────── */
[data-theme="sakura"] {
  --bg:      #0f090d;
  --bg2:     #150c11;
  --surface: #1c1018;
  --s2:      #241420;
  --border:  rgba(220,130,160,0.12);
  --text:    #f5e8ef;
  --t2:      #c9a8b8;
  --t3:      #241420;

  --ac:      #dc82a0;
  --acg:     rgba(220,130,160,.13);
  --acb:     rgba(220,130,160,.28);
  --ac3:     rgba(220,130,160,.06);

  --red:     #e05c5c;
  --yellow:  #d4a84b;
  --purple:  #b57bee;
  --green:   #3cc89a;

  --shadow-sm: 0 2px 8px  rgba(0,0,0,.40);
  --shadow-md: 0 8px 28px rgba(0,0,0,.55);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.75);
  --overlay:   rgba(0,0,0,.65);
  --scrim:     rgba(15,9,13,.90);
  --glow:      rgba(220,130,160,.18);

  --banner-1: linear-gradient(135deg,#0f090d,#1c1018);
  --banner-2: linear-gradient(135deg,#110618,#1c0d2e);
  --banner-3: linear-gradient(135deg,#0a080e,#180e18);
  --banner-4: linear-gradient(135deg,#100a04,#281808);
}
html[data-theme="sakura"] body {
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(220,130,160,.07) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(180,80,160,.05) 0%, transparent 45%);
}

/* ──────────────────── SLATE ─────────────────────────────
   Глубокий тёмно-серый. Холодный, профессиональный.
──────────────────────────────────────────────────────── */
[data-theme="slate"] {
  --bg:      #0b0d11;
  --bg2:     #0e1218;
  --surface: #141820;
  --s2:      #1c2430;
  --border:  rgba(78,96,112,0.15);
  --text:    #c8d4e0;
  --t2:      #8090a8;
  --t3:      #1c2430;

  --ac:      #4e6070;
  --acg:     rgba(78,96,112,.12);
  --acb:     rgba(78,96,112,.26);
  --ac3:     rgba(78,96,112,.06);

  --red:     #c05060;
  --yellow:  #c0984a;
  --purple:  #8070c0;
  --green:   #3cc89a;

  --shadow-sm: 0 2px 8px  rgba(0,0,0,.40);
  --shadow-md: 0 8px 28px rgba(0,0,0,.55);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.75);
  --overlay:   rgba(0,0,0,.65);
  --scrim:     rgba(11,13,17,.90);
  --glow:      rgba(78,96,112,.16);

  --banner-1: linear-gradient(135deg,#0b0d11,#141820);
  --banner-2: linear-gradient(135deg,#060410,#160828);
  --banner-3: linear-gradient(135deg,#040f08,#0a2018);
  --banner-4: linear-gradient(135deg,#0d0a04,#2a1808);
}
html[data-theme="slate"] body {
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(78,96,112,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(80,70,120,.04) 0%, transparent 45%);
}

/* ──────────────────── ROSE GOLD ─────────────────────────
   Тёмно-красный. Тёплый, сдержанный.
──────────────────────────────────────────────────────── */
[data-theme="rose-gold"] {
  --bg:      #0f0909;
  --bg2:     #170b0b;
  --surface: #1f1010;
  --s2:      #281515;
  --border:  rgba(200,64,88,0.12);
  --text:    #f8e4e4;
  --t2:      #c08888;
  --t3:      #281515;

  --ac:      #c84058;
  --acg:     rgba(200,64,88,.12);
  --acb:     rgba(200,64,88,.26);
  --ac3:     rgba(200,64,88,.05);

  --red:     #e04040;
  --yellow:  #d4a84b;
  --purple:  #a870c0;
  --green:   #3cc89a;

  --shadow-sm: 0 2px 8px  rgba(0,0,0,.45);
  --shadow-md: 0 8px 28px rgba(0,0,0,.60);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.80);
  --overlay:   rgba(0,0,0,.70);
  --scrim:     rgba(15,9,9,.92);
  --glow:      rgba(200,64,88,.18);

  --banner-1: linear-gradient(135deg,#0f0909,#1f1010);
  --banner-2: linear-gradient(135deg,#12040f,#28082a);
  --banner-3: linear-gradient(135deg,#040f04,#101e10);
  --banner-4: linear-gradient(135deg,#0c0a02,#241a04);
}
html[data-theme="rose-gold"] body {
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(200,64,88,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(160,40,80,.04) 0%, transparent 50%);
}

/* ──────────────────── ARCTIC ────────────────────────────
   Почти чёрный + холодный cyan. Чистый, ледяной.
──────────────────────────────────────────────────────── */
[data-theme="arctic"] {
  --bg:      #080d12;
  --bg2:     #0a1520;
  --surface: #0e1c28;
  --s2:      #142030;
  --border:  rgba(56,180,216,0.12);
  --text:    #d4eef8;
  --t2:      #7ab0c8;
  --t3:      #142030;

  --ac:      #38b4d8;
  --acg:     rgba(56,180,216,.11);
  --acb:     rgba(56,180,216,.26);
  --ac3:     rgba(56,180,216,.05);

  --red:     #e05c7a;
  --yellow:  #c8b040;
  --purple:  #7880d0;
  --green:   #3cc89a;

  --shadow-sm: 0 2px 8px  rgba(0,0,0,.45);
  --shadow-md: 0 8px 28px rgba(0,0,0,.60);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.80);
  --overlay:   rgba(0,0,0,.70);
  --scrim:     rgba(8,13,18,.92);
  --glow:      rgba(56,180,216,.18);

  --banner-1: linear-gradient(135deg,#080d12,#0e1c28);
  --banner-2: linear-gradient(135deg,#08040f,#1a082a);
  --banner-3: linear-gradient(135deg,#041008,#0e2414);
  --banner-4: linear-gradient(135deg,#0a0802,#201804);
}
html[data-theme="arctic"] body {
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(56,180,216,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(80,120,208,.04) 0%, transparent 50%);
}

/* ═══════════════════════════════════════════════════════════
   SHARED UI — топбар, сайдбар, dropdown, toast
   Использует CSS переменные тем — работает со всеми 5.
═══════════════════════════════════════════════════════════ */

/* ── TOPBAR (56px) — без бургера, лого слева после сайдбара ── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);  /* отступ равен ширине сайдбара */
  right: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 16px 0 20px;
  gap: 10px;
  z-index: var(--z-topbar);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--t-slow), border-color var(--t-slow), backdrop-filter var(--t-slow);
}
.topbar.scrolled {
  background: var(--scrim);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom-color: var(--border);
}

/* Топбар скрыт — навигация через floating pill sidebar */
.topbar { display: none !important; }

/* Гамбургер скрыт на десктопе, виден только на мобильном */
.topbar-toggle {
  width: 32px; height: 32px;
  border-radius: var(--r-xs);
  border: none; background: transparent; color: var(--t2);
  display: none;           /* скрыт по умолчанию */
  align-items: center; justify-content: center;
  cursor: pointer; transition: var(--t-fast); flex-shrink: 0;
}
.topbar-toggle:hover { background: var(--s2); color: var(--text); }
.topbar-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

@media (max-width: 768px) {
  .topbar { left: 0; }
  .topbar-toggle { display: flex; }
}

.brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text); flex-shrink: 0;
}
.brand-ico {
  width: 28px; height: 28px;
  border-radius: var(--r-xs);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
/* Принудительно ограничиваем SVG внутри brand-ico */
.brand-ico svg, .brand-ico img { width: 28px; height: 28px; display: block; }
.brand-name { font-size: 15px; font-weight: var(--fw-black); letter-spacing: -.3px; }

.topbar-space { flex: 1; }

/* Search trigger */
.search-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--t2);
  font-size: var(--fs-base);
  cursor: pointer;
  transition: var(--t-fast);
  min-width: 180px;
}
.search-trigger:hover { border-color: var(--acb); color: var(--text); }
.search-trigger svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.search-trigger kbd {
  margin-left: auto;
  font-size: var(--fs-xs);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--t2);
  font-family: inherit;
}
@media (max-width: 640px) { .search-trigger { min-width: unset; } .search-trigger span, .search-trigger kbd { display: none; } }

/* Notification bell */
.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--t2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--t-fast); flex-shrink: 0;
}
.notif-btn:hover { border-color: var(--ac); color: var(--text); }
.notif-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px;
  border-radius: var(--r-full);
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: var(--fw-black);
  display: none; align-items: center; justify-content: center;
  padding: 0 3px; border: 2px solid var(--bg); line-height: 1;
}
.notif-badge.show { display: flex; }
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px; max-height: 440px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: none; z-index: var(--z-dropdown);
  flex-direction: column; overflow: hidden;
}
.notif-panel.open { display: flex; animation: apdrop var(--t-base); }
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.notif-panel-title { font-size: var(--fs-base); font-weight: var(--fw-black); }
.notif-mark-all {
  font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ac);
  cursor: pointer; border: none; background: none;
  padding: 4px 8px; border-radius: var(--r-xs); font-family: inherit; transition: var(--t-fast);
}
.notif-mark-all:hover { background: var(--acg); }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  display: flex; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: var(--t-fast); cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--s2); }
.notif-item.unread { background: var(--acg); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ac); flex-shrink: 0; margin-top: 5px; }
.notif-dot.read { background: transparent; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-text { font-size: var(--fs-sm); font-weight: var(--fw-semi); line-height: 1.5; margin-bottom: 3px; }
.notif-item-time { font-size: 10px; color: var(--t2); font-weight: var(--fw-semi); }
.notif-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; padding: 40px 20px; color: var(--t2);
}
.notif-empty svg { width: 32px; height: 32px; stroke: currentColor; fill: none; stroke-width: 1.5; opacity: .4; }
.notif-empty span { font-size: var(--fs-base); font-weight: var(--fw-bold); }

/* App panel button */
.app-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--t2); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--t-fast); flex-shrink: 0;
}
.app-btn:hover { border-color: var(--ac); color: var(--text); }
.app-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.app-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 16px;
  width: 300px;
  box-shadow: var(--shadow-lg);
  display: none; z-index: var(--z-dropdown);
}
.app-panel.open { display: block; animation: apdrop var(--t-base); }

/* App panel contents */
.app-section-label {
  font-size: 10px; font-weight: var(--fw-black);
  color: var(--t2); text-transform: uppercase;
  letter-spacing: .12em; margin-bottom: 8px;
}
.app-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.app-theme-opt {
  border-radius: var(--r-sm); cursor: pointer;
  border: 2px solid var(--border); overflow: hidden; transition: var(--t-fast);
}
.app-theme-opt:hover { border-color: var(--acb); }
.app-theme-opt.on { border-color: var(--ac); }
.app-theme-preview { height: 30px; }
.app-theme-foot {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; background: var(--s2);
}
.app-swatch { display: flex; flex-shrink: 0; }
.app-swatch div {
  width: 8px; height: 8px; border-radius: 50%;
  margin-left: -3px; border: 1.5px solid var(--surface);
}
.app-swatch div:first-child { margin-left: 0; }
.app-theme-opt span { font-size: 11px; font-weight: var(--fw-bold); }
.app-sep { height: 1px; background: var(--border); margin: 10px 0; }
.app-styles { display: flex; gap: 5px; flex-wrap: wrap; }
.app-style-opt {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-sm);
  cursor: pointer; border: 1px solid var(--border);
  font-size: var(--fs-sm); font-weight: var(--fw-bold); transition: var(--t-fast);
}
.app-style-opt:hover { background: var(--s2); }
.app-style-opt.on { background: var(--acg); border-color: var(--acb); color: var(--ac); }
.app-langs { display: flex; gap: 6px; }
.app-lang-opt {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: var(--r-sm);
  cursor: pointer; border: 1px solid var(--border);
  font-size: var(--fs-base); font-weight: var(--fw-bold);
  transition: var(--t-fast); flex: 1; justify-content: center;
}
.app-lang-opt:hover { background: var(--s2); }
.app-lang-opt.on { background: var(--acg); border-color: var(--acb); color: var(--ac); }

/* User box */
.user-box {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: var(--t-fast); user-select: none;
}
.user-box:hover { border-color: var(--ac); }
.user-av {
  width: 26px; height: 26px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0; border: 2px solid var(--border);
}
.user-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-name { font-size: var(--fs-base); font-weight: var(--fw-bold); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chevron { color: var(--t2); transition: transform var(--t-fast); }
.user-chevron svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.5; }
.user-box.open .user-chevron { transform: rotate(180deg); }
.user-dd {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 5px;
  min-width: 180px; box-shadow: var(--shadow-lg);
  display: none; z-index: var(--z-dropdown);
}
.user-box.open .user-dd { display: block; animation: apdrop var(--t-base); }
.user-dd a, .user-dd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: var(--r-xs);
  font-size: var(--fs-base); font-weight: var(--fw-semi);
  text-decoration: none; color: var(--text);
  cursor: pointer; background: none; border: none;
  width: 100%; font-family: inherit; transition: var(--t-fast);
}
.user-dd a:hover, .user-dd-item:hover { background: var(--s2); }
.user-dd a svg, .user-dd-item svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; color: var(--t2); flex-shrink: 0; }
.user-dd .logout { color: var(--red); }
.user-dd .logout svg { color: var(--red); }
.user-dd-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* Login button */
.tbtn-login {
  padding: 8px 16px; border-radius: var(--r-sm);
  background: var(--ac); color: #fff;
  font-size: var(--fs-base); font-weight: var(--fw-bold);
  cursor: pointer; border: none;
  display: flex; align-items: center; gap: 7px;
  transition: var(--t-fast); font-family: inherit;
}
.tbtn-login:hover { filter: brightness(1.1); transform: translateY(-1px); }
.tbtn-login svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2; }

/* ── SIDEBAR — floating pill, centred vertically ── */
.sidebar {
  position: fixed;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 64px;
  max-height: calc(100vh - 48px);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  z-index: var(--z-topbar);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,0.25);
  transition: width .22s cubic-bezier(.16,1,.3,1);
}
.sidebar:hover {
  width: 200px;
  overflow: visible;
}

.sidebar-nav {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  max-height: calc(100vh - 140px);
}
.sidebar-nav::-webkit-scrollbar { width: 0; }

/* Ссылка — icon-only по умолчанию, иконка центрирована */
.sidebar-link {
  position: relative;
  width: 44px;
  height: 40px;
  margin: 0 10px;
  border-radius: var(--r-sm);
  color: var(--t2);
  text-decoration: none;
  transition: var(--t-fast);
  border: 1px solid transparent;
  cursor: pointer;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  flex-shrink: 0;
  font-family: inherit;
  white-space: nowrap;
}
.sidebar:hover .sidebar-link {
  width: calc(100% - 16px);
  margin: 0 8px;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
}
.sidebar-link:hover {
  background: var(--s2);
  color: var(--text);
  border-color: var(--border);
}
.sidebar-link.active {
  background: var(--acg);
  color: var(--ac);
  border-color: var(--acb);
}

.sidebar-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Текстовая метка — скрыта по умолчанию, видна при hover */
.sidebar-label {
  display: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar:hover .sidebar-label { display: block; }

/* Бейдж уведомлений */
.sidebar-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--red); color: #fff;
  font-size: 8px; font-weight: var(--fw-black);
  padding: 1px 4px; border-radius: var(--r-full);
  min-width: 14px; text-align: center;
  line-height: 1.4;
}

.sidebar-sep { height: 1px; background: var(--border); width: 80%; margin: 4px auto; }

/* Нижний раздел с кнопкой оформления */
.sidebar-footer {
  width: 100%;
  padding: 4px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

.sidebar-user-actions {
  display: none;
  flex-direction: column;
  gap: 2px;
}
.sidebar:hover .sidebar-user-actions { display: flex; }
.sidebar-logout { color: var(--red) !important; }
.sidebar-logout:hover { background: rgba(240,80,80,.12) !important; border-color: var(--red) !important; }

/* Mobile: pill resets to full-height drawer */
@media (max-width: 768px) {
  .sidebar {
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    transition: transform var(--t-spring);
    z-index: calc(var(--z-topbar) + 1);
  }
  .sidebar.mobile-open { transform: translateX(0); }
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  z-index: var(--z-topbar);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-slow);
}
.sidebar-overlay.show { opacity: 1; pointer-events: auto; }

/* ── SIDEBAR NAV MODES ── */

/* A/B: sidebar-hover и sidebar-full — hover-expand поведение (64px→200px) */
[data-nav="sidebar-hover"] .sidebar,
[data-nav="sidebar-full"] .sidebar {
  /* ширина определена в .sidebar глобально (64px, расширяется до 200px по hover) */
}

/* C: topbar — no sidebar */
[data-nav="topbar"] .sidebar         { display: none; }
[data-nav="topbar"] .sidebar-overlay { display: none; }

/* D: topbar+sidebar — icon-only, no hover */
[data-nav="topbar+sidebar"] .sidebar {
  width: var(--sidebar-w);
  overflow: hidden;
}

/* Topbar nav items (shown only in topbar mode) */
.topbar-nav {
  display: none;
  align-items: center;
  gap: 2px;
}
[data-nav="topbar"] .topbar-nav { display: flex; }

.topbar-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--t2);
  text-decoration: none;
  transition: var(--t-fast);
  white-space: nowrap;
}
.topbar-nav-link:hover  { color: var(--text); background: var(--s2); }
.topbar-nav-link.active { color: var(--ac); }
.topbar-nav-link svg    { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 22px;
  font-size: var(--fs-base); font-weight: var(--fw-bold);
  opacity: 0; transition: .25s; z-index: var(--z-toast);
  white-space: nowrap; pointer-events: none;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok   { border-color: rgba(60,200,154,.4);  color: var(--green); }
.toast.err  { border-color: rgba(232,80,80,.4);   color: var(--red); }
.toast.warn { border-color: rgba(232,200,72,.4);  color: var(--yellow); }

/* ── MODAL ── */
.modal-bg {
  position: fixed; inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-modal);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-bg.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl);
  width: 440px; max-width: 93vw; max-height: 90vh;
  overflow-y: auto; position: relative;
  transform: translateY(14px); transition: transform .2s;
  box-shadow: var(--shadow-lg);
}
.modal-bg.open .modal { transform: none; }
.modal-sm { width: 360px; }
.modal-lg { width: 620px; }
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 0;
}
.modal-title { font-size: 17px; font-weight: var(--fw-black); letter-spacing: -.3px; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; padding: 0 24px 22px;
}
.modal-close {
  width: 30px; height: 30px; border-radius: var(--r-xs);
  background: var(--s2); border: 1px solid var(--border);
  color: var(--t2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--t-fast); flex-shrink: 0;
}
.modal-close:hover { border-color: var(--ac); color: var(--text); }
.modal-close svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* ── MORE DROPDOWN ── */
.more-wrap { position: relative; }
.more-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 8px 13px; border-radius: var(--r-sm);
  color: var(--t2); font-size: var(--fs-base); font-weight: var(--fw-bold);
  background: none; border: none; cursor: pointer;
  transition: var(--t-fast); font-family: inherit; white-space: nowrap;
}
.more-btn:hover { color: var(--text); background: rgba(128,128,128,.1); }
.more-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; transition: transform .2s; flex-shrink: 0; }
.more-wrap.open .more-btn svg { transform: rotate(180deg); }
.more-dd {
  display: none; position: absolute;
  top: calc(100% + 8px); left: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 5px;
  min-width: 200px; box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown); animation: apdrop var(--t-base);
}
.more-wrap.open .more-dd { display: block; }
.more-dd a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: var(--r-xs);
  font-size: var(--fs-base); font-weight: var(--fw-semi);
  color: var(--text); text-decoration: none; transition: var(--t-fast);
}
.more-dd a:hover { background: var(--s2); }
.more-dd a svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; color: var(--t2); flex-shrink: 0; }
.more-dd-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ── BOTTOM NAV (mobile) ── */
.bottom-nav {
  display: none; position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-bottomnav);
  height: 58px; background: var(--bg2);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bnav-items { display: flex; align-items: center; height: 58px; }
.bnav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 6px 4px;
  text-decoration: none; color: var(--t2);
  font-size: 9px; font-weight: var(--fw-black);
  text-transform: uppercase; letter-spacing: .05em;
  transition: var(--t-fast); cursor: pointer;
  background: none; border: none; font-family: inherit;
}
.bnav-item:hover, .bnav-item.active { color: var(--ac); }
.bnav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── SKELETON LOADER ── */
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
.skel {
  background: linear-gradient(90deg, var(--border) 25%, var(--s2) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}

/* ── SHARED ANIMATIONS ── */
@keyframes apdrop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes pagein  { from { opacity: 0; } to { opacity: 1; } }
@keyframes online-ping {
  0%, 100% { box-shadow: 0 0 0 0 rgba(60,200,154,.5); }
  50%       { box-shadow: 0 0 0 4px rgba(60,200,154,0); }
}
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: online-ping 2s ease-in-out infinite; }

/* ── BASE BODY ── */
body {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--t2); }

/* ── GLASS STYLE OVERRIDES ── */
[data-style="glass"] .app-panel,
[data-style="glass"] .user-dd,
[data-style="glass"] .more-dd {
  background: rgba(8,12,28,.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* ── RESPONSIVE: mobile sidebar → drawer ── */
@media (max-width: 768px) {
  .sidebar {
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    width: 200px !important;
    overflow: hidden;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .bottom-nav { display: block; }
}
