/* =========================================================================
   Corteos TimeTracker — design system
   Все цвета через CSS-переменные. Меняем тему через .dark на <html>.
   ========================================================================= */

:root {
  /* Палитра — светлая тема */
  --crt-primary:        #4f46e5;
  --crt-primary-hover:  #4338ca;
  --crt-primary-soft:   #eef2ff;
  --crt-primary-text:   #4338ca;

  --crt-bg:             #f4f6f9;
  --crt-surface:        #ffffff;
  --crt-surface-2:      #fafbfc;
  --crt-surface-3:      #f1f4f8;

  --crt-text:           #1f2328;
  --crt-text-muted:     #6b7280;
  --crt-text-faint:     #9aa1ab;

  --crt-border:         #e5e8ee;
  --crt-border-soft:    #eef1f5;

  --crt-success:        #1fa15b;
  --crt-success-bg:     #e6f6ec;
  --crt-warning:        #c9821f;
  --crt-warning-bg:     #fdf3e2;
  --crt-danger:         #c4403b;
  --crt-danger-bg:      #fdeceb;
  --crt-info:           #2563eb;
  --crt-info-bg:        #eff6ff;

  --crt-shadow-sm:      0 1px 2px rgba(16,24,40,.04);
  --crt-shadow:         0 1px 3px rgba(16,24,40,.05), 0 1px 2px rgba(16,24,40,.04);
  --crt-shadow-lg:      0 10px 30px rgba(16,24,40,.08);

  --crt-radius:         6px;
  --crt-radius-lg:      8px;
  --crt-radius-pill:    999px;

  --crt-sidebar-w:      240px;
  --crt-topbar-h:       56px;

  --crt-font:           "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                        Roboto, "Helvetica Neue", Arial, sans-serif;
  --crt-font-mono:      ui-monospace, SFMono-Regular, "SF Mono", Menlo,
                        Consolas, monospace;

  color-scheme: light;
}

.dark {
  --crt-primary:        #818cf8;
  --crt-primary-hover:  #a5b4fc;
  --crt-primary-soft:   #1e1b4b;
  --crt-primary-text:   #c7d2fe;

  --crt-bg:             #0f1419;
  --crt-surface:        #1a2029;
  --crt-surface-2:      #1f2731;
  --crt-surface-3:      #232b36;

  --crt-text:           #e6e9ee;
  --crt-text-muted:     #9ca3af;
  --crt-text-faint:     #6b7280;

  --crt-border:         #2a3240;
  --crt-border-soft:    #232b36;

  --crt-success:        #34d399;
  --crt-success-bg:     #064e3b;
  --crt-warning:        #fbbf24;
  --crt-warning-bg:     #78350f;
  --crt-danger:         #f87171;
  --crt-danger-bg:      #7f1d1d;
  --crt-info:           #60a5fa;
  --crt-info-bg:        #1e3a8a;

  --crt-shadow-sm:      0 1px 2px rgba(0,0,0,.4);
  --crt-shadow:         0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
  --crt-shadow-lg:      0 10px 30px rgba(0,0,0,.5);

  color-scheme: dark;
}

/* =========================================================================
   База
   ========================================================================= */
*,*::before,*::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--crt-bg);
  color: var(--crt-text);
  font-family: var(--crt-font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--crt-primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }

[x-cloak] { display: none !important; }

/* Нативные элементы управления под тему */
input, select, textarea, button { font-family: inherit; font-size: inherit; }

input, select, textarea {
  background: var(--crt-surface);
  color: var(--crt-text);
  border: 1px solid var(--crt-border);
  border-radius: var(--crt-radius);
  padding: 8px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--crt-primary);
  box-shadow: 0 0 0 3px var(--crt-primary-soft);
}
input::placeholder, textarea::placeholder { color: var(--crt-text-faint); }
input:disabled, select:disabled, textarea:disabled {
  background: var(--crt-surface-3);
  color: var(--crt-text-faint);
  cursor: not-allowed;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%236b7280' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.dark select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%239ca3af' d='M0 0l5 6 5-6z'/></svg>");
}

/* Календарик в dark */
.dark input[type="date"]::-webkit-calendar-picker-indicator,
.dark input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.dark input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.85);
  cursor: pointer;
}

/* Автозаполнение Chrome */
.dark input:-webkit-autofill,
.dark input:-webkit-autofill:hover,
.dark input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--crt-text);
  -webkit-box-shadow: 0 0 0 1000px var(--crt-surface) inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* =========================================================================
   Layout: sidebar + main
   ========================================================================= */
