/* ==================== ТЕМЫ ==================== */
:root {
  --bg: #f5f7fa;
  --bg-card: #ffffff;
  --text: #222222;
  --text-mut: #777777;
  --border: #d0d7de;
  --border-soft: #e5e9ef;

  --primary: #305496;
  --primary-h: #243b70;
  --secondary: #6c757d;
  --danger: #c0392b;
  --success: #2e7d32;
  --warning: #b26a00;

  --th-bg: #eaf0fb;
  --hol-bg: #ffd6d6;
  --we-bg: #ececec;
  --vac-bg: #c9ecc9;
  --sick-bg: #ffd9a8;
  --unpaid-bg: #e8e0ff;
  --wwe-bg: #d4ecff;

  --flash-err-bg: #ffe1e1;
  --flash-err-tx: #8b1a1a;
  --flash-ok-bg: #e6f4ea;
  --flash-ok-tx: #1b5e20;

  --shift-color: #cfe3ff;
}

[data-theme="dark"] {
  --bg: #12151a;
  --bg-card: #1b1f26;
  --text: #e6e9ef;
  --text-mut: #8b95a5;
  --border: #2a313c;
  --border-soft: #22272f;

  --primary: #4a6fb5;
  --primary-h: #5c82c9;
  --secondary: #4a5561;
  --danger: #e05a4b;
  --success: #56b96b;
  --warning: #e0a44a;

  --th-bg: #232a35;
  --hol-bg: #4a2528;
  --we-bg: #262a30;
  --vac-bg: #1f3a24;
  --sick-bg: #4a3418;
  --unpaid-bg: #302548;
  --wwe-bg: #1c3a52;

  --flash-err-bg: #4a2528;
  --flash-err-tx: #ffb0a8;
  --flash-ok-bg: #1f3a24;
  --flash-ok-tx: #a6e0b0;

  --shift-color: #cfe3ff;
}

/* ==================== БАЗА ==================== */
* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: system-ui, Arial, sans-serif;
  margin: 0;
  transition: background .2s ease, color .2s ease;
}

main { padding: 20px; }
a { color: var(--primary); }

/* ==================== ШАПКА ==================== */
header {
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
header a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}
header a:hover { text-decoration: underline; }
header .right {
  margin-left: auto;
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 13px;
}
header .badge {
  background: rgba(255, 255, 255, .2);
  padding: 3px 8px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
}

/* Бургер для мобильных */
.burger {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .5);
  color: white;
  font-size: 18px;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
}

/* ==================== ТАБЛИЦЫ ==================== */
table {
  border-collapse: collapse;
  background: var(--bg-card);
  color: var(--text);
  width: 100%;
}
th, td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  font-size: 13px;
}
th {
  background: var(--th-bg);
  color: var(--text);
}

/* ==================== КНОПКИ ==================== */
.btn {
  display: inline-block;
  padding: 6px 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  transition: background .15s ease;
}
.btn:hover { background: var(--primary-h); }
.btn.secondary { background: var(--secondary); }
.btn.danger { background: var(--danger); }
.btn.small {
  padding: 4px 8px;
  font-size: 12px;
  margin: 1px;
}
.btn:active { transform: translateY(1px); }
.btn.danger:hover { background: #a03225; }
[data-theme="dark"] .btn.danger:hover { background: #c04a3a; }

/* ==================== ПОЛЯ ВВОДА ==================== */
input, select, textarea {
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text);
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

/* ==================== КАРТОЧКИ, ТУЛБАРЫ ==================== */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  /* ★ выравниваем базовую линию по центру */
  line-height: 1;
}
.toolbar > * {
  /* ★ все прямые дети тулбара одинаковой высоты */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  margin: 0;
}
.toolbar form {
  /* ★ формы внутри тулбара тоже не ломают высоту */
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  margin: 0;
}
.toolbar label {
  /* ★ лейблы (Год, Месяц, Команда) с одинаковой высотой */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  font-size: 13px;
}
.toolbar input[type="number"],
.toolbar input[type="text"],
.toolbar select {
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  line-height: 30px;
  box-sizing: border-box;
}
.toolbar input[type="checkbox"] {
  /* чекбокс не растягивается */
  height: 16px;
  width: 16px;
  margin: 0;
}
.toolbar .btn {
  /* ★ кнопки — фиксированной высоты */
  height: 32px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
}
.toolbar .dropdown {
  /* dropdown — та же высота */
  display: inline-flex;
  align-items: center;
  height: 34px;
}
.card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
  margin-bottom: 18px;
  color: var(--text);
}
.muted {
  color: var(--text-mut);
  font-size: 12px;
}

