/* ============================================================
   Тема панели CRM — crm.skaline.ru
   Файл: public/css/panel-theme.css — общий для всех трёх экземпляров

   Подключается render-хуком через App\Providers\FilamentThemeProvider,
   сборка npm не требуется: правьте файл и обновляйте страницу
   через Ctrl+Shift+R.

   Filament пятой версии подставляет эти переменные прямо в свойства
   цвета: объявляет --color-gray-N: var(--gray-N) и пишет
   color: var(--color-gray-N). Значение обязано быть цветом —
   шестнадцатеричным, а не тройкой «красный зелёный синий»: тройка
   была записью третьей версии, здесь она делает объявление
   недействительным, и вся шкала молча ничего не красит.
   Переопределение шкалы в :root перекрашивает интерфейс целиком,
   поэтому менять оттенки надо там, а не в отдельных правилах.

   Классы с префиксом fi- принадлежат Filament. Их состав может
   измениться при обновлении фреймворка — тогда часть правил
   перестанет применяться, но интерфейс останется рабочим.

   Версия темы: нейтральный светлый SaaS, акцент графит #3A3F46.
   Типографика: Golos Text для текста, IBM Plex Mono для цифр,
   шапок таблиц, статусов и бейджей. font-family задан с !important —
   без него Filament перебивает шрифт своими классами.
   ============================================================ */

/* Шрифты лежат в public/fonts: панель не ходит в чужой CDN
   при каждой загрузке страницы. README это допускает прямо.
   Наборы — латиница и кириллица; расширенные не скачивались. */