.crt-app {
  display: flex;
  min-height: 100vh;
  background: var(--crt-bg);
}

/* ---------- Sidebar ---------- */
.crt-sidebar {
  width: var(--crt-sidebar-w);
  flex-shrink: 0;
  background: var(--crt-surface);
  border-right: 1px solid var(--crt-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.crt-sidebar__brand {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--crt-border-soft);
}
.crt-sidebar__brand-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--crt-primary-text);
  letter-spacing: -.01em;
}
.crt-sidebar__brand-sub {
  font-size: 11px;
  color: var(--crt-text-muted);
  margin-top: 2px;
}

.crt-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.crt-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 14px;
  margin: 1px 8px;
  border-radius: var(--crt-radius);
  color: var(--crt-text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none !important;
  position: relative;
  transition: background .12s, color .12s;
}
.crt-nav-item i {
  width: 18px;
  text-align: center;
  color: var(--crt-text-muted);
  font-size: 13px;
}
.crt-nav-item:hover {
  background: var(--crt-surface-3);
}
.crt-nav-item.is-active {
  background: var(--crt-primary-soft);
  color: var(--crt-primary-text);
}
.crt-nav-item.is-active i {
  color: var(--crt-primary-text);
}
.crt-nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--crt-primary);
}

.crt-nav-item--external i.fa-arrow-up-right-from-square {
  font-size: 9px;
  margin-left: auto;
  color: var(--crt-text-faint);
  width: auto;
}

.crt-sidebar__footer {
  border-top: 1px solid var(--crt-border-soft);
  padding: 12px;
}
.crt-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: var(--crt-radius);
}
.crt-sidebar__user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--crt-primary-soft);
  color: var(--crt-primary-text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
.crt-sidebar__user-meta { flex: 1; min-width: 0; }
.crt-sidebar__user-name {
  font-size: 13px; font-weight: 600;
  color: var(--crt-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crt-sidebar__user-role {
  font-size: 11px;
  color: var(--crt-text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.crt-sidebar__actions {
  display: flex; gap: 6px; margin-top: 8px;
}
.crt-sidebar__actions .crt-btn { flex: 1; justify-content: center; }

/* ---------- Main ---------- */
.crt-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--crt-bg);
}

.crt-topbar {
  display: none;            /* включается в мобильной версии */
  align-items: center;
  gap: 12px;
  height: var(--crt-topbar-h);
  padding: 0 16px;
  background: var(--crt-surface);
  border-bottom: 1px solid var(--crt-border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.crt-topbar__title {
  font-weight: 600;
  color: var(--crt-text);
  font-size: 14px;
}

.crt-burger {
  width: 36px; height: 36px;
  border-radius: var(--crt-radius);
  background: transparent;
  border: 1px solid var(--crt-border);
  color: var(--crt-text);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.crt-burger:hover { background: var(--crt-surface-3); }

.crt-content {
  flex: 1;
  padding: 24px 28px 40px;
  min-width: 0;
}

/* Backdrop для мобильного drawer'а */
.crt-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 40;
}

/* =========================================================================
   Компоненты
   ========================================================================= */

/* ---------- Заголовок страницы ---------- */
.crt-page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.crt-page-head__main { flex: 1; min-width: 0; }
.crt-page-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--crt-text);
  letter-spacing: -.015em;
  margin: 0;
}
.crt-page-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--crt-text-muted);
}
.crt-page-head__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- Карточка ---------- */
.crt-card {
  background: var(--crt-surface);
  border: 1px solid var(--crt-border);
  border-radius: var(--crt-radius-lg);
  box-shadow: var(--crt-shadow-sm);
  margin-bottom: 16px;
}
.crt-card__body { padding: 18px 20px; }
.crt-card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--crt-border-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.crt-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--crt-text);
}

/* ---------- Кнопки ---------- */
.crt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--crt-radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
  background: transparent;
  color: var(--crt-text);
}
.crt-btn i { font-size: 12px; }

.crt-btn--primary {
  background: var(--crt-primary);
  color: #fff;
}
.crt-btn--primary:hover { background: var(--crt-primary-hover); }

.crt-btn--ghost {
  background: var(--crt-surface);
  border-color: var(--crt-border);
  color: var(--crt-text);
}
.crt-btn--ghost:hover { background: var(--crt-surface-3); }

.crt-btn--danger {
  background: var(--crt-danger);
  color: #fff;
}
.crt-btn--danger:hover { filter: brightness(.93); }