/* ==================== FLASH ==================== */
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}
.flash.error { background: var(--flash-err-bg); color: var(--flash-err-tx); }
.flash.success { background: var(--flash-ok-bg); color: var(--flash-ok-tx); }

/* ==================== ЦВЕТА ТИПОВ ДНЕЙ ==================== */

/* Праздник — красный */
.hol { background: var(--hol-bg) !important; }

/* Выходной — серый */
.we { background: var(--we-bg) !important; }

/* Отпуск — зелёный */
.vac { background: var(--vac-bg) !important; }

/* Больничный — оранжевый */
.sick { background: var(--sick-bg) !important; }

/* Без сохранения — сиреневый */
.unpaid { background: var(--unpaid-bg) !important; }

/* Рабочий выходной (перенос) — голубой */
.wwe { background: var(--wwe-bg) !important; }

/* ★ РАБОЧАЯ СМЕНА — приоритет выше, чем выходной.
   Идёт последним и с !important, чтобы перебивать .we и .hol. */
.d-work {
  background: var(--shift-color, #cfe3ff) !important;
  color: #1a1a1a !important;
  font-weight: 500;
}

.d-work .d-num,
.d-work .d-h,
.d-work .muted,
.d-work small {
  color: #1a1a1a !important;
  opacity: 1 !important;
}

/* ★ Смена в выходной — цвет смены + оранжевая обводка слева */
.cell-shift-on-weekend {
  background: var(--shift-color, #cfe3ff) !important;
  border-left: 4px solid #b26a00 !important;
  color: #1a1a1a !important;
}

/* Шапка календаря */
.head-hol { background: var(--hol-bg) !important; }
.head-we { background: var(--we-bg) !important; }
.head-wwe { background: var(--wwe-bg) !important; }

/* ★ Текущий день (в шапке и в ячейках табеля) */
.head-today {
  background: #fff5cc !important;
  border-bottom: 3px solid #b26a00 !important;
  font-weight: 700;
  color: #8b5a00 !important;
}

.cell-today {
  box-shadow: inset 0 0 0 2px #b26a00;
  background-image: linear-gradient(
    rgba(255, 245, 204, .35),
    rgba(255, 245, 204, .35)
  );
}

/* ==================== ТЁМНАЯ ТЕМА: смена и текущий день ==================== */

[data-theme="dark"] .d-work {
  filter: brightness(0.75) saturate(1.1);
}

[data-theme="dark"] .d-work .d-num,
[data-theme="dark"] .d-work .d-h,
[data-theme="dark"] .d-work .muted,
[data-theme="dark"] .d-work small {
  color: #0a0a0a !important;
}

[data-theme="dark"] .cell-shift-on-weekend {
  filter: brightness(0.75) saturate(1.1);
  border-left-color: #e0a44a !important;
}

[data-theme="dark"] .head-today {
  background: #4a3418 !important;
  border-bottom-color: #e0a44a !important;
  color: #e0a44a !important;
}

[data-theme="dark"] .cell-today {
  box-shadow: inset 0 0 0 2px #e0a44a;
  background-image: linear-gradient(
    rgba(74, 52, 24, .5),
    rgba(74, 52, 24, .5)
  );
}

/* ==================== ВЫДЕЛЕНИЕ ЧИСЛА/ЧАСОВ ==================== */
.over { color: var(--success); font-weight: 600; }
.under { color: var(--danger); font-weight: 600; }

/* ==================== ВЫПАДАЮЩЕЕ МЕНЮ ==================== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
  min-width: 300px;
  z-index: 100;
  padding: 6px 0;
}
.dropdown-menu a {
  display: block;
  padding: 8px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.dropdown-menu a:hover {
  background: var(--th-bg);
  color: var(--primary);
}
.dropdown-menu.open { display: block; }

/* ==================== ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ==================== */
.theme-switch {
  display: inline-flex;
  gap: 2px;
  background: rgba(255, 255, 255, .15);
  border-radius: 14px;
  padding: 2px;
  font-size: 14px;
}
.theme-switch button {
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 13px;
}
.theme-switch button.active {
  background: rgba(255, 255, 255, .35);
}

/* ==================== АНИМАЦИИ ==================== */
.card, .btn, input, select, table tr, .flash {
  transition: background-color .2s ease, color .2s ease,
              border-color .2s ease, box-shadow .2s ease,
              transform .15s ease;
}

#modal, #mass-modal {
  animation: fadeIn .15s ease-out;
}
#modal > .card, #mass-modal > .card {
  animation: slideUp .2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0 }
  to   { opacity: 1 }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