@font-face {
    font-family: 'Golos Text';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/golos-text-400-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Golos Text';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/golos-text-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Golos Text';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/golos-text-500-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Golos Text';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/golos-text-500-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Golos Text';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/golos-text-600-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Golos Text';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/golos-text-600-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Golos Text';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/golos-text-700-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Golos Text';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/golos-text-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-500-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-600-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-600-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Файл взят из передачи дизайна как есть. Две правки при установке:
   значения шкал переведены из троек в шестнадцатеричные (оттенки
   те же), шрифты подключены локально вместо Google Fonts. */

/* ── Нейтральная светлая палитра ────────────────────────────────────── */

:root {
  color-scheme: light;
  --gray-50: #DCE1E6;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9A9DA2;
  --gray-500: #6E7176;
  --gray-600: #52565C;
  --gray-700: #3A3F46;
  --gray-800: #24282D;
  --gray-900: #17181A;
  --gray-950: #0D0E0F;

  /* Акцент — графит: кнопки, активные пункты меню, чекбоксы */
  --primary-50: #F4F4F5;
  --primary-100: #E8E9EA;
  --primary-200: #D5D7DA;
  --primary-300: #B0B4BA;
  --primary-400: #767C85;
  --primary-500: #3A3F46;
  --primary-600: #2F343A;
  --primary-700: #24282D;
  --primary-800: #1C1F23;
  --primary-900: #17181A;
  --primary-950: #0D0E0F;

  /* Сигнальные цвета: прибыль, предупреждение, удаление */
  --success-50: #EAF4EF;
  --success-500: #16794C;
  --success-600: #12643F;
  --warning-50: #F6F0E8;
  --warning-500: #8A5A2B;
  --warning-600: #744B23;
  --danger-50: #ffffff;
  --danger-500: #B04A3A;
  --danger-600: #943C2E;
}

/* Страховка: если класс dark всё же появится, текст остаётся тёмным */
.dark, .dark * { color-scheme: light; }
.dark .fi-body, .dark .fi-main-ctn { background-color: #dce1e6; color: #17181a; }

/* ── Типографика ────────────────────────────────────────────────────── */
/* !important обязателен: Filament задаёт font-family своими классами
   с более высокой специфичностью, без него Golos Text не применяется. */

html { font-size: 16px; }

html, body, .fi-body, .fi-body * {
  font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Helvetica Neue", Arial, sans-serif !important;
}

.fi-body {
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-color: #dce1e6;
  color: #17181a;
}

.fi-main-ctn, .fi-simple-layout { background-color: #dce1e6; color: #17181a; }

/* Заголовок страницы — главный акцент шкалы */
.fi-header-heading {
  font-size: 2.125rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: #17181a;
}
.fi-header-subheading { font-size: 0.875rem; color: #6e7176; }

.fi-section-header-heading {
  font-size: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em;
  color: #17181a;
}

/* Хлебные крошки — мелко и моноширинно, чтобы не спорили с заголовком */
.fi-breadcrumbs, .fi-breadcrumbs * {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-size: 0.6875rem !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9a9da2;
}

/* ── Панели ─────────────────────────────────────────────────────────── */

.fi-sidebar, .fi-topbar > nav {
  background-color: #ede6e6;
  border-color: #ddd1d2;
}

.fi-section, .fi-ta-ctn, .fi-modal-window,
.fi-wi-stats-overview-stat, .fi-dropdown-panel {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgb(60 40 42 / 0.05);
  color: #17181a;
}

/* ── Таблицы ────────────────────────────────────────────────────────── */

.fi-ta-table { font-size: 0.875rem; }

/* Шапка: мелкие капсы моноширинным — читается как техническая подпись */
.fi-ta-header-cell,
.fi-ta-header-cell * {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-weight: 500 !important;
  font-size: 0.625rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9da2 !important;
}
.fi-ta-header-cell { background-color: #f3f4f6; padding-top: 0.6rem; padding-bottom: 0.6rem; }

.fi-ta-row { border-color: #e5e7eb; }
.fi-ta-row:hover { background-color: #f3f4f6; }
.fi-ta-text, .fi-ta-record-content, .fi-ta-table td { color: #17181a; }

/* Первая колонка — имя записи, единственный полужирный текст в строке */
.fi-ta-cell:first-of-type .fi-ta-text,
.fi-ta-cell:nth-child(2) .fi-ta-text {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Цифры одной ширины — суммы и даты перестают «плясать» */
.fi-ta-table td, .fi-ta-table th,
.fi-wi-stats-overview-stat-value { font-variant-numeric: tabular-nums; }

/* Суммы, кратности и даты — моноширинным, столбик выравнивается */
.fi-ta-cell[class*="numeric"] .fi-ta-text,
.fi-ta-cell[class*="money"] .fi-ta-text,
.fi-ta-cell[class*="date"] .fi-ta-text,
.fi-ta-cell[class*="price"] .fi-ta-text,
.fi-ta-cell[class*="cost"] .fi-ta-text,
.fi-wi-stats-overview-stat-value {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: -0.02em;
}

/* KPI-плитки: крупная цифра — второй акцент после заголовка страницы */
.fi-wi-stats-overview-stat-value { font-size: 2rem !important; line-height: 1; color: #17181a; }
.fi-wi-stats-overview-stat-label { font-size: 0.8125rem; color: #9a9da2; }
.fi-wi-stats-overview-stat-description { font-size: 0.75rem; color: #9a9da2; }

/* Действия в строке — тихие, не конкурируют с данными */
.fi-ta-actions .fi-btn, .fi-ta-actions .fi-link {
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  color: #9a9da2 !important;
}
.fi-ta-actions .fi-btn:hover, .fi-ta-actions .fi-link:hover { color: #17181a !important; }

/* Статусы: капитель моноширинным вместо серого текста */
.fi-ta-cell[class*="status"] .fi-ta-text,
.fi-ta-cell[class*="state"] .fi-ta-text {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-size: 0.6875rem !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6e7176 !important;
}

/* Пустое значение читается как прочерк, а не как «0» без смысла */
.fi-ta-empty-text { color: #b4b7ba; }

/* ── Ссылки: сдержанные ─────────────────────────────────────────────── */

.fi-link, .fi-ta-record-content a, .prose a {
  color: #3a3f46;
  text-decoration: none;
  font-weight: 500;
}
.fi-link:hover, .fi-ta-record-content a:hover, .prose a:hover {
  color: #17181a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Меню ───────────────────────────────────────────────────────────── */

.fi-sidebar-item-button { border-radius: 9px; padding: 0.5rem 0.7rem; }
.fi-sidebar-item-label { font-size: 0.875rem !important; color: #6e7176; }
.fi-sidebar-item-button:hover { background-color: #e5dbdb; }
.fi-sidebar-item-active .fi-sidebar-item-button { background-color: #e1d5d6; }
.fi-sidebar-item-active .fi-sidebar-item-label { color: #17181a; font-weight: 600; }
.fi-sidebar-item-badge, .fi-sidebar-item-badge * {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-size: 0.6875rem !important;
}
.fi-sidebar-group-label {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  color: #9a9da2;
  font-size: 0.625rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Логотип в топбаре */
.fi-logo { font-size: 1rem !important; font-weight: 600 !important; letter-spacing: -0.02em; color: #17181a; }
/* Слово портала после имени (Category::profile()->badge()) */
.fi-logo .ge-portal { margin-left: .5rem; padding: .05rem .5rem; border-radius: 999px; background: #EDE6E6; color: #5b5e63;
  font-size: .7rem !important; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }

/* ── Поля ───────────────────────────────────────────────────────────── */

.fi-input, .fi-select-input { font-size: 0.875rem; color: #17181a; }
.fi-fo-field-wrp-label, .fi-fo-field-wrp-label * { font-size: 0.8125rem !important; font-weight: 500 !important; color: #17181a; }
.fi-fo-field-wrp-hint, .fi-fo-field-wrp-helper-text { font-size: 0.75rem; color: #9a9da2; line-height: 1.5; }
.fi-input-wrp { background-color: #f3f4f6; border-color: #d1d5db; border-radius: 9px; }
.fi-input-wrp:focus-within {
  background-color: #ffffff;
  border-color: #3a3f46;
  box-shadow: 0 0 0 3px rgb(58 63 70 / 0.1);
}

/* Денежные и числовые поля — моноширинным */
.fi-input[type="number"],
.fi-input[inputmode="decimal"],
.fi-input[inputmode="numeric"] {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  letter-spacing: -0.01em;
}

.fi-btn { font-size: 0.8125rem !important; font-weight: 600 !important; border-radius: 9px; letter-spacing: -0.005em; }
.fi-badge, .fi-badge * {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-weight: 500 !important;
  font-size: 0.6875rem !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 6px;
}

@media print {
  .fi-sidebar, .fi-topbar, .fi-ta-actions, .fi-header-actions { display: none !important; }
  .fi-main-ctn { background: #fff; }
  .ge-card > .ge-block { break-inside: avoid; }
}

/* ── Чекбоксы, радио, переключатели ─────────────────────────────────── */

.fi-checkbox-input,
.fi-radio-input,
input[type="checkbox"],
input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  background-color: #ffffff;
  border: 1.5px solid #9ca3af;
  box-shadow: inset 0 1px 1px rgb(23 24 26 / 0.05);
  cursor: pointer;
}

input[type="checkbox"] { border-radius: 4px; }
input[type="radio"]    { border-radius: 50%; }

.fi-checkbox-input:hover,
.fi-radio-input:hover,
input[type="checkbox"]:hover,
input[type="radio"]:hover { border-color: #6e7176; }

/* Отмеченное состояние. background-image не трогаем — там галочка. */
.fi-checkbox-input:checked,
.fi-radio-input:checked,
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: #3a3f46;
  border-color: #3a3f46;
}

.fi-checkbox-input:focus-visible,
.fi-radio-input:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid #3a3f46;
  outline-offset: 2px;
}

input[type="checkbox"]:indeterminate {
  background-color: #3a3f46;
  border-color: #3a3f46;
}

/* Переключатели (toggle) */
.fi-toggle { background-color: #d4d5d7; }
.fi-toggle[aria-checked="true"] { background-color: #3a3f46; }

/* Подпись рядом с чекбоксом */
.fi-fo-checkbox-list-option-label,
.fi-checkbox-label { color: #17181a; font-size: 0.875rem; }

/* Чекбоксы выделения строк в таблице — крупнее, они мелкие по умолчанию */
.fi-ta-header-cell input[type="checkbox"],
.fi-ta-cell input[type="checkbox"] { width: 1rem; height: 1rem; }

/* ── Выпадающие списки ──────────────────────────────────────────────── */

.fi-dropdown-list-item { font-size: 0.875rem; color: #17181a; }
.fi-dropdown-list-item:hover { background-color: #f3f4f6; }

.fi-select-input option { color: #17181a; background: #ffffff; }

/* ── Иконки в меню ──────────────────────────────────────────────────── */

.fi-sidebar-item-icon { color: #c3c5c8; width: 1.1rem; height: 1.1rem; }
.fi-sidebar-item-active .fi-sidebar-item-icon { color: #3a3f46; }
.fi-sidebar-item-button:hover .fi-sidebar-item-icon { color: #6e7176; }

/* ════════════════════════════════════════════════════════════
   Дополнение к переданному файлу.

   Ниже — то, чего в передаче не было, потому что дизайнер этого
   не видел: элементы таблицы, появляющиеся только с данными, —
   итоговая строка, панель выделения, колонки с числами. Всё остальное берётся из файла
   выше и здесь не повторяется.
   ════════════════════════════════════════════════════════════ */

/* ── Числа ──────────────────────────────────────────────────── */
/* Столбик цифр сравнивается взглядом только при одинаковой ширине
   знака: в пропорциональном шрифте единица уже семёрки, и разряды
   в соседних строках не совпадают. Зацепка — класс, который
   Filament сам ставит колонкам с выравниванием вправо.
   !important обязателен: выше шрифт задан всему через .fi-body *. */

.fi-ta-cell.fi-align-end,
.fi-ta-cell .fi-align-end,
.fi-ta-summary-item-value,
.fi-in-entry .fi-align-end {
  font-family: 'IBM Plex Mono', ui-monospace, monospace !important;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ── Строка таблицы ─────────────────────────────────────────── */
/* Отмеченная строка держит заливку и после того, как курсор ушёл:
   иначе при выборе десятка лотов не видно, что именно отмечено. */

.fi-ta-row { transition: background-color .14s; }
.fi-ta-row:has(input[type="checkbox"]:checked) { background-color: #e5e7eb; }

/* Панель выделения — над таблицей, с действиями для отмеченных строк. */
.fi-ta-selection-indicator { background-color: #f3f4f6; }

/* Итоги отделены от строк: сумма по странице — не ещё одна запись. */
.fi-ta-summary-row, .fi-ta-summary {
  background-color: #ffffff;
  border-top: 1px solid #e5e7eb;
}

/* ── Скругления ─────────────────────────────────────────────── */
/* Карточки, таблицы и окна — тем же радиусом, что заданы выше
   у виджетов и выпадающих панелей. */

.fi-section, .fi-ta-ctn, .fi-modal-window { border-radius: 14px; }

/* Ряд навигации по разделам красится в panel-tweaks.css: там он
   сделан вкладками, а не кнопками, и тот файл подключается позже. */