.crt-btn--success {
  background: var(--crt-success);
  color: #fff;
}
.crt-btn--success:hover { filter: brightness(.93); }

.crt-btn--sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.crt-btn--icon { width: 36px; padding: 0; }
.crt-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Плашки / бейджи ---------- */
.crt-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--crt-radius-pill);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.crt-badge--green  { background: var(--crt-success-bg); color: var(--crt-success); }
.crt-badge--amber  { background: var(--crt-warning-bg); color: var(--crt-warning); }
.crt-badge--red    { background: var(--crt-danger-bg);  color: var(--crt-danger); }
.crt-badge--blue   { background: var(--crt-info-bg);    color: var(--crt-info); }
.crt-badge--grey   { background: var(--crt-surface-3);  color: var(--crt-text-muted); }

/* ---------- iOS-switch ---------- */
.crt-switch {
  display: inline-block;
  position: relative;
  width: 34px; height: 20px;
  cursor: pointer;
  vertical-align: middle;
}
.crt-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.crt-switch .track {
  position: absolute; inset: 0;
  background: #cfd4dc;
  border-radius: 20px;
  transition: background .18s;
}
.dark .crt-switch .track { background: #3a4351; }
.crt-switch .track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.crt-switch input:checked + .track { background: var(--crt-primary); }
.crt-switch input:checked + .track::after { transform: translateX(14px); }
.crt-switch input:disabled + .track { opacity: .5; cursor: not-allowed; }

/* ---------- Таблица ---------- */
.crt-table-wrap {
  overflow-x: auto;
  border-radius: var(--crt-radius-lg);
}
.crt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.crt-table th {
  text-align: left;
  font-weight: 600;
  color: var(--crt-text);
  font-size: 12.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--crt-border);
  white-space: nowrap;
  background: var(--crt-surface);
}
.crt-table th a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--crt-border);
  text-underline-offset: 3px;
}
.crt-table th a:hover { color: var(--crt-primary-text); text-decoration-color: currentColor; }

.crt-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--crt-border-soft);
  vertical-align: middle;
  color: var(--crt-text);
}
.crt-table tbody tr:hover td { background: var(--crt-surface-2); }
.crt-table tbody tr:last-child td { border-bottom: 0; }

/* ---------- Tabs ---------- */
.crt-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--crt-border);
  overflow-x: auto;
  margin-bottom: 18px;
}
.crt-tab {
  padding: 10px 0;
  font-size: 13.5px;
  color: var(--crt-text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
  text-decoration: none !important;
}
.crt-tab:hover { color: var(--crt-primary-text); }
.crt-tab.is-active {
  color: var(--crt-text);
  font-weight: 600;
  border-bottom-color: var(--crt-text);
}

/* ---------- Тулбар над таблицей ---------- */
.crt-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--crt-border-soft);
}
.crt-toolbar__count { font-size: 12.5px; color: var(--crt-text-muted); }
.crt-toolbar__count b { color: var(--crt-text); font-weight: 600; }
.crt-toolbar__right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Поля поиска ---------- */
.crt-search { position: relative; display: inline-flex; }
.crt-search input {
  height: 36px;
  width: 260px;
  padding-right: 40px;
  border-radius: var(--crt-radius) 0 0 var(--crt-radius);
  border-right: 0;
}
.crt-search__btn {
  height: 36px;
  width: 42px;
  border: 0;
  background: #2b3a55;
  color: #fff;
  border-radius: 0 var(--crt-radius) var(--crt-radius) 0;
  cursor: pointer;
}
.crt-search__btn:hover { background: #1e2a3f; }
.dark .crt-search__btn { background: var(--crt-primary); }
.dark .crt-search__btn:hover { background: var(--crt-primary-hover); }

/* ---------- Полезные утилиты ---------- */
.crt-muted   { color: var(--crt-text-muted); }
.crt-faint   { color: var(--crt-text-faint); }
.crt-mono    { font-family: var(--crt-font-mono); }
.crt-divider { height: 1px; background: var(--crt-border-soft); margin: 16px 0; }
.crt-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--crt-text-muted);
  font-style: italic;
}

/* =========================================================================
   Плашки Tailwind под наши токены (theme bridge)
   Позволяет дочерним шаблонам, которые используют bg-white/dark:bg-gray-800,
   нормально перекрашиваться вместе с нашей темой.
   ========================================================================= */