main { animation: pageIn .18s ease-out; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* ==================== СКРОЛЛБАР (тёмная тема) ==================== */
[data-theme="dark"] ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #1b1f26;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #3a4351;
  border-radius: 5px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #4a5561;
}

/* ==================== ПЕЧАТЬ ==================== */
@media print {
  body { background: #fff; color: #000; }
  header, .toolbar, .theme-switch, .dropdown, .btn {
    display: none !important;
  }
  .card { box-shadow: none; border: 1px solid #ccc; }
  table th, table td { border-color: #999; }
}

/* ==================== АДАПТИВ ==================== */
@media (max-width: 900px) {
  /* ★ Защита от горизонтального скролла */
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* ★ Тулбар — вертикально */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* ★ Контейнеры тулбара — на всю ширину */
  .toolbar > *,
  .toolbar form,
  .toolbar form > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* ★ Label — на всю ширину, но внутри flex-row */
  .toolbar label {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  /* ★ Input/select внутри label — тянутся на остаток */
  .toolbar label input,
  .toolbar label select {
    flex: 1 1 auto;
    width: auto;
    min-width: 60px;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ★ Number — минимум 80px */
  .toolbar input[type="number"] {
    min-width: 80px;
  }

  /* ★ Кнопки — на всю ширину */
  .toolbar > button,
  .toolbar > .btn,
  .toolbar form > button,
  .toolbar form > .btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ★ Чекбокс-лейбл — inline, не растягивать */
  .toolbar .checkbox-label {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .toolbar .checkbox-label input[type="checkbox"] {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
  }

  /* ★ Dropdown — на всю ширину */
  .toolbar .dropdown {
    width: 100%;
  }
  .toolbar .dropdown > .btn {
    width: 100%;
  }

  /* ★ Чипсы — на всю ширину */
  .emp-picker {
    max-width: 100%;
    width: 100%;
    flex-basis: 100%;
  }
  .emp-picker input[type="text"] {
    min-width: 0;
    width: 100%;
  }

  /* ★ Header */
  header {
    max-width: 100%;
  }
  header .right {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
    gap: 8px;
    font-size: 12px;
    flex-wrap: wrap;
    min-width: 0;
  }
  header .badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  header .nav {
    width: 100%;
  }
}

@media (max-width: 600px) {
  header strong { font-size: 15px; }
  .muted { font-size: 11px; }
}
/* ==================== НАВИГАЦИЯ: ИКОНКИ, АКТИВНЫЙ ПУНКТ ==================== */

/* Десктопная навигация */
header .nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
header .nav > a,
header .nav > .nav-dropdown > .nav-drop-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: background .15s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
header .nav > a:hover,
header .nav > .nav-dropdown > .nav-drop-toggle:hover {
  background: rgba(255, 255, 255, .14);
  text-decoration: none;
}
header .nav > a.active,
header .nav > .nav-dropdown > .nav-drop-toggle.active {
  background: rgba(255, 255, 255, .22);
  border-color: rgba(255, 255, 255, .35);
  font-weight: 600;
}
.nav-ico {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
}

/* Выпадающее меню в навигации */
.nav-dropdown { position: relative; }
.nav-drop-toggle::after {
  content: "";
  display: inline-block;
  margin-left: 4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid rgba(255, 255, 255, .7);
  vertical-align: middle;
}
.nav-dropdown:hover .nav-drop-toggle::after { border-top-color: #fff; }

.nav-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 230px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  padding: 6px 0;
  z-index: 200;
}
.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown.open .nav-drop-menu { display: block; }

/* ★ Перебиваем общий header a для ссылок внутри подменю */
header .nav-drop-menu a,
header .nav .nav-drop-menu a {
  display: block;
  padding: 8px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  border: none;
  border-radius: 0;
  background: transparent;
}
header .nav-drop-menu a:hover,
header .nav .nav-drop-menu a:hover {
  background: var(--th-bg);
  color: var(--primary);
  text-decoration: none;
}

/* ==================== КНОПКИ: ВТОРОСТЕПЕННЫЕ, WARNING, ICON ==================== */

/* Контурная (второстепенная) — светлая на тёмном и наоборот */
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover {
  background: var(--th-bg);
  border-color: var(--primary);
  color: var(--primary);
}

/* Предупреждение */
.btn.warning {
  background: #f0ad4e;
  color: #000;
  border: 1px solid #ec971f;
}
.btn.warning:hover {
  background: #ec971f;
  color: #000;
}
[data-theme="dark"] .btn.warning {
  background: #e0a44a;
  color: #1a1a1a;
  border-color: #b26a00;
}
[data-theme="dark"] .btn.warning:hover {
  background: #b26a00;
  color: #fff;
}

/* Иконка-кнопка */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  font-size: 15px;
  min-width: 34px;
}

/* ==================== МОБИЛЬНАЯ НАВИГАЦИЯ: ДОПОЛНЕНИЯ ==================== */
@media (max-width: 900px) {
  /* Иконки в мобильном меню остаются */
  header .nav > a,
  header .nav > .nav-dropdown > .nav-drop-toggle {
    display: flex;
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, .06);
    border-radius: 6px;
  }

  /* Подменю раскрывается статично, а не absolute */
  .nav-drop-menu {
    position: static;
    min-width: 0;
    box-shadow: none;
    border: none;
    background: rgba(0, 0, 0, .15);
    border-radius: 6px;
    margin-top: 4px;
    padding: 4px 0;
  }
  header .nav-drop-menu a {
    color: #fff;
    background: transparent;
    padding: 8px 20px;
  }
  header .nav-drop-menu a:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
  }

  /* По умолчанию подменю скрыто, открывается по hover/tap */
  .nav-dropdown:hover .nav-drop-menu { display: none; }
  .nav-dropdown.open .nav-drop-menu { display: block; }
}
/* ==================== TOAST ==================== */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
  border-left: 4px solid var(--primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
  font-size: 13px;
  max-width: 340px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: auto;
}
.toast-show { opacity: 1; transform: translateX(0); }
.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--danger); }
.toast-info    { border-left-color: var(--primary); }

/* ==================== UI-МОДАЛКА ==================== */
.ui-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  opacity: 0;
  transition: opacity .18s ease;
}
.ui-modal-overlay.show { opacity: 1; }
.ui-modal-card {
  background: var(--bg-card);
  color: var(--text);
  border-radius: 10px;
  padding: 22px 24px;
  min-width: 360px;
  max-width: 480px;
  width: min(90vw, 480px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
  transform: translateY(-12px) scale(.98);
  transition: transform .2s ease;
}
.ui-modal-overlay.show .ui-modal-card { transform: translateY(0) scale(1); }
.ui-modal-card h3 { margin: 0 0 10px; font-size: 16px; }
.ui-modal-text {
  font-size: 13px;
  color: var(--text-mut);
  margin-bottom: 16px;
  white-space: pre-line;
  line-height: 1.5;
}
.ui-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.ui-modal-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-mut);
}
.ui-modal-label input,
.ui-modal-label textarea {
  width: 100%;
  font-size: 13px;
}
.ui-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ==================== АНИМАЦИЯ СОХРАНЕНИЯ ==================== */
.cell-saved {
  animation: cellSaved 0.9s ease-out;
}
@keyframes cellSaved {
  0%   { box-shadow: 0 0 0 3px rgba(46, 125, 50, .8); }
  60%  { box-shadow: 0 0 0 3px rgba(46, 125, 50, .4); }
  100% { box-shadow: 0 0 0 3px rgba(46, 125, 50, 0); }
}
.filter-btn.active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}
/* ==================== TELEGRAM — НАСТРОЙКИ ==================== */
.tg-settings {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease;
}
.tg-row:hover {
  background: var(--th-bg);
}
.tg-row input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.tg-row span {
  font-size: 13px;
  line-height: 1.4;
}
.tg-row small {
  font-size: 11px;
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
/* ==================== INPUT + КНОПКА ==================== */
.input-with-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
}
.input-with-btn input {
  flex: 1;
}
.input-with-btn .btn {
  padding: 4px 8px;
  height: 32px;
  min-width: 32px;
  font-size: 14px;
}
/* ==================== INVITE-ССЫЛКА ==================== */
.invite-card {
  background: var(--flash-ok-bg);
  border-left: 4px solid var(--success);
  padding: 14px 16px;
  color: var(--flash-ok-tx);
}
.invite-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.invite-left {
  flex: 1;
  min-width: 0;
}
.invite-right {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.invite-title {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 4px;
}
.invite-hint {
  font-size: 13px;
  margin-bottom: 8px;
  opacity: .9;
}
.invite-link {
  font-size: 13px;
  user-select: all;
  word-break: break-all;
  background: rgba(255, 255, 255, .5);
  padding: 6px 10px;
  border-radius: 4px;
  display: inline-block;
  max-width: 100%;
  transition: background .3s ease;
}
[data-theme="dark"] .invite-link {
  background: rgba(0, 0, 0, .3);
}
/* ==================== ЛИЧНАЯ ССЫЛКА В ПРАВОЙ ЧАСТИ ==================== */
.nav-personal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff !important;
  text-decoration: none !important;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 500;
  font-size: 13px;
  transition: background 0.15s ease;
  margin-right: 4px;
}
.nav-personal-link:hover {
  background: rgba(255, 255, 255, 0.2);
}
.nav-personal-link.active {
  background: rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

/* Адаптив: на мобильных "Мой график" становится на всю ширину */
@media (max-width: 900px) {
  .nav-personal-link {
    width: 100%;
    justify-content: center;
    padding: 10px;
    margin-bottom: 8px;
  }
}
/* ==================== ФИКС ШАПКИ (ВЫРАВНИВАНИЕ) ==================== */
header {
  justify-content: space-between; /* Логотип слева, профиль справа */
}
.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* ==================== ЗАГОЛОВКИ В ВЫПАДАЮЩЕМ МЕНЮ ==================== */
.dropdown-header {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-mut);
  font-weight: 700;
  padding: 10px 14px 4px;
  margin-top: 4px;
}
.dropdown-header:first-child {
  margin-top: 0;
}

/* ==================== ЛИЧНАЯ ССЫЛКА В ПРАВОЙ ЧАСТИ ==================== */
.nav-personal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff !important;
  text-decoration: none !important;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 500;
  font-size: 13px;
  transition: background 0.15s ease;
  margin-right: 4px;
}
.nav-personal-link:hover {
  background: rgba(255, 255, 255, 0.2);
}
.nav-personal-link.active {
  background: rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

/* ==================== АДАПТИВ ДЛЯ НОВОЙ ШАПКИ ==================== */
@media (max-width: 900px) {
  .header-left {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-personal-link {
    width: 100%;
    justify-content: center;
    padding: 10px;
    margin-bottom: 8px;
  }
}
