/*
 * This is a manifest file that'll be compiled into application.css.
 */

:root {
  --bg: #F4F4F4;
  --surface: #fefefe;
  --text: #242424;
  --link-color: #2563eb;
  --link-hover: #1e40af;
  --muted: #7b8494;
  --muted-light: #9fa6b2;
  --border: #E5E5E5;
  --type-criminal: #fca5a5;
  --type-civil: #93c5fd;
  --type-administrative: #fcd34d;
  --type-administrative_offense: #c4b5fd;
  --type-materials: #99f6e4;
  --color-error: #f87171;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  padding: 24px 20px;
  height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 1400px;
  height: 100%;
}

/* ВЕРХНЕЕ МЕНЮ */
.top-nav {
  display: flex;
  gap: 8px;
  background: transparent;
  flex-shrink: 0;
}

.nav-tab {
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.2s ease;
}

.nav-tab:hover:not(.active) {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}

.nav-tab.active {
  background: var(--text);
  color: #fff;
}

.app-container {
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.02);
  width: 100%;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative; 
  overflow: visible; 
}

/* ПРОГРЕСС-БАР */
.loading-bar-wrapper {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 24px; overflow: hidden; pointer-events: none; z-index: 1000;
}
.top-loading-bar {
  position: absolute; top: 0; left: 0; height: 3px;
  background: var(--link-color); width: 0%; opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
}
.top-loading-bar.loading { opacity: 1; }
.top-loading-bar.done { width: 100% !important; opacity: 1; }

/* 1. ЗОНА ПОИСКА */
.header-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.title-group { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
}

.title-group h1 { 
  font-size: 22px; 
  font-weight: 600; 
  letter-spacing: -0.02em; 
  line-height: 32px; 
  margin: 0;
}

.search-group {
  display: flex; 
  align-items: center; 
   
  flex: 1; 
  max-width: 620px; 
  margin-left: auto;
}

.subtitle { font-size: 13px; color: var(--muted); transition: color 0.2s; }
.subtitle strong { color: var(--text); font-weight: 500; }
.subtitle.is-error { color: var(--color-error); }
.subtitle.is-error strong { color: var(--color-error); }

.search-box { position: relative; flex: 1; }
.search-box svg.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted-light); pointer-events: none;
}
.search-box input {
  width: 100%; padding: 10px 38px 10px 42px; font-size: 14px; color: var(--text);
  background: #F4F4F4; border: 1px solid transparent; border-radius: 10px; outline: none; transition: all 0.2s;
}
.search-box input:focus { 
  background: #fff; 
  border-color: var(--text); 
   
}


/* 1. ВТОРОСТЕПЕННЫЙ ТЕКСТ (должен быть строго var(--muted)) */
.state-desc,             /* Описание в пустых состояниях ("По умолчанию мы ищем...") */
.item-subtitle,          /* Регион под названием суда, "1 суд" */
.selected-item-subtitle, /* Регион в выбранных судах */
.court-name,             /* Название суда в таблице дел */
.text-muted,             /* Утилитарный класс */
.filter-label,           /* Заголовки полей ("Суд", "Инстанция") */
.section-label,          /* Заголовки секций ("Регионы", "Суды") */
.selected-group-title,   /* Заголовки в выбранных ("Регионы", "Суды") */
.checkbox-hint,          /* Подсказки у инстанций ("Жалобы на...") */
.subtitle {              /* Подзаголовки в других местах */
  color: var(--muted) !important;
}

.state-title,            /* Заголовки в пустых состояниях ("Все суды") */
.item-title,             /* Названия судов и регионов */
.selected-item-title,    /* Названия в выбранных */
.case-num,               /* Номера дел в таблице */
.checkbox-text {         /* Заголовки инстанций ("Первая инстанция") */
  color: var(--text) !important;
}

::selection {
  background: rgba(37, 99, 235, 0.15); /* Мягкий синий вместо системного серого */
  color: var(--text);
}

/* Универсальная кнопка очистки */
.clear-search-btn,
.clear-icon {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; display: none; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--muted); background: #E5E5E5; 
  transition: background 0.15s, color 0.15s; z-index: 2; cursor: pointer; border: none; padding: 0;
}

.clear-search-btn:hover,
.clear-icon:hover { 
  background: #d1d5db; color: var(--text);
}

.clear-search-btn svg,
.clear-icon svg { width: 12px; height: 12px; }

.search-box input:not(:placeholder-shown) ~ .clear-search-btn { display: flex; }
.search-wrapper input:not(:placeholder-shown) ~ .clear-icon { display: flex; }

/* Группа кнопок справа от поиска */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Базовые стили кнопок */
.action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; transition: all 0.2s;
}
.action-btn svg { width: 18px; height: 18px; }