/* Карточки и фоны */
.dark .bg-white        { background-color: var(--crt-surface)   !important; }
.dark .bg-gray-50      { background-color: var(--crt-bg)        !important; }
.dark .bg-gray-100     { background-color: var(--crt-surface-3) !important; }
.dark .bg-gray-800     { background-color: var(--crt-surface)   !important; }
.dark .bg-gray-900     { background-color: var(--crt-bg)        !important; }
.dark .bg-slate-50     { background-color: var(--crt-bg)        !important; }
.dark .bg-slate-100    { background-color: var(--crt-surface-3) !important; }
.dark .bg-slate-800    { background-color: var(--crt-surface)   !important; }

/* Текст */
.dark .text-gray-900   { color: var(--crt-text)        !important; }
.dark .text-gray-800   { color: var(--crt-text)        !important; }
.dark .text-gray-700   { color: var(--crt-text)        !important; }
.dark .text-gray-600   { color: var(--crt-text-muted)  !important; }
.dark .text-gray-500   { color: var(--crt-text-muted)  !important; }
.dark .text-gray-400   { color: var(--crt-text-faint)  !important; }
.dark .text-slate-900  { color: var(--crt-text)        !important; }
.dark .text-slate-700  { color: var(--crt-text)        !important; }
.dark .text-slate-500  { color: var(--crt-text-muted)  !important; }

/* Границы */
.dark .border-gray-100 { border-color: var(--crt-border-soft) !important; }
.dark .border-gray-200 { border-color: var(--crt-border)      !important; }
.dark .border-gray-300 { border-color: var(--crt-border)      !important; }
.dark .border-gray-600 { border-color: var(--crt-border)      !important; }
.dark .border-gray-700 { border-color: var(--crt-border)      !important; }

/* Розовые/синие кнопки — оставляем, но hover корректируем */
.dark .hover\:bg-gray-50:hover  { background-color: var(--crt-surface-2) !important; }
.dark .hover\:bg-gray-100:hover { background-color: var(--crt-surface-3) !important; }
.dark .hover\:bg-gray-200:hover { background-color: var(--crt-surface-3) !important; }

/* =========================================================================
   Адаптив
   ========================================================================= */

/* Планшет */
@media (max-width: 1024px) {
  .crt-content { padding: 20px; }
}

/* Мобилка */
@media (max-width: 768px) {
  .crt-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.15);
    height: 100vh;
  }
  .crt-sidebar.is-open { transform: translateX(0); }

  .crt-sidebar-backdrop.is-open { display: block; }

  .crt-topbar { display: flex; }

  .crt-content { padding: 16px; }

  .crt-page-title { font-size: 18px; }
  .crt-page-sub { font-size: 12px; }

  .crt-toolbar { padding: 12px; }
  .crt-toolbar__right { width: 100%; }
  .crt-search { flex: 1; }
  .crt-search input { width: 100%; }

  .crt-page-head__actions { width: 100%; }
  .crt-page-head__actions .crt-btn { flex: 1; justify-content: center; }

  .crt-table th, .crt-table td { padding: 10px 12px; }

  .crt-tabs { gap: 16px; }
  .crt-tab { font-size: 13px; padding: 9px 0; }
}

/* Очень узкие экраны — прячем менее важные колонки */
@media (max-width: 640px) {
  .crt-hide-xs { display: none !important; }
}

/* =========================================================================
   Утилиты, добавленные для дочерних страниц
   ========================================================================= */

/* Сетка метрик */
.crt-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 1024px) { .crt-metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .crt-metrics { grid-template-columns: 1fr; } }

.crt-metric {
  background: var(--crt-surface);
  border: 1px solid var(--crt-border);
  border-radius: var(--crt-radius-lg);
  padding: 16px 18px;
  box-shadow: var(--crt-shadow-sm);
}
.crt-metric__label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--crt-text-faint);
  margin-bottom: 6px;
}
.crt-metric__value {
  font-size: 26px;
  font-weight: 700;
  color: var(--crt-text);
  letter-spacing: -.02em;
  line-height: 1.1;
}
.crt-metric__value--muted { color: var(--crt-text-muted); font-size: 20px; }
.crt-metric__value--success { color: var(--crt-success); }
.crt-metric__value--danger  { color: var(--crt-danger); }

/* Двухколоночный лэйаут */
.crt-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1024px) { .crt-grid-2 { grid-template-columns: 1fr; } }

.crt-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1024px) { .crt-grid-3 { grid-template-columns: 1fr; } }