/* Кнопка фильтров */
.action-btn.filter-btn {
  background: #F4F4F4; color: var(--text); position: relative;
}
.action-btn.filter-btn:hover { background: #E5E5E5; }

.action-btn.filter-btn.has-active-filters {
   
}
.action-btn.filter-btn.has-active-filters::after {
   position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; background-color: var(--link-color);
  border-radius: 50%; border: 1.5px solid #fff; box-sizing: border-box;
}

/* Призрачные кнопки */
.action-btn.ghost-btn { background: transparent; color: var(--muted); }
.action-btn.ghost-btn:hover, .action-btn.ghost-btn.active { background: #F4F4F4; color: var(--text); }

.save-search-btn svg { transition: fill 0.2s, stroke 0.2s; }
.save-search-btn.active svg { fill: var(--text); stroke: var(--text); }

.action-btn.loading { pointer-events: none; opacity: 0.5; }
.action-btn.loading svg { animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: 0.5; } to { opacity: 1; } }

/* ФИЛЬТРЫ (Поповер) */
.filter-wrapper { position: relative; }

.filter-popover {
  position: absolute; top: calc(100% + 10px); right: 0; width: 340px;
  background: #fdfdfd; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  padding: 20px; z-index: 100; opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Блок следующего заседания */
.next-hearing {
  background: #fdfdfd;
  border: 1px solid var(--border); /* Тонкая рамка */
  border-radius: 12px;
  padding: 16px 20px;
  
  /* Убираем страшную тень */
  box-shadow: none; 
  
  /* Выравниваем элементы по центру */
  display: flex;
  align-items: center;
  gap: 16px;
}

.filter-popover.show { opacity: 1; visibility: visible; transform: translateY(0); }
.filter-popover::before {
  content: ""; position: absolute; top: -6px; right: 14px; width: 10px; height: 10px;
  background: #fff; border-left: 1px solid var(--border); border-top: 1px solid var(--border); transform: rotate(45deg);
}

.filter-header { font-size: 14px; font-weight: 600; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.history > .filter-header { margin-bottom: 0 !important; }
.history { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.close-btn {
  display: flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 6px; color: var(--muted); transition: background 0.15s, color 0.15s; margin-right: -4px;
}
.close-btn:hover { background: #F4F4F4; color: var(--text); }
.close-btn svg { width: 16px; height: 16px; }

.filter-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.filter-label { font-size: 12px; font-weight: 500; color: var(--muted); }

.custom-select-wrapper { position: relative; }
.custom-select-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: #F9F9F9; border: 1px solid var(--border); padding: 0 14px;
  border-radius: 8px; font-size: 13px; color: var(--text); 
  transition: border-color 0.2s, background 0.2s; text-align: left;
  height: 36px;
}

.custom-select-trigger .select-value {
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; 
  text-overflow: ellipsis; text-align: left; margin-right: 8px;      
}

.custom-select-trigger.active { border-color: var(--text); background: #fff; }
.custom-select-trigger svg { width: 14px; height: 14px; color: var(--muted); transition: transform 0.2s; flex-shrink: 0; }
.custom-select-trigger.active svg { transform: rotate(180deg); }

.custom-select-dropdown,
.courts-filter-wrapper .popover {
  position: absolute !important;
  top: calc(100% + 8px) !important; 
  left: 0 !important;
  width: calc(100% + 42px) !important;
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
  z-index: 100 !important;
  overflow: visible !important; 
}

.custom-select-dropdown {
  display: none; 
  padding: 12px !important; 
  flex-direction: column !important;
  max-height: 280px !important;
  top: calc(100% + 8px) !important;
}

.custom-select-dropdown.show { display: flex; }

/* ЖЕСТКИЙ ЗАМОК (Страховка) */
#filter-popover:not(.show) .custom-select-dropdown { display: none !important; }
#filter-popover:not(.show) .custom-select-trigger { border-color: var(--border) !important; background: #F9F9F9 !important; }
.custom-select-dropdown:not(.show) { display: none !important; }

/* ИНПУТ ПОИСКА ВНУТРИ ФИЛЬТРОВ */
.search-wrapper { position: relative; margin-bottom: 8px; flex-shrink: 0; }
.search-wrapper input {
  width: 100%; padding: 8px 36px 8px 32px; font-size: 13px;
  color: var(--text); background: #F4F4F4; border: 1px solid transparent;
  border-radius: 8px; outline: none; transition: all 0.2s;
}
.search-wrapper input:focus { background: #fff; border-color: var(--text);  }
.search-wrapper svg.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--muted-light); pointer-events: none;
}
.search-wrapper .clear-icon {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 18px !important; height: 18px !important; display: none; 
  align-items: center; justify-content: center; border-radius: 50%; color: var(--muted); background: #E5E5E5; 
  transition: background 0.15s, color 0.15s; z-index: 2; cursor: pointer; border: none; padding: 0;
}
.search-wrapper .clear-icon:hover { background: #d1d5db; color: var(--text); }
.search-wrapper .clear-icon svg { width: 10px !important; height: 10px !important; }

/* Список опций */
.options-list { overflow-y: auto; flex: 1; padding-right: 4px; }
.options-list::-webkit-scrollbar { width: 4px; }
.options-list::-webkit-scrollbar-track { background: transparent; }
.options-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ==========================================================================
   ЖЕСТКИЙ ФИКС ИНПУТА ДАТЫ (ПЕРЕБИВАЕМ FLATPICKR)
   ========================================================================== */

.date-input-wrapper {
  position: relative;
  display: block;
  width: 100%;
  height: 36;
}

/* Применяем стили ко ВСЕМ текстовым инпутам внутри обертки (включая те, что создает Flatpickr) */
.date-input-wrapper input:not([type="hidden"]),
.date-input-wrapper .flatpickr-input {
  display: block !important;
  width: 100% !important; /* Растягиваем на всю ширину, чтобы клик работал везде */
  height: 36px !important; /* Высота как у селектов */
  background-color: #F9F9F9 !important; /* Серый фон */
  border: 1px solid var(--border) !important; /* Полная рамка со всех сторон */
  border-radius: 8px !important;
  padding: 0 38px 0 14px !important;
  font-family: inherit !important; /* Возвращаем шрифт Inter */
  line-height: normal !important;
  font-size: 13px !important;
  color: var(--text) !important;
  outline: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  cursor: pointer !important; /* Курсор-рука на всей области */
}

/* Эффекты при наведении и фокусе */
.date-input-wrapper input:not([type="hidden"]):hover,
.date-input-wrapper .flatpickr-input:hover {
  background-color: #fff !important;
  border-color: var(--text) !important;
}

.date-input-wrapper input:not([type="hidden"]):focus,
.date-input-wrapper .flatpickr-input:focus,
.date-input-wrapper input.active {
  background-color: #fff !important;
  border-color: var(--text) !important;
}

/* Цвет плейсхолдера */
.date-input-wrapper input::placeholder {
  color: var(--text) !important;
  opacity: 1 !important;
}

/* Стрелочка */
.date-input-wrapper .date-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted) !important;
  pointer-events: none !important; /* Стрелка пропускает клик на инпут */
  transition: transform 0.2s, color 0.2s;
  z-index: 2;
}

/* Поворот стрелки при фокусе */
.date-input-wrapper:focus-within .date-icon {
  color: var(--text) !important;
  transform: translateY(-50%) rotate(180deg) !important;
}

/* FLATPICKR */
.flatpickr-calendar {
  box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important; border: 1px solid var(--border) !important;
  border-radius: 16px !important; font-family: "Inter", sans-serif !important;
  padding: 16px !important; z-index: 9999 !important; width: 340px !important; box-sizing: border-box !important;
  margin-top: 8px !important;
}
.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
  display: none !important;
}

/* Скрываем стрелочку снизу (на случай, если календарь откроется вверх) */
.flatpickr-calendar.arrowBottom::before,
.flatpickr-calendar.arrowBottom::after {
  display: none !important;
}
.flatpickr-calendar:focus, .flatpickr-calendar:active { outline: none !important; box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month {
  color: var(--muted) !important; fill: var(--muted) !important; padding: 6px !important;
  border-radius: 6px !important; transition: all 0.2s; top: 8px !important;
}
.flatpickr-months .flatpickr-prev-month:hover, .flatpickr-months .flatpickr-next-month:hover { color: var(--text) !important; background: transparent !important; }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--text) !important; }
.flatpickr-month { height: 36px !important; }
.flatpickr-current-month {
  font-size: 15px !important; padding-top: 4px !important; display: flex !important;
  justify-content: center !important; align-items: center !important; gap: 4px;
}
.flatpickr-current-month .cur-month { font-weight: 600 !important; color: var(--text) !important; font-size: 15px !important; }
.flatpickr-current-month input.cur-year { font-weight: 600 !important; color: var(--text) !important; font-size: 15px !important; margin: 0 !important; }
.flatpickr-current-month .numInputWrapper { width: 55px !important; }
.flatpickr-innerContainer, .flatpickr-rContainer, .flatpickr-days, .dayContainer {
  width: 100% !important; min-width: 100% !important; max-width: 100% !important; box-sizing: border-box !important;
}
.flatpickr-weekdays { width: 100% !important; margin-top: 8px; margin-bottom: 8px; box-sizing: border-box !important; }
.flatpickr-weekdaycontainer { width: 100% !important; display: flex !important; box-sizing: border-box !important; }
.flatpickr-weekday {
  flex-basis: 14.2857% !important; max-width: 14.2857% !important; color: var(--muted) !important;
  font-size: 12px !important; font-weight: 500 !important; text-align: center !important; box-sizing: border-box !important;
}
.dayContainer { display: flex !important; flex-wrap: wrap !important; }
.flatpickr-day {
  flex-basis: 14.2857% !important; max-width: 14.2857% !important; margin: 0 !important;
  color: var(--text) !important; border-radius: 8px !important; font-size: 13px !important;
  transition: all 0.1s !important; height: 36px !important; line-height: 34px !important;
  display: flex !important; justify-content: center !important; align-items: center !important;
  box-sizing: border-box !important; border: 1px solid transparent !important;
}
.flatpickr-day:hover { background: #F4F4F4 !important; border-color: #F4F4F4 !important; }
.flatpickr-day.inRange, .flatpickr-day.prevMonthDay.inRange, .flatpickr-day.nextMonthDay.inRange, .flatpickr-day.today.inRange {
  background: #eff6ff !important; border-color: #eff6ff !important;
  box-shadow: -5px 0 0 #eff6ff, 5px 0 0 #eff6ff !important; color: var(--text) !important;
}
.flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected.startRange, .flatpickr-day.selected.endRange,
.flatpickr-day.startRange.startRange, .flatpickr-day.endRange.endRange {
  background: var(--type-civil) !important; border-color: var(--type-civil) !important; 
  color: var(--text) !important; box-shadow: none !important; font-weight: 600;
}
.flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover { background: var(--type-civil) !important; }
.flatpickr-day.startRange { border-radius: 8px 0 0 8px !important; }
.flatpickr-day.endRange { border-radius: 0 8px 8px 0 !important; }
.flatpickr-day.startRange.endRange { border-radius: 8px !important; }
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--muted-light) !important; }
.flatpickr-day.prevMonthDay:hover, .flatpickr-day.nextMonthDay:hover { color: var(--muted-light) !important; background: #F4F4F4 !important; }

.filter-footer { display: flex; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.btn-filter { flex: 1; padding: 10px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: background 0.2s; }
.btn-reset { background: #F4F4F4; color: var(--text); }
.btn-reset:hover { background: #E5E5E5; }
.btn-apply { background: var(--text); color: #fff; }
.btn-apply:hover { background: #000; }

/* 2. ЗОНА РЕЗУЛЬТАТОВ (Чипсы) */
.results-panel { display: flex; align-items: center; padding-bottom: 8px; margin-bottom: 8px; flex-shrink: 0; }
.categories-scroll { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; width: 100%; }
.categories-scroll::-webkit-scrollbar { display: none; }

.filter-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  background: #fff; border: 1px solid #d1d5db; border-radius: 20px;
  font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; transition: all 0.15s; cursor: pointer;
}
.filter-chip:hover { border-color: #a1a1aa; }
.filter-chip.active { background: #F4F4F4; border-color: #d1d5db;  }
.filter-chip.active .count {   }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chip-dot.all { background: conic-gradient(var(--type-criminal), var(--type-civil), var(--type-administrative), var(--type-administrative_offense), var(--type-materials), var(--type-criminal)); }
.chip-dot.criminal { background: var(--type-criminal); }
.chip-dot.civil { background: var(--type-civil); }
.chip-dot.administrative { background: var(--type-administrative); }
.chip-dot.administrative_offense { background: var(--type-administrative_offense); }
.chip-dot.materials { background: var(--type-materials); }
.filter-chip .count { display: inline-flex; align-items: center; justify-content: center; background: #E5E5E5; color: var(--muted); font-size: 11px; padding: 0 6px; height: 18px; border-radius: 10px; font-weight: 400; }

/* ТАБЛИЦА */
.table-header { display: grid; grid-template-columns: 1.25fr 1.75fr 2.2fr 2.2fr 40px; gap: 20px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 500; color: var(--muted); }
.sortable-header { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; transition: color 0.15s; }
.sortable-header:hover { color: var(--text); }
.sortable-header svg { width: 14px; height: 14px; color: var(--muted-light); transition: color 0.15s; }
.sortable-header:hover svg { color: var(--text); }
.list { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 1.25fr 1.75fr 2.2fr 2.2fr 40px; gap: 20px; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); transition: background 0.15s; position: relative; cursor: pointer; z-index: 1; }
.row:hover { background: #FAFAFA; z-index: 10; }
.row:last-child { border-bottom: none; }
.row::before { content: ""; position: absolute;    width: 3px;  }
.row.type-criminal::before { background: var(--type-criminal); }
.row.type-civil::before { background: var(--type-civil); }
.row.type-administrative::before { background: var(--type-administrative); }
.row.type-administrative_offense::before { background: var(--type-administrative_offense); }
.row.type-materials::before { background: var(--type-materials); }
.inline-row { display: inline-flex; align-items: center; gap: 8px; }
.cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cell.align-top { align-self: start; }
.case-num { font-weight: 600; font-size: 14px; color: var(--link-color); transition: color 0.15s; }
.row:hover .case-num { color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }
.court-name { font-size: 13px; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.date-val { font-weight: 400; color: var(--text); }
.text-truncate { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Кнопка в избранное */
.bookmark-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted-light); transition: all 0.2s; background: transparent; }
.bookmark-btn:hover { background: #F4F4F4; color: var(--muted); }
.bookmark-btn svg { width: 18px; height: 18px; transition: fill 0.2s, stroke 0.2s; }
.bookmark-btn.active { color: var(--text); }
.bookmark-btn.active svg { fill: var(--text); stroke: var(--text); }
.bookmark-btn.loading { pointer-events: none; opacity: 0.4; }
.bookmark-btn.loading svg { animation: pulse 0.8s infinite alternate; }

/* Тултип */
.tooltip-wrap { position: relative; display: inline-flex; align-items: center; gap: 4px; cursor: help; }
.tooltip-wrap .info { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: #d1d5db; color: #fff; font-size: 9px; font-weight: bold; }
.tooltip-wrap::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 0; margin-bottom: 8px; width: max-content; max-width: 200px; background: var(--text); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 11px; line-height: 1.4; text-align: left; white-space: normal; opacity: 0; pointer-events: none; transform: translateY(4px); transition: all 0.2s; z-index: 100; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.tooltip-wrap:hover::after { opacity: 1; transform: translateY(0); }

/* СКЕЛЕТОН */
.skeleton-list { display: none; flex-direction: column; }
.skeleton-list.show { display: flex; }
.skeleton-row { display: grid; grid-template-columns: 2.2fr 1.2fr 1.5fr 1.5fr 40px; gap: 20px; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.skeleton-row:last-child { border-bottom: none; }
.skeleton-cell { display: flex; flex-direction: column; gap: 6px; }
.skeleton-box { background: #E5E5E5; border-radius: 4px; position: relative; overflow: hidden; }
.skeleton-box::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; transform: translateX(-100%); background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%); animation: shimmer 1.5s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* СОСТОЯНИЯ */
.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  min-height: 500px;
  width: 100%;
}
.state-container.show { display: flex; }
.state-icon { width: 56px; height: 56px; color: var(--muted-light); margin-bottom: 20px; }
.state-container.is-error .state-icon { color: var(--color-error); }
.state-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.state-desc { font-size: 14px; color: var(--muted); margin-bottom: 24px; max-width: 320px; transition: color 0.2s; }
.state-btn { padding: 10px 20px; background: var(--text); color: #fff; border-radius: 8px; font-size: 14px; font-weight: 500; transition: background 0.2s; }
.state-btn:hover { background: #000; }
#initial-state .state-icon { color: var(--border); }
#initial-state .state-desc { max-width: 400px; transition: color 0.2s; }
#initial-state .state-desc.is-hint { color: var(--color-error); font-weight: 500; }

/* Пагинатор */
.pagination-footer { display: flex; align-items: center; justify-content: center; padding-top: 8px; }
.page-controls { display: flex; align-items: center; gap: 4px; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text); border: 1px solid transparent; transition: all 0.15s; }
.page-btn:hover:not(:disabled):not(.active) { background: #F4F4F4; }
.page-btn.active { background: #F4F4F4; border-color: #d1d5db; color: var(--text); }
.page-btn:disabled { color: var(--muted-light); cursor: not-allowed; opacity: 0.5; }
.page-btn svg { width: 16px; height: 16px; }
.page-dots { color: var(--muted); padding: 0 4px; font-size: 13px; }

/* ТОСТ */
.toast-container { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 10000; pointer-events: none; }
.toast { background: var(--text); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 8px; opacity: 0; transform: translateY(20px); transition: opacity 0.3s, transform 0.3s; pointer-events: auto; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast svg { width: 16px; height: 16px; color: #fff; }

/* Адаптив */
@media (max-width: 960px) {
  .app-container { padding: 24px; }
  .table-header { display: none; }
  .row, .skeleton-row { grid-template-columns: 1fr; gap: 12px; padding: 20px 16px; }
  .row::before { top: 20px; bottom: 20px; }
  .row .cell { flex-direction: row; align-items: baseline; gap: 8px; }
  .row .cell::before { content: attr(data-label); font-size: 12px; color: var(--muted); width: 80px; flex-shrink: 0; }
  .court-name { margin-top: 0; display: inline; }
  .court-name::before { content: "— "; }
  .bookmark-btn { position: absolute; right: 16px; top: 16px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
  .bookmark-btn:hover { background: #fff; }
  .skeleton-cell { width: 100%; }
  .skeleton-cell:nth-child(1) .skeleton-box:nth-child(1) { width: 40%; }
  .skeleton-cell:nth-child(1) .skeleton-box:nth-child(2) { width: 60%; }
  .skeleton-cell:nth-child(2) .skeleton-box { width: 30%; }
  .skeleton-cell:nth-child(3) .skeleton-box { width: 50%; }
  .skeleton-cell:nth-child(4) .skeleton-box { width: 70%; }
  .skeleton-cell:nth-child(5) { display: none; }
  .header-panel { flex-direction: column; align-items: flex-start; }
  .search-group { width: 100%; max-width: none; margin-top: 12px; }
  .pagination-footer { margin-top: 16px; }
  .filter-popover { position: fixed; top: auto; bottom: 20px; right: 20px; left: 20px; width: auto; transform: translateY(100%); max-height: 80vh; }
  .filter-popover.show { transform: translateY(0); }
  .filter-popover::before { display: none; }
}

@media (max-width: 480px) {
  .page-btn.optional { display: none; }
  .page-dots.optional { display: none; }
  .search-group { gap: 8px; }
}

.content.is-loading .skeleton-list { display: flex !important; flex-direction: column; }
.content.is-loading turbo-frame#cases_table { display: none !important; }

/* Убираем нативный крестик */
input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-results-button, input[type="search"]::-webkit-search-results-decoration { -webkit-appearance: none; appearance: none; display: none; }
input[type="search"]::-ms-clear, input[type="search"]::-ms-reveal { display: none; width: 0; height: 0; }
turbo-frame#chips_result { display: contents; }

.app-container.is-searching .filter-chip { pointer-events: none; opacity: 0.6; cursor: not-allowed; }
.app-container.is-searching .action-btn, .app-container.is-searching .btn-apply, .app-container.is-searching .btn-reset { pointer-events: none; opacity: 0.5; }

/* ==========================================================================
   КОМПОНЕНТ: ФИЛЬТР СУДОВ (COURTS SLIDER)
   ========================================================================== */

.courts-filter-wrapper { position: relative; display: flex; flex-direction: column; gap: 6px; }
.courts-filter-wrapper .custom-select-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; background: #F9F9F9; border: 1px solid var(--border); padding: 10px 14px; border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer; transition: all 0.2s; }

.custom-select-trigger:hover,
.custom-select-trigger.active { background: #fff; border-color: var(--text); }

.courts-filter-wrapper .select-value { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.courts-filter-wrapper .trigger-arrow { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; transition: transform 0.2s; }
.courts-filter-wrapper .custom-select-trigger.active .trigger-arrow { transform: rotate(180deg); }

/* Поповер */
.courts-filter-wrapper .popover { position: absolute; top: calc(100% + 6px); left: 0 !important; transform: none !important; width: calc(100% + 42px) !important; height: 360px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); z-index: 100; display: none; overflow: visible; }
.courts-filter-wrapper .popover.show { display: block; }
.courts-filter-wrapper .popover-inner { width: 100%; height: 100%; overflow: hidden; border-radius: 12px; position: relative; z-index: 2; }
.courts-filter-wrapper .popover-slider { display: flex; width: 200%; height: 100%; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.courts-filter-wrapper .popover-slider.show-selected { transform: translateX(-50%); }
.courts-filter-wrapper .screen { width: 50%; height: 100%; padding: 16px; display: flex; flex-direction: column; }

/* Поиск */
.courts-filter-wrapper .search-row {    flex-shrink: 0; }
.courts-filter-wrapper .search-wrapper { position: relative;  }
.courts-filter-wrapper .search-input {
  width: 100%;
   /* 👈 Сделали 32px слева вместо 12px */
  font-size: 13px;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s;
}
.courts-filter-wrapper .search-input:focus { background: #fff; border-color: var(--text); }
.courts-filter-wrapper .clear-search-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; display: none; align-items: center; justify-content: center; border-radius: 50%; color: var(--muted); background: #E5E5E5; transition: background 0.15s, color 0.15s; z-index: 2; cursor: pointer; border: none; padding: 0; }
.courts-filter-wrapper .clear-search-btn:hover { background: #d1d5db; color: var(--text); }
.courts-filter-wrapper .clear-search-btn svg { width: 10px; height: 10px; }
.courts-filter-wrapper .search-input:not(:placeholder-shown) ~ .clear-search-btn { display: flex; }

/* Кнопка "Посмотреть выбранные" */
.courts-filter-wrapper .view-selected-btn { position: relative;         background: transparent; color: var(--muted); border: none; border-radius: 8px; cursor: pointer;    }
.courts-filter-wrapper .view-selected-btn.is-visible {     }
.courts-filter-wrapper .btn-inner {         }
.courts-filter-wrapper .view-selected-btn:hover .btn-inner { background: var(--bg); color: var(--text); }
.courts-filter-wrapper .selected-count-badge { position: absolute; top: -6px; right: -6px; background: var(--link-color); color: #fff; border-radius: 10px; font-size: 10px; font-weight: bold; padding: 2px 5px; line-height: 1; border: 2px solid #fff; z-index: 10; opacity: 0; transform: scale(0); transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.courts-filter-wrapper .view-selected-btn.is-visible .selected-count-badge { opacity: 1; transform: scale(1); transition-delay: 0.1s; }

/* Состояния */
.courts-filter-wrapper .state-wrapper { display: none; flex-direction: column; align-items: center; justify-content: center; flex: 1; text-align: center; padding: 0 24px; padding-bottom: 0; }
.courts-filter-wrapper .state-wrapper.show { display: flex; }
.courts-filter-wrapper .state-wrapper svg { width: 48px; height: 48px; color: var(--border); margin-bottom: 20px; }
.courts-filter-wrapper .state-wrapper.is-error svg { color: var(--color-error); }
.courts-filter-wrapper .state-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.courts-filter-wrapper .state-desc { font-size: 13px; color: var(--muted); line-height: 1.5; max-width: 220px; }
.courts-filter-wrapper .state-btn { margin-top: 16px; padding: 8px 16px; background: var(--text); color: #fff; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.courts-filter-wrapper .state-btn:hover { background: #000; }

/* Скелетон */
.courts-filter-wrapper #state-skeleton { display: none; flex-direction: column; gap: 12px; flex: 1; padding-top: 4px; }
.courts-filter-wrapper #state-skeleton.show { display: flex; }
.courts-filter-wrapper .skeleton-row { display: flex; align-items: center; gap: 10px; padding: 4px 8px; width: 100%; }
.courts-filter-wrapper .skeleton-box { background: #E5E5E5; border-radius: 4px; position: relative; overflow: hidden; }
.courts-filter-wrapper .skeleton-box::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; transform: translateX(-100%); background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%); animation: courts-shimmer 1.5s infinite; }
@keyframes courts-shimmer { 100% { transform: translateX(100%); } }
.courts-filter-wrapper .skeleton-circle { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; }
.courts-filter-wrapper .skeleton-line { height: 16px; flex: 1; }

/* РЕЗУЛЬТАТЫ (Секции + Карточки) */
.courts-filter-wrapper .results-container { display: none; flex-direction: column; flex: 1; overflow-y: auto; }
.courts-filter-wrapper .results-container.show { display: flex; }
.courts-filter-wrapper .options-list { display: flex; flex-direction: column; gap: 20px; }
.courts-filter-wrapper .options-list::-webkit-scrollbar { width: 4px; }
.courts-filter-wrapper .options-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* Заголовок секции */
.courts-filter-wrapper .section-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; padding-left: 6px; }
.courts-filter-wrapper .section-content { display: flex; flex-direction: column; gap: 2px; }

/* КАРТОЧКА (Единая для Судов и Инстанций) */
.courts-filter-wrapper .list-item, 
.custom-select-dropdown .list-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  margin: 0;
  background: transparent;
}
.courts-filter-wrapper .list-item:hover, 
.custom-select-dropdown .list-item:hover { background: var(--bg); }
.courts-filter-wrapper .list-item.selected { background: #eff6ff; }

/* Чекбокс */
.courts-filter-wrapper .list-item .native-cb,
.custom-select-dropdown .list-item .native-cb {
  width: 18px;
  height: 18px;
  accent-color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  margin: 3px 0 0 0; /* Выравнивание по первой строке текста */
  display: block !important;
}

/* Текст */
.courts-filter-wrapper .item-text,
.custom-select-dropdown .item-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.courts-filter-wrapper .item-title,
.custom-select-dropdown .item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 20px; /* Жесткая высота помогает выравниванию */
  white-space: normal;
}

.courts-filter-wrapper .item-subtitle,
.custom-select-dropdown .item-subtitle {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* Экран выбранных */
.courts-filter-wrapper .selected-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.courts-filter-wrapper .back-btn { background: none; border: none; cursor: pointer; color: var(--muted); display: flex; align-items: center; padding: 4px; border-radius: 4px; }
.courts-filter-wrapper .back-btn:hover { background: var(--bg); color: var(--text); }
.courts-filter-wrapper .selected-title { font-size: 14px; font-weight: 600; }
.courts-filter-wrapper .selected-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.courts-filter-wrapper .selected-group-title { font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 8px 0; }
.courts-filter-wrapper .selected-group-title:first-child { margin-top: 0; }
.courts-filter-wrapper .selected-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.courts-filter-wrapper .selected-item:last-child { border-bottom: none; }
.courts-filter-wrapper .selected-item-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.courts-filter-wrapper .selected-item-title { font-weight: 500; color: var(--text); font-size: 13px; line-height: 1.4; }
.courts-filter-wrapper .selected-item-subtitle { font-size: 12px; color: var(--muted); line-height: 1.4; }
.courts-filter-wrapper .remove-item-btn { background: transparent; border: none; cursor: pointer; color: var(--muted-light); padding: 6px; border-radius: 6px; transition: all 0.15s; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.courts-filter-wrapper .remove-item-btn:hover { background: var(--bg); color: var(--text); }
.courts-filter-wrapper .btn-clear-all { width: 100%; padding: 10px; margin-top: 12px; background: var(--bg); color: var(--muted); border: 1px solid var(--border); border-radius: 8px; font-weight: 500; cursor: pointer; flex-shrink: 0; transition: all 0.15s; }
.courts-filter-wrapper .btn-clear-all:hover { background: var(--border); color: var(--text); }
.courts-filter-wrapper .empty-state { text-align: center; color: var(--muted); padding: 20px 0; font-size: 13px; }

.courts-filter-wrapper .popover::before { content: ""; position: absolute; top: -6px; right: auto !important; margin-right: 0 !important; left: calc(50% - 5px) !important; width: 10px; height: 10px; background: #fff; border-left: 1px solid var(--border); border-top: 1px solid var(--border); transform: rotate(45deg); z-index: 1; }

/* ================= SPLIT VIEW ================= */
.split-wrapper { display: flex; width: 100%; max-width: 1400px; margin: 0 auto; flex: 1; min-height: 0; padding: 0; box-sizing: border-box; gap: 0; transition: gap 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.split-wrapper.is-open { gap: 20px; }

.split-wrapper.is-open .search-panel { flex: 2; }
.search-panel .app-container { height: 100%; display: flex; flex-direction: column; overflow: hidden; padding: 32px 40px; }
.split-wrapper.is-open .search-panel .app-container { padding: 24px; }
.search-panel .app-container > form { flex-shrink: 0; }
.search-panel turbo-frame#search_results { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.search-panel .results-panel { flex-shrink: 0; }
.search-panel .content { display: flex !important; flex-direction: column !important; flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; padding-right: 4px; padding-bottom: 40px; }
.search-panel .content:has(.state-container.show) { padding-bottom: 0 !important; }
.search-panel .content turbo-frame#cases_table { display: flex !important; flex-direction: column !important; flex: 1 !important; }
.search-panel .content #list-wrapper { display: flex !important; flex-direction: column !important; flex: 1 !important; }
.search-panel .content .state-container.show { display: flex !important; flex-direction: column !important; justify-content: center !important; align-items: center !important; flex: 1 !important; height: 100% !important; }
.search-panel .content::-webkit-scrollbar { width: 6px; }
.search-panel .content::-webkit-scrollbar-track { background: transparent; }
.search-panel .content::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
.search-panel .content::-webkit-scrollbar-thumb:hover { background: #9fa6b2; }

.search-panel, 
.detail-panel {
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.search-panel {
  flex: 1;
  transition: flex 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.detail-panel {
  width: 0; 
  opacity: 0; 
  flex: 0;
  transition: flex 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.split-wrapper.is-open .detail-panel {   opacity: 1; }
.detail-content-wrapper { width: 100%; height: 100%; display: flex; flex-direction: column; overflow-x: hidden; }

@media (max-width: 1300px) {
  /* Перестраиваем сетку: Дело (2fr) + Истец (1fr) + Ответчик (1fr) + Иконка (40px) */
  .split-wrapper.is-open .table-header, 
  .split-wrapper.is-open .row { 
    grid-template-columns: 2fr 1fr 1fr 40px; 
  }
  
  /* Скрываем ТОЛЬКО ВТОРУЮ колонку (Дату) */
  .split-wrapper.is-open .row > div:nth-child(2), 
  .split-wrapper.is-open .table-header > div:nth-child(2) { 
    display: none; 
  }
}

.mobile-overlay { position: fixed; inset: 0; background: rgba(36,36,36,0.15); backdrop-filter: blur(4px); z-index: 999; opacity: 0; visibility: hidden; transition: all 0.3s; }
.mobile-overlay.open { opacity: 1; visibility: visible; }

@media (max-width: 1024px) {



  .logo-text {
    font-size: 16px;
  }
  
  .nav-tab {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .logout-btn {
    font-size: 12px;
    padding: 6px 8px;
  }
  
  body { height: auto; overflow: auto; padding: 0; }
  .split-wrapper { display: block; height: auto; padding: 0; flex: none; }
  .search-panel { flex: 1; min-width: 0; height: auto; overflow: visible; border-radius: 24px; transition: flex 0.35s cubic-bezier(0.16, 1, 0.3, 1); padding-right: 4px; padding-bottom: 4px; }
  .search-panel .app-container { height: auto; overflow: visible; padding: 32px 24px; }
  .search-panel .content { overflow: visible; }
  .detail-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 100% !important; max-width: 100%; z-index: 1000; transform: translateX(100%); opacity: 1 !important; transition: transform 0.3s ease; border-radius: 0; height: 100vh; }
  .split-wrapper.is-open .detail-panel { transform: translateX(0); }
  .detail-content-wrapper { min-width: 100%; }
}

@media (min-width: 1025px) { .mobile-overlay { display: none; } }

/* ================= ВНУТРЕННИЕ СТИЛИ КАРТОЧКИ ДЕЛА ================= */
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 32px 32px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--surface); }
.detail-title-area { display: flex; flex-direction: column; gap: 4px; }
.detail-title-area h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 32px; margin: 0; }
.detail-title-area .subtitle { font-size: 13px; color: var(--muted); }
.detail-actions { display: flex; gap: 4px; }
.detail-actions .action-btn { color: var(--muted); background: transparent; transition: all 0.2s; }
.detail-actions .action-btn:hover { background: #F4F4F4; color: var(--text); }

.properties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; background: #F9F9F9; padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); }
.prop-item { display: flex; flex-direction: column; gap: 4px; }
.prop-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.prop-value { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; }
.prop-value.mono { font-family: monospace; font-size: 12px; }
.timeline { display: flex; flex-direction: column; position: relative; padding-left: 32px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 10px; bottom: 20px; width: 2px; background: var(--border); }
.timeline-group { position: relative; margin-bottom: 28px; }
.timeline-group:last-child { margin-bottom: 0; }
.timeline-date { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; position: relative; }
.timeline-date::before { content: ""; position: absolute; left: -28px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--muted-light); box-sizing: border-box; z-index: 2; box-shadow: 0 0 0 1px var(--border); }
.timeline-group.is-important .timeline-date::before { border-color: var(--type-civil); background: var(--type-civil); }
.timeline-group.is-decision .timeline-date::before { border-color: #10b981; background: #10b981; }
.timeline-events { display: flex; flex-direction: column; gap: 12px; }
.timeline-event { position: relative; padding: 10px 16px; margin-left: -16px; border-radius: 8px; transition: background 0.2s; }
.timeline-event:hover { background: #FAFAFA; }
.timeline-time { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 2px; display: block; }
.timeline-title { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.4; }
.row.is-active { background-color: #F4F4F4; }
.row.is-active::before { width: 4px; top: 8px; bottom: 8px; }
.row.is-active .case-num { color: var(--link-hover); }

/* ==========================================================================
   ЕДИНАЯ СИСТЕМА ЦВЕТОВ (БЕЗ РАМОК У СТРОК)
   ========================================================================== */

/* 1. ФОН ПРИ НАВЕДЕНИИ (Самый светлый серый) */
.list-item:hover,
.filter-chip:hover,
.row:hover {
  background-color: #FAFAFA !important; 
}

/* 2. ФОН ПРИ ВЫБОРЕ / АКТИВНОСТИ (Как у активного чипса) */
/* Для выбранных судов/регионов */
.list-item.selected,
/* Для инстанций (через :has) */
.list-item:has(.native-cb:checked),
/* Для активного чипса категории */
.filter-chip.active,
/* Для активной строки в таблице */
.row.is-active {
  background-color: var(--bg) !important; /* Это #F4F4F4 */
}

/* 3. ЖЕСТКО УБИРАЕМ РАМКИ И ТЕНИ У ВЫБРАННЫХ СТРОК */
.list-item.selected,
.list-item:has(.native-cb:checked),
.row.is-active {
  box-shadow: none !important;
  border: none !important;
}

/* 4. ЧИПСЫ: оставляем рамку ТОЛЬКО им */
.filter-chip.active {
  border: 1px solid #d1d5db !important;
  color: var(--text) !important;
}
.filter-chip.active .count {
  background: #E5E5E5 !important;
  color: var(--text) !important;
}

/* 5. Цвет текста при выборе (чтобы не было синевы) */
.list-item.selected .item-title,
.list-item:has(.native-cb:checked) .item-title,
.row.is-active .case-num {
  color: var(--text) !important; 
}

/* ==========================================================================
   ФИНАЛЬНАЯ НАСТРОЙКА ОТСТУПОВ В СПИСКАХ
   ========================================================================== */

/* 1. Увеличиваем gap до 8px (и для Судов, и для Инстанций) */
#dropdown-instance .options-list,
.courts-filter-wrapper .section-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important; 
}

/* 2. Уменьшаем внутренние паддинги у самих строк (было 10px 12px) */
.list-item {
  padding: 8px 10px !important; /* 👈 Чуть уменьшили */
  border-radius: 8px !important;
}

/* 3. Корректируем чекбокс, так как паддинг стал меньше */
.list-item .native-cb,
.list-item input[type="checkbox"] {
  margin-top: 2px !important; /* Сдвигаем чуть выше, чтобы остаться по центру заголовка */
}

/* ==========================================================================
   ВЫРАВНИВАНИЕ РАДИУСОВ В ТАБЛИЦЕ (КАК В СПИСКАХ)
   ========================================================================== */

/* 1. Добавляем скругление самой строке */
.row {
  border-radius: 8px !important;
}

/* 2. При наведении и выборе убираем нижнюю границу, чтобы она не перечеркивала скругленный фон */
.row:hover,
.row.is-active {
  border-bottom-color: transparent !important;
}

/* 3. Опционально: делаем левую цветную полоску чуть более аккуратной с учетом скругления */
.row::before {
  border-radius: 4px !important; /* Делаем полоску скругленной со всех сторон */
  left: 4px !important;          /* Чуть отступаем от края, чтобы она вписалась в дугу */
  top: 12px !important;          /* Подгоняем высоту под скругление */
  bottom: 12px !important;
}

/* Инпут занимает всё свободное место */
.courts-filter-wrapper .search-wrapper {
  flex: 1 !important;
  min-width: 0 !important;
  margin-bottom: 0 !important; /* Убираем старый отступ */
}

/* Выравниваем кнопку "Посмотреть выбранные" */
.courts-filter-wrapper .view-selected-btn {
  height: 36px !important;
}

/* 1. Кнопка всегда остается серой, иконка черной */
.action-btn.filter-btn.has-active-filters {
  background-color: #F4F4F4 !important; /* Серый фон, как в покое */
  color: var(--text) !important;        /* Черная иконка */
}

/* 2. Полностью убиваем старую синюю точку (артефакт) */
.action-btn.filter-btn.has-active-filters::after {
  display: none !important;
  content: none !important;
}

/* 3. Стили для бабла (и в фильтрах, и в судах) */
.action-btn.filter-btn .selected-count-badge,
.courts-filter-wrapper .selected-count-badge {
  background: var(--link-color) !important;
  color: #fff !important;
  /* 👇 Обводка теперь строго в цвет фона контента */
  border: 2px solid var(--surface) !important; 
  border-radius: 50% !important;
  
  /* Размеры */
  width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
  font-size: 9px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  
  /* Позиция */
  position: absolute !important;
  top: -6px !important;
  right: -6px !important;
  
  /* Убираем тень, чтобы не было грязных артефактов */
  box-shadow: none !important;
  z-index: 20 !important;
  box-sizing: border-box !important;
  
  /* 👇 Скрываем по умолчанию */
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 4. Класс для показа бабла */
.action-btn.filter-btn .selected-count-badge.is-visible,
.courts-filter-wrapper .selected-count-badge.is-visible {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* ==========================================================================
   ФИКС АНИМАЦИИ И ВИДИМОСТИ БАБЛА
   ========================================================================== */

/* 1. Кнопка разрешает выходить контенту за свои пределы (для бабла) */
.courts-filter-wrapper .view-selected-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  
  width: 0 !important;
  opacity: 0 !important;
  margin-left: 0 !important;
  padding: 0 !important;
  
  overflow: visible !important; /* 👈 Разрешаем баблу выходить за края */
  pointer-events: none !important;
  flex-shrink: 0 !important;
  
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.2s ease, 
              margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* 2. Кнопка в видимом состоянии */
.courts-filter-wrapper .view-selected-btn.is-visible {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* 3. Внутренний контейнер (иконка). Прячем переполнение именно здесь! */
.courts-filter-wrapper .btn-inner {
   /* Изначально ширина 0 */
  overflow: hidden !important; /* 👈 Скрываем иконку при схлопывании */
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  
  background-color: var(--bg) !important;
  
  padding: 0 !important;
}

/* 4. Когда кнопка видима, растягиваем и внутренний контейнер */
.courts-filter-wrapper .view-selected-btn.is-visible .btn-inner {
  width: 36px !important;
}

/* 5. Запрещаем иконке сплющиваться во время анимации ширины */
.courts-filter-wrapper .btn-inner svg {
  min-width: 20px !important;
  flex-shrink: 0 !important;
}

/* ==========================================================================
   АБСОЛЮТНАЯ УНИФИКАЦИЯ ПОИСКА И КНОПОК
   ========================================================================== */

/* 1. Верхний поиск: делаем зазор 12px */
.search-group {
  gap: 12px !important;
}

/* 2. Нижний поиск (в судах): убираем gap, будем двигать кнопку через margin */
.courts-filter-wrapper .search-row {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  gap: 0 !important; 
  margin-bottom: 12px !important;
}

/* 3. Выравниваем высоту инпута в судах (чтобы совпадал с верхним) */
.courts-filter-wrapper .search-input {
  height: 38px !important;
  padding: 0 32px !important; /* Текст по центру */
  box-sizing: border-box !important;
}

/* 4. Кнопка списка в судах: делаем такой же, как верхние (38x38) */
.courts-filter-wrapper .view-selected-btn.is-visible {
  width: 38px !important;
  height: 38px !important;
  margin-left: 12px !important; /* 👈 Тот самый одинаковый зазор */
}

/* 5. Внутренний контейнер кнопки тоже 38x38 */
.courts-filter-wrapper .btn-inner {
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important; /* Скругление как у верхних кнопок */
}

/* 6. Центрируем иконку списка внутри */
.courts-filter-wrapper .btn-inner svg {
  width: 20px !important;
  height: 20px !important;
}
/* ==========================================================================
   КОМПАКТНАЯ КНОПКА "ЕЩЁ" В УГЛУ
   ========================================================================== */

/* Даем отступ справа, чтобы текст не перекрывался с кнопкой */

.hidden-participants .text-truncate,
.hidden-participants .inline-row {
  margin: 0 !important;
}
/* ==========================================================================
   ФИКС УЧАСТНИКОВ (ОТСТУПЫ И РАСКРЫТИЕ)
   ========================================================================== */

/* По умолчанию скрыто */
.hidden-participants {
  display: none;
  margin: 0 !important;
  padding: 0 !important;
}

/* Когда открыто — превращаем во flex-колонку с gap как у родителя */
.hidden-participants.is-expanded {
  display: flex;
  flex-direction: column;
  gap: 4px; /* 👈 Такой же отступ, как у .cell */
  margin-top: 0 !important; /* 👈 Убираем любой возможный отступ сверху */
}

.hidden-participants .text-truncate,
.hidden-participants .inline-row {
  margin-top: 0 !important; 
  margin-bottom: 0 !important;
}

/* Чтобы имена не слипались при раскрытии */
.hidden-participants .text-truncate {
  display: block;
}

/* Красим кнопку при наведении, чтобы было понятно, что это кликабельно */
.participants-more-btn:hover {
  background-color: #E5E5E5 !important;
  color: var(--text) !important;
}

/* ==========================================================================
   АНИМАЦИЯ РАСКРЫТИЯ УЧАСТНИКОВ
   ========================================================================== */

.participants-collapse-wrapper {
  display: grid;
  grid-template-rows: 0fr; /* По умолчанию скрыто (высота 0) */
  margin: 0 !important;
  padding: 0 !important;
  
  /* 👇 Вот та самая магия: быстро в начале, медленно в конце */
  transition: grid-template-rows 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* При активации раскрываем на полную высоту */
.participants-collapse-wrapper.is-expanded {
  grid-template-rows: 1fr;
}

/* Внутренний контейнер обрезает контент при анимации */
.participants-collapse-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px; /* Ваши отступы между именами */
}

/* Кнопка "Ещё" в углу (стили из прошлого шага) */
.cell:has(.participants-more-btn) { padding-right: 32px !important; }

.participants-more-btn {
  position: absolute; top: 0; right: 0;
  display: inline-flex; align-items: center; gap: 2px;
  background-color: #f4f4f4; color: var(--muted);
  border: none; border-radius: 6px; padding: 2px 6px;
  font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.2s; z-index: 2;
}
.participants-more-btn:hover { background-color: #e5e5e5; color: var(--text); }
.participants-more-btn .chevron { width: 12px; height: 12px; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.participants-more-btn.is-expanded .chevron { transform: rotate(180deg); }

/* ==========================================================================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ КАРТОЧКИ ДЕЛА (ИНТЕГРАЦИЯ)
   ========================================================================== */

/* Общие секции */
.section {
  display: flex;
  flex-direction: column;
  margin-bottom: 32px;
}

/* Блок судебного акта */
.act-block {
  background: #F9F9F9;
  border: 1px solid var(--border);
}

.act-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.act-item:last-child { border-bottom: none; padding-bottom: 0; }
.act-item:first-child { padding-top: 0; }
.download-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; 
  border: 1px solid var(--border); background: #fff; color: var(--text);
  flex-shrink: 0; transition: all 0.2s;
}
.download-btn:hover { border-color: var(--text); }
.download-btn svg { width: 16px; height: 16px; }
.act-info { display: flex; flex-direction: column; gap: 2px; }
.act-date { font-size: 14px; font-weight: 600; }
.act-name { font-size: 14px; color: var(--muted); }

/* Кастомный таймлайн (150px ось) */
.timeline-custom { display: flex; flex-direction: column; }
.tl-date { font-size: 13px; color: var(--muted); white-space: nowrap; }

.writ-item:last-child {  }
.writ-item:first-child {  }
.writ-title {    text-transform: uppercase; letter-spacing: 0.04em; }
.writ-status { font-size: 14px; color: var(--muted); }

/* ==========================================================================
   ФИНАЛЬНАЯ ИНТЕГРАЦИЯ КАРТОЧКИ ДЕЛА (ПО ЭТАЛОННОМУ HTML)
   ========================================================================== */

/* Общий контейнер карточки */
.case-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden; /* Запрещаем скролл всей панели */
  background: var(--surface);
  border-radius: 24px;
}

.case-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 32px;
  margin: 0;
  display: flex;
  align-items: center;
  height: 42px;
  flex-wrap: wrap;
  align-items: baseline;
  position: relative;
}

.case-title-alt {
  font-size: 15px;
  font-weight: 400;
}

.case-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tl-date, .tl-time {
  font-size: 14px;
  white-space: nowrap;
}

/* ==========================================================================
   ФИНАЛЬНАЯ ИНТЕГРАЦИЯ КАРТОЧКИ ДЕЛА (АДАПТИВНАЯ)
   ========================================================================== */

/* Увеличиваем минимальную ширину правой панели при открытии, если места хватает */
.split-wrapper.is-open .detail-panel { 
  flex: 1.2; 
  min-width: 320px; 
  opacity: 1; 
}

/* Шапка */
.uid-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  word-break: break-all;
}

/* Свойства (сделали 140px вместо 180px) */
.info-sub {
  font-size: 13px;
  font-weight: 400;
}

.party-name {
  line-height: 1.4;
}

.tl-result {
  display: block;
  font-size: 13px;
  margin-top: 8px;
  font-weight: 400;
}

.tl-result strong { font-weight: 500; }

/* Исполнительные листы */
.writ-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.writ-item:last-child { border-bottom: none; }
.writ-item:first-child { padding-top: 0; }

.writ-date {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.writ-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.writ-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.writ-sub {
  font-size: 13px;
  color: var(--muted);
}

.writ-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
}

/* Футер */
.case-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   ДОБАВЛЯЕМ ВОЗДУХА (ПАДДИНГИ И ОТСТУПЫ)
   ========================================================================== */

/* Делаем блок судебного акта просторнее */
.act-block {
  padding: 24px !important;      /* Было 20px */
  border-radius: 16px !important; /* Чуть больше скругление */
}


/* Увеличиваем паддинги в свойствах и сторонах */

/* Красиво выравниваем кнопку скачивания */
.download-btn {
  border-radius: 8px !important; /* Квадратная с мягкими углами, как в эталоне */
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.sticky-header {
  flex-shrink: 0;
  padding: 24px 24px 0;
  z-index: 10;
}

.detail-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

turbo-frame#case_details {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.detail-scroll-area > .content { overflow-y: auto; flex: 1; padding-right: 16px; }
.detail-scroll-area > .content::-webkit-scrollbar { width: 6px; }
.detail-scroll-area > .content::-webkit-scrollbar-track { background: transparent; }
.detail-scroll-area > .content::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.case-header > .categories-scroll {
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 8px;
  padding-top: 12px;
}
.case-details-header { font-weight: 600; margin: 0; padding: 0; }

/* ==========================================================================
   ЕДИНАЯ СЕТКА ДЛЯ СТРОК КАРТОЧКИ (Стороны, Движение, Свойства)
   ========================================================================== */

.info-row, 
.party-item, 
.tl-item {
  display: grid;
  grid-template-columns: 120px 1fr; /* Единая ширина левой колонки */
  gap: 8px; /* Единый отступ между колонками */
  align-items: baseline;
  padding: 12px 0; /* Единые отступы сверху и снизу */
  border-bottom: 1px solid var(--border);
}

/* Убираем лишние отступы и линии у крайних элементов */
.info-row:first-child, 
.party-item:first-child, 
.tl-item:first-child {
  padding-top: 0;
}

.info-row:last-child, 
.party-item:last-child, 
.tl-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Дополнительные стили для текста внутри */
.info-value-wrapper, 
.party-names {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.party-name,
.tl-text,
.tl-datetime {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.flex-row {
  flex-direction: row;
  gap: 8px;
}

.timelocation {
  display: flex;
  gap: 4px;
}

.hearing-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.hearing-status-dot.is-warning {
  background-color: #f59e0b;
}

/* Красный (Сегодня/Завтра) */
.hearing-status-dot.is-danger {
  background-color: var(--color-error); 
}

.hearing-status-dot.is-info {
  background-color: var(--link-color);
}

/* ==========================================================================
   ШАПКА (ЛОГОТИП + НАВИГАЦИЯ + ВЫХОД)
   ========================================================================== */

.top-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* 3 колонки: левая, авто(центр), правая */
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto; /* Отступ снизу до контента */
  padding: 0 8px;
}

/* Логотип */
.logo-text {
  justify-self: start; /* Прижимаем влево */
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  cursor: default;
}

/* Кнопка выхода */
.logout-btn {
  justify-self: end; /* Прижимаем вправо */
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.logout-btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}

/* ================= АВТОРИЗАЦИЯ ================= */
.auth-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); padding: 24px; max-width: 420px; width: 90%;}
.auth-card { background: var(--surface); width: 100%; max-width: 400px; padding: 40px; border-radius: 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.05); border: 1px solid var(--border); }
.auth-card .logo-text { text-align: center; margin-bottom: 32px; display: block; width: 100%; font-size: 24px; font-weight: 700; }
.auth-header { margin-bottom: 32px; }
.auth-title { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.form-group { margin-bottom: 16px; }
.form-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.input-field { width: 100%; height: 42px; padding: 0 14px; background: var(--bg); border: 1px solid transparent; border-radius: 10px; font-size: 14px; outline: none; transition: all 0.2s; }
.input-field:focus { background: #fff; border-color: var(--text); }
.input-field.invite-field { border-color: rgba(37, 99, 235, 0.3); background: #fff; }
.btn-submit { width: 100%; height: 42px; background: var(--text); color: #fff; border-radius: 10px; font-size: 14px; font-weight: 500; margin-top: 8px; cursor: pointer; }
.btn-submit:hover { background: #000; }
.auth-switch { text-align: center; margin-top: 24px; font-size: 13px; color: var(--muted); }
.auth-switch button { background: none; border: none; color: var(--text); font-weight: 500; font-size: 13px; margin-left: 4px; cursor: pointer; text-decoration: underline; }
.hidden { display: none !important; }
.alert-error { background: #fee2e2; color: #ef4444; padding: 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ================= ШАПКА ================= */
/*.top-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; width: 100%; max-width: 1400px; margin: 0 auto 24px; padding: 0 8px; }*/
.logo-text { justify-self: start; font-size: 20px; font-weight: 600; letter-spacing: -0.03em; color: var(--text); }
.top-nav { justify-self: center; display: flex; gap: 8px; }
.nav-tab { padding: 8px 24px; border-radius: 24px; font-size: 14px; font-weight: 500; color: #fff; background: var(--text); transition: all 0.2s; text-decoration: none; }
.nav-tab:not(.active) { color: var(--muted); background: transparent; }
.logout-btn { justify-self: end; font-size: 14px; font-weight: 500; color: var(--muted); padding: 8px 16px; border-radius: 20px; text-decoration: none; }
.logout-btn:hover { background: rgba(0,0,0,0.05); color: var(--text); }

/* ================= ИНВАЙТЫ ================= */
.invites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 24px; }
.invite-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.invite-code { font-family: monospace; font-size: 24px; font-weight: 600; letter-spacing: 2px; }
.invite-status { font-size: 13px; font-weight: 500; padding: 4px 12px; border-radius: 20px; text-align: center; }
.invite-status.is-available { background: #eff6ff; color: var(--link-color); }
.invite-status.is-used { background: var(--bg); color: var(--muted); }
.copy-btn { font-size: 12px; font-weight: 500; color: var(--text); border: 1px solid var(--border); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.copy-btn:hover { background: var(--bg); }

/* По умолчанию скелетон скрыт */
.skeleton-list {
  display: none;
}

/* Когда фрейм с результатами начинает грузиться (aria-busy="true"): */
/* 1. Прячем старую таблицу с результатами */
turbo-frame#search_results[aria-busy="true"] turbo-frame#cases_table {
  display: none !important;
}

/* 2. Показываем скелетон */
turbo-frame#search_results[aria-busy="true"] .skeleton-list {
  display: flex !important;
  flex-direction: column;
}

.btn-submit {
  position: relative;
  transition: opacity .15s ease;
}

.btn-submit:disabled {
  cursor: not-allowed;
  opacity: .75;
}

.btn-submit.is-loading {
  color: transparent;      /* прячем текст «Войти» / «Создать аккаунт» */
  pointer-events: none;
}

.btn-submit.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin .7s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

turbo-frame#case_details.is-closed {
  display: none;
}

.detail-close-btn {
  position: absolute;
  top: 0;
  right: 0;
}

/* --- Базовые стили для всех блоков скелетона дела --- */
.case-skeleton .sk-case-number,
.case-skeleton .sk-meta,
.case-skeleton .next-hearing .sk-hearing-text,
.case-skeleton .sk-section-title,
.case-skeleton .party-item .sk-party-role,
.case-skeleton .party-name .sk-party-name,
.case-skeleton .tl-item .sk-tl-date,
.case-skeleton .tl-item .sk-tl-text,
.case-skeleton .tl-item .sk-tl-sub,
.case-skeleton .writ-item .sk-writ-date,
.case-skeleton .writ-item .sk-writ-title,
.case-skeleton .writ-item .sk-writ-sub,
.case-skeleton .writ-item .sk-writ-badge {
  display: block;               /* 👈 Критично! Иначе width/height не работают */
  background-color: #e5e7eb;    /* 👈 Серый цвет (или возьми свой из поиска) */
  border-radius: 4px;
}

/* Шапка */
.case-skeleton .sk-case-number {
  width: 160px;
  height: 22px;
  border-radius: 6px;
}

.case-skeleton .sk-meta {
  width: 72px;
  height: 12px;
}
.case-skeleton .sk-meta:last-child {
  width: 88px;
}

/* Баннер «следующее заседание» */
.case-skeleton .next-hearing .sk-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
  background-color: #e5e7eb;
}
.case-skeleton .next-hearing .sk-hearing-text {
  width: 220px;
  height: 14px;
}

/* Заголовки секций */
.case-skeleton .sk-section-title {
  width: 140px;
  height: 18px;
  border-radius: 6px;
}

/* Стороны */
.case-skeleton .party-item .sk-party-role {
  width: 80px;
  height: 12px;
}
.case-skeleton .party-name .sk-party-name {
  width: 55%;
  height: 14px;
}

/* Движение дела */
.case-skeleton .tl-item .sk-tl-date {
  width: 64px;
  height: 12px;
}
.case-skeleton .tl-item .sk-tl-text {
  width: 78%;
  height: 14px;
}
.case-skeleton .tl-item .sk-tl-sub {
  width: 42%;
  height: 12px;
  margin-top: 4px;
}

/* Исполнительные листы */
.case-skeleton .writ-item .sk-writ-date {
  width: 72px;
  height: 12px;
}
.case-skeleton .writ-item .sk-writ-title {
  width: 60%;
  height: 14px;
}
.case-skeleton .writ-item .sk-writ-sub {
  width: 40%;
  height: 12px;
}
.case-skeleton .writ-item .sk-writ-badge {
  width: 64px;
  height: 18px;
  border-radius: 999px;
}

.case-skeleton .skeleton,
.case-skeleton [class*="sk-"] {
  display: block;
  background-color: #E5E5E5; /* Ваш базовый цвет */
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

/* Эффект шиммера (полностью повторяет ваш рабочий вариант) */
.case-skeleton .skeleton::after,
.case-skeleton [class*="sk-"]::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.4) 50%, 
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% { 
    transform: translateX(100%); 
  }
}

/* Стили для нативного <dialog> */
dialog.confirm-dialog {
  padding: 0;
  border: none;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  max-width: 360px;
  width: calc(100% - 32px);
  margin: auto; /* Центрирование */
  background: var(--surface, #fff);
  color: var(--text, #242424);
}

/* Затемнение и блюр фона */
dialog.confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
}

.confirm-content {
  display: flex;
  flex-direction: column;
}

.confirm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.confirm-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.confirm-header .close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted, #7b8494);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  margin: -8px -8px 0 0;
}

.confirm-header .close-btn:hover {
  background: var(--bg, #f4f4f4);
}

.confirm-header .close-btn svg {
  width: 18px;
  height: 18px;
}

.confirm-body {
  padding: 12px 24px 24px;
  color: var(--muted, #7b8494);
  font-size: 15px;
  line-height: 1.5;
}

.confirm-body p {
  margin: 0;
}

.confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 24px 24px;
}

.confirm-footer .btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  font-family: inherit;
}

.confirm-footer .btn-secondary {
  background: var(--bg, #f4f4f4);
  color: var(--text, #242424);
}

.confirm-footer .btn-secondary:hover {
  background: #e5e5e5;
}

.confirm-footer .btn-danger {
  background: #fee2e2;
  color: #dc2626;
}

.confirm-footer .btn-danger:hover {
  background: #fecaca;
}

/* ==========================================================================
   СЕКЦИЯ «ЖАЛОБЫ» (ИНТЕГРАЦИЯ В ОБЩИЙ ДИЗАЙН)
   ========================================================================== */

/* Разделитель между несколькими жалобами */
.complaint-block {
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
}
.complaint-block:first-child {
  padding-top: 0;
}
.complaint-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Убираем лишние нижние границы у вложенных tl-item, чтобы не было двойных линий */
.complaint-block .tl-item {
  border-bottom: none !important;
  padding: 6px 0 !important;
}

/* Компактный бейдж статуса в стиле .writ-badge */
.complaint-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px; /* Квадратные с мягкими углами, как в остальном UI */
  white-space: nowrap;
  line-height: 1.4;
}
.complaint-badge.is-danger  { background: #fee2e2; color: #dc2626; }
.complaint-badge.is-success { background: #d1fae5; color: #059669; }
.complaint-badge.is-info    { background: #eff6ff; color: var(--link-color); }

/* Заявитель */
.complaint-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: block;
}

/* Результат рассмотрения */
.complaint-result-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  display: block;
}

/* Мета-данные (даты) */
.complaint-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  align-items: center;
}