/* Баннер */
.crt-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--crt-primary-soft);
  border: 1px solid var(--crt-border);
  border-radius: var(--crt-radius-lg);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.crt-banner__main { flex: 1; min-width: 220px; }
.crt-banner__title {
  font-weight: 600;
  color: var(--crt-text);
  margin-bottom: 2px;
}
.crt-banner__text {
  font-size: 12.5px;
  color: var(--crt-text-muted);
}
.crt-banner__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Активная сессия (карточка-строка) */
.crt-active-session {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--crt-surface);
  border: 1px solid var(--crt-border-soft);
  border-radius: var(--crt-radius);
  margin-top: 6px;
}
.crt-active-session__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--crt-primary-soft);
  color: var(--crt-primary-text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
  flex-shrink: 0;
}
.crt-active-session__main { flex: 1; min-width: 0; }
.crt-active-session__name {
  font-weight: 600; font-size: 13px;
  color: var(--crt-text);
}
.crt-active-session__task {
  font-size: 12.5px;
  color: var(--crt-text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crt-active-session__timer {
  font-family: var(--crt-font-mono);
  font-size: 13px;
  color: var(--crt-primary-text);
  font-weight: 600;
  flex-shrink: 0;
}

/* Форма-фильтры */
.crt-filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--crt-border-soft);
}
@media (max-width: 900px) { .crt-filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .crt-filters { grid-template-columns: 1fr; } }
.crt-filters__full { grid-column: 1 / -1; }
.crt-filters__label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--crt-text-muted);
  margin-bottom: 4px;
}
.crt-filters__row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-bottom: 1px solid var(--crt-border-soft);
  font-size: 12.5px;
  color: var(--crt-text);
}
.crt-filters__row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Модалка */
.crt-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,20,25,.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.crt-modal {
  background: var(--crt-surface);
  border: 1px solid var(--crt-border);
  border-radius: var(--crt-radius-lg);
  box-shadow: var(--crt-shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
}
.crt-modal--wide { max-width: 900px; }
.crt-modal__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--crt-border-soft);
}
.crt-modal__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--crt-text);
  flex: 1;
}
.crt-modal__close {
  width: 32px; height: 32px;
  border-radius: var(--crt-radius);
  border: 0;
  background: transparent;
  color: var(--crt-text-muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.crt-modal__close:hover { background: var(--crt-surface-3); color: var(--crt-text); }
.crt-modal__body { padding: 20px; }
.crt-modal__footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--crt-border-soft);
  justify-content: flex-end;
}
.crt-modal__field { margin-bottom: 14px; }
.crt-modal__field label {
  display: block;
  font-size: 12px;
  color: var(--crt-text-muted);
  margin-bottom: 5px;
}
.crt-modal__field input,
.crt-modal__field select,
.crt-modal__field textarea { width: 100%; }
.crt-modal__field textarea { resize: vertical; }

/* Форма внутри карточки (для suspicious и т.п.) */
.crt-form-row {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--crt-border-soft);
  flex-wrap: wrap;
}
.crt-form-row > * { flex: 1; min-width: 120px; }

/* Changelog */
.crt-changelog { padding: 0 18px 18px; }
.crt-changelog details {
  border: 1px solid var(--crt-border-soft);
  border-radius: var(--crt-radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.crt-changelog summary {
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--crt-surface-2);
  font-weight: 500;
  font-size: 13px;
}
.crt-changelog summary:hover { background: var(--crt-surface-3); }
.crt-changelog details[open] summary { border-bottom: 1px solid var(--crt-border-soft); }
.crt-changelog__body {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--crt-text);
  line-height: 1.7;
}
.crt-changelog__body p { margin: 0 0 4px; }

/* Sticky первую колонку таблицы отчётов */
.crt-table--sticky td.sticky-col,
.crt-table--sticky th.sticky-col {
  position: sticky;
  left: 0;
  background: var(--crt-surface);
  z-index: 1;
  border-right: 1px solid var(--crt-border);
}
.crt-table--sticky thead th.sticky-col { z-index: 2; }
.crt-table--sticky tbody tr:hover td.sticky-col { background: var(--crt-surface-2); }

/* ============ Заголовки блоков в сайдбаре ============ */
.crt-nav-section {
  margin-bottom: 6px;
  padding-top: 4px;
}
.crt-nav-section__title {
  padding: 10px 16px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--crt-text-faint);
}
.crt-nav-section:not(:first-child) {
  border-top: 1px solid var(--crt-border-soft);
  margin-top: 8px;
}
