/* ---------- Design refresh: soft cards, rounded controls, muted badges ---------- */

:root {
    /* Дизайн-система на основе макетов ("Claude Design"): тёплый бежевый
       фон, графитовый текст, акцент — терракотовый оранжевый; Onest для
       текста, JetBrains Mono — для цифр/дат/id (везде, где раньше шёл
       обычный шрифт, но глазу нужно "выровнять" колонку цифр). Радиусы
       уменьшены пропорционально компактному масштабу шрифта (html: 82%,
       см. ниже), чтобы соответствовать компактной плотности макетов. */
    --gt-radius-lg: 20px;
    --gt-radius-md: 14px;
    --gt-radius-sm: 12px;
    --gt-radius-pill: 999px;
    --gt-shadow: 0 1px 2px oklch(0.2 0.01 60 / 0.04), 0 1px 6px oklch(0.2 0.01 60 / 0.06);
    --gt-ink: oklch(0.22 0.01 60);
    --gt-muted: oklch(0.52 0.01 60);
    --gt-bg: oklch(0.975 0.004 80);
    --gt-surface: oklch(0.995 0.002 80);
    --gt-border: oklch(0.92 0.005 70);
    --gt-border-strong: oklch(0.9 0.006 70);
    --gt-accent: oklch(0.66 0.19 42);
    --gt-accent-strong: oklch(0.55 0.17 42);
    --gt-font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --gt-font-mono: 'JetBrains Mono', ui-monospace, monospace;
    /* Переопределяем переменные самого Bootstrap, чтобы шрифт подхватился
       во всех его компонентах (кнопки, формы, таблицы, навбар и т.д.),
       а не только там, где мы явно задаём font-family. */
    --bs-body-font-family: var(--gt-font);
    --bs-font-sans-serif: var(--gt-font);
}

/* Компактный масштаб задаём на корне (html), а не через body{font-size}:
   rem у Bootstrap-утилит (отступы карточек, кнопок, полей ввода и т.п.)
   считается от корневого шрифта, а не от body. Раньше уменьшался
   только текст body, а все rem-отступы и стандартные .form-control (у
   Bootstrap это жёсткий font-size: 1rem, не переменная) оставались в
   исходном масштабе — отсюда непропорционально крупный текст в полях ввода
   (например, в редакторе комментария) и "рыхлые" интервалы между блоками.
   82% от обычных 16px браузера = те же 13.12px, что были у body раньше —
   просто теперь это тянет за собой и все производные rem-размеры. */
html {
    font-size: 82%;
}

body {
    font-family: var(--gt-font);
    background: var(--gt-bg);
    color: var(--gt-ink);
}

/* Тосты с флеш-сообщениями — в углу экрана, поверх шапки, а не баннером в
   потоке контента. top учитывает высоту двухрядной шапки (лого/пилюли
   навигации) с запасом, чтобы не перекрываться с ней даже на маленьких
   экранах. */
.toast-container-top-end {
    top: 112px;
    right: 0;
    z-index: 1085;
}

.toast {
    border-radius: var(--gt-radius-sm);
    box-shadow: var(--gt-shadow);
}

.card {
    border: none;
    border-radius: var(--gt-radius-lg);
    box-shadow: var(--gt-shadow);
    /* Без этого содержимое (например, таблица с прямыми углами) торчит
       за скруглённые края карточки внизу/по бокам. */
    overflow: hidden;
}

.card-header {
    background: var(--gt-surface);
    border-bottom: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-lg) var(--gt-radius-lg) 0 0 !important;
}

.btn {
    /* Все кнопки в макетах — пилюли, без исключений (в т.ч. маленькие
       btn-sm/outline-*). Кнопки внутри .input-group всё равно получают
       плоские внутренние углы от более специфичных правил самого
       Bootstrap (".input-group > .btn:not(:first-child)" и т.п.),
       которые весят больше, чем один класс — сюда они не долетают. */
    border-radius: var(--gt-radius-pill);
    font-weight: 500;
}

.btn-primary {
    background-color: var(--gt-ink);
    border-color: var(--gt-ink);
    border-radius: var(--gt-radius-pill);
    padding-left: 1.1em;
    padding-right: 1.1em;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--gt-accent) !important;
    border-color: var(--gt-accent) !important;
}

.btn-outline-light {
    border-radius: var(--gt-radius-sm);
}

.gt-status-action-btn {
    height: 42px;
    padding: 0 20px;
    border-radius: var(--gt-radius-pill);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.gt-status-advance-btn {
    background: oklch(0.55 0.14 155);
    border-color: oklch(0.55 0.14 155);
    color: oklch(0.99 0.005 80);
}

.gt-status-advance-btn:hover {
    background: oklch(0.48 0.15 155);
    border-color: oklch(0.48 0.15 155);
}

.gt-status-revert-btn {
    background: transparent;
    border-color: oklch(0.62 0.19 25);
    color: oklch(0.52 0.18 25);
}

.gt-status-revert-btn:hover {
    background: oklch(0.58 0.2 25);
    border-color: oklch(0.58 0.2 25);
    color: oklch(0.99 0.005 80);
}

.form-control,
.form-select {
    border-radius: var(--gt-radius-sm);
    border-color: var(--gt-border-strong);
    background-color: var(--gt-surface);
}

/* Сам <select> везде спрятан под кастомную панель (см.
   custom_select.js/.gt-select-panel) — это лишь запасной вариант на
   случай, если по какой-то причине JS не отработал и список открылся
   нативно (color-scheme — чтобы список не стал тёмным поверх светлой
   темы ОС). */
select {
    color-scheme: light;
}

select option {
    background: var(--gt-surface);
    color: var(--gt-ink);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gt-ink);
    box-shadow: 0 0 0 3px oklch(0.93 0.006 70);
}

.table {
    --bs-table-hover-bg: #f9fafb;
}

.table thead.table-light th {
    background: #fff;
    color: var(--gt-ink);
    font-size: inherit;
    font-weight: 700;
    border-bottom: 1px solid var(--gt-border);
}

.table td, .table th {
    border-color: var(--gt-border);
}

.nav-pills .nav-link {
    border-radius: 999px;
    color: #6b7280;
    font-weight: 500;
    padding: .4rem 1rem;
}

.nav-pills .nav-link.active {
    background-color: var(--gt-ink);
    color: #fff;
}

/* Смягчённые бейджи-"пилюли" вместо насыщенных bootstrap-цветов — покрывает
   все существующие bg-* бейджи по всему приложению без правки шаблонов.
   Формула цвета — та же, что и в макетах: bg = oklch(0.95 0.035 H),
   fg = oklch(0.45 0.14 H) для конкретного оттенка H на каждый статус/цвет. */
.badge.bg-primary { background-color: oklch(0.95 0.035 275) !important; color: oklch(0.45 0.14 275) !important; }
.badge.bg-secondary { background-color: oklch(0.93 0.005 70) !important; color: oklch(0.28 0.01 60) !important; }
.badge.bg-success { background-color: oklch(0.95 0.035 155) !important; color: oklch(0.45 0.14 155) !important; }
.badge.bg-warning { background-color: oklch(0.95 0.035 70) !important; color: oklch(0.45 0.14 70) !important; }
.badge.bg-danger { background-color: oklch(0.95 0.035 25) !important; color: oklch(0.45 0.14 25) !important; }
.badge.bg-info { background-color: oklch(0.95 0.035 200) !important; color: oklch(0.45 0.14 200) !important; }
.badge.bg-dark { background-color: oklch(0.94 0.005 70) !important; color: oklch(0.45 0.01 60) !important; }
.badge.text-bg-light { background-color: oklch(0.94 0.005 70) !important; color: oklch(0.45 0.01 60) !important; }

.badge {
    font-weight: 600;
    padding: .4em .75em;
    border-radius: 8px;
}

.attachment-thumb {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: .375rem;
    border: 1px solid #dee2e6;
}

.attachment-delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    line-height: 18px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: #dc3545;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.attachment-delete-btn:hover {
    background: #b02a37;
}

.attachment-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.attachment-lightbox-overlay.is-open {
    display: flex;
}

.attachment-lightbox-img {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: var(--gt-radius-sm);
    box-shadow: var(--gt-shadow);
}

.attachment-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
}

.comment-card {
    border-left: 3px solid #6c757d;
}

.comment-card.role-client {
    border-left-color: #0d6efd;
}

.comment-card.role-admin {
    border-left-color: #198754;
}

.richtext-wrap {
    border: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-md);
    background: #fff;
    overflow: hidden;
}

.richtext-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: #f8f9fb;
    border-bottom: 1px solid var(--gt-border);
}

.richtext-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--gt-ink);
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
}

.richtext-btn:hover {
    background: #e9ecef;
}

.richtext-btn.active {
    background: #dbe4ff;
    color: #3355dd;
}

.richtext-sep {
    width: 1px;
    height: 20px;
    background: var(--gt-border);
    margin: 0 4px;
}

.richtext-wrap .richtext-editor {
    min-height: 120px;
    white-space: pre-wrap;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.richtext-wrap .richtext-editor:focus {
    outline: none;
    box-shadow: none;
}

.date-field-wrap {
    position: relative;
}

.date-field-placeholder {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
    white-space: nowrap;
}

.date-field-wrap input[type="date"].date-empty {
    color: transparent;
}

/* JS-редактор приводит Enter к <p> (см. richtext_editor.js), но подстрахуемся
   и на <div> — на случай контента из браузера, где execCommand не сработал,
   или уже сохранённого до этой правки: без отступа соседние <div> визуально
   слипались в один абзац. */
.richtext-content p,
.richtext-content div {
    margin-bottom: 0.5rem;
}

.richtext-content p:last-child,
.richtext-content div:last-child {
    margin-bottom: 0;
}

.ticket-overdue {
    color: #dc3545;
    font-weight: 600;
}

.history-item {
    border-left: 2px solid #dee2e6;
    padding-left: 0.75rem;
    padding-bottom: 0.75rem;
}

.history-item:last-child {
    padding-bottom: 0;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: -6px;
    /* 0.79rem от нового корня (82%) ~= прежний 0.65rem от старого 16px-корня. */
    font-size: 0.79rem;
}

/* Оформление групп статусов — задаётся в админке (Статусы -> Настройки
   групп), применяется к шапке карточки группы на страницах со списками
   тикетов (admin/dashboard.html, client/tickets_list.html). Формулы цвета
   — те же самые, что и в свотч-пикере "Оформление группы" на странице
   Статусы (см. group_tone в statuses_list.html) — раньше здесь была
   отдельная палитра с рамкой слева на всю карточку, которой в макете
   нет вовсе: там тонируется только шапка группы, а у "приглушённой"
   темы тускнеют (opacity) строки тикетов, а не сама шапка. */
.card.status-group-default .card-header { background: oklch(0.995 0.002 80); color: oklch(0.22 0.01 60); }
.card.status-group-default .gt-group-dot { background: oklch(0.22 0.01 60); }

.card.status-group-muted .card-header { background: oklch(0.96 0.004 70); color: oklch(0.45 0.01 60); }
.card.status-group-muted .gt-group-dot { background: oklch(0.7 0.01 60); }
.card.status-group-muted .gt-row { opacity: 0.6; }

.card.status-group-accent-blue .card-header { background: oklch(0.955 0.03 275); color: oklch(0.45 0.14 275); }
.card.status-group-accent-blue .gt-group-dot { background: oklch(0.64 0.17 275); }

.card.status-group-accent-yellow .card-header { background: oklch(0.955 0.03 70); color: oklch(0.45 0.14 70); }
.card.status-group-accent-yellow .gt-group-dot { background: oklch(0.64 0.17 70); }

.card.status-group-accent-red .card-header { background: oklch(0.955 0.03 15); color: oklch(0.45 0.14 15); }
.card.status-group-accent-red .gt-group-dot { background: oklch(0.64 0.17 15); }

.card.status-group-accent-green .card-header { background: oklch(0.955 0.03 155); color: oklch(0.45 0.14 155); }
.card.status-group-accent-green .gt-group-dot { background: oklch(0.64 0.17 155); }

.card.status-group-accent-gray .card-header { background: oklch(0.945 0.005 70); color: oklch(0.28 0.01 60); }
.card.status-group-accent-gray .gt-group-dot { background: oklch(0.3 0.01 60); }

/* ---------- Шапка сайта (шапка+навигация из макетов Claude Design) ---------- */

.gt-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 96px;
}

.gt-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: oklch(0.975 0.004 80 / 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gt-border);
    margin-bottom: 28px;
}

.gt-header-row {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 40px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.gt-header-row.gt-nav-row {
    padding: 0 40px 10px;
}

.gt-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    color: var(--gt-ink);
    text-decoration: none;
}

.gt-brand:hover {
    color: var(--gt-ink);
}

.gt-brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--gt-accent);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.gt-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gt-brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gt-surface);
}

.gt-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.gt-notif {
    position: relative;
}

.gt-notif-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--gt-border-strong);
    background: var(--gt-surface);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: oklch(0.35 0.01 60);
}

.gt-notif-btn:hover {
    border-color: oklch(0.8 0.01 70);
}

.gt-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--gt-radius-pill);
    background: oklch(0.62 0.2 28);
    color: var(--gt-surface);
    font-family: var(--gt-font-mono);
    font-size: 10px;
    font-weight: 500;
    display: grid;
    place-items: center;
    border: 2px solid var(--gt-bg);
}

.gt-notif-menu {
    width: 380px;
    max-width: 90vw;
    padding: 0;
    border: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-lg);
    box-shadow: 0 30px 80px -24px oklch(0.2 0.01 60 / 0.3), 0 2px 6px oklch(0.2 0.01 60 / 0.06);
    overflow: hidden;
}

.gt-notif-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 14px;
}

.gt-notif-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.gt-notif-count {
    font-family: var(--gt-font-mono);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--gt-radius-pill);
    background: oklch(0.94 0.04 28);
    color: oklch(0.5 0.18 28);
}

.gt-notif-markall-form {
    margin-left: auto;
}

.gt-notif-markall {
    height: 32px;
    padding: 0 12px;
    border-radius: var(--gt-radius-pill);
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--gt-accent-strong);
}

.gt-notif-markall:disabled {
    color: oklch(0.7 0.01 60);
    cursor: default;
}

.gt-notif-markall:hover:not(:disabled) {
    background: oklch(0.95 0.005 70);
}

.gt-notif-list {
    max-height: min(420px, calc(100vh - 170px));
    overflow-y: auto;
    border-top: 1px solid var(--gt-border);
    padding: 6px;
}

.gt-notif-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 8px;
    gap: 2px 12px;
    align-items: start;
    padding: 12px 14px;
    border-radius: var(--gt-radius-md);
    color: inherit;
    text-decoration: none;
}

.gt-notif-item:hover {
    background: oklch(0.97 0.005 75);
}

.gt-notif-text {
    grid-column: 1;
    font-size: 14px;
    line-height: 1.4;
    color: oklch(0.35 0.01 60);
}

.gt-notif-item.unread .gt-notif-text {
    font-weight: 600;
    color: oklch(0.2 0.01 60);
}

.gt-notif-date {
    grid-column: 1;
    font-family: var(--gt-font-mono);
    font-size: 11px;
    color: oklch(0.55 0.01 60);
}

.gt-notif-dot {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: transparent;
}

.gt-notif-item.unread .gt-notif-dot {
    background: oklch(0.62 0.2 28);
}

.gt-notif-empty {
    padding: 20px;
    margin: 0;
    text-align: center;
    color: oklch(0.55 0.01 60);
    font-size: 14px;
}

.gt-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gt-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.gt-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.gt-user-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--gt-ink);
}

.gt-user-role {
    font-size: 12px;
    color: oklch(0.52 0.01 60);
}

.gt-btn-pill-outline {
    height: 36px;
    padding: 0 16px;
    border-radius: var(--gt-radius-pill);
    border: 1px solid var(--gt-border-strong);
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: oklch(0.3 0.01 60);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.gt-btn-pill-outline:hover {
    background: oklch(0.94 0.005 70);
    color: oklch(0.3 0.01 60);
}

.gt-nav-pills {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    margin-left: -13px;
}

.gt-nav-pill {
    padding: 8px 13px;
    border-radius: var(--gt-radius-pill);
    background: transparent;
    color: oklch(0.48 0.01 60);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
}

.gt-nav-pill:hover {
    background: oklch(0.93 0.006 70);
    color: var(--gt-ink);
}

.gt-nav-pill.active {
    background: oklch(0.93 0.006 70);
    color: var(--gt-ink);
}

/* ---------- Список тикетов (сетка вместо <table> из макета) ---------- */

.gt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

/* Список тикетов — плоский ряд вкладок-пилюль (Все + каждый статус по
   порядку), без деления на группы и разделителей: один общий фон-трек
   на .gt-tabs, как в макете. .gt-tab-group — самостоятельный компонент
   (например, переключатель сортировки на странице "Файлы") — своя
   плашка-пилюля у него остаётся, см. ниже. */
.gt-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: var(--gt-radius-pill);
    background: oklch(0.955 0.005 75);
}

.gt-tab-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: var(--gt-radius-pill);
    background: oklch(0.955 0.005 75);
}

.gt-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--gt-radius-pill);
    font-size: 14px;
    font-weight: 500;
    color: oklch(0.48 0.01 60);
    text-decoration: none;
    white-space: nowrap;
}

.gt-tab:hover {
    color: var(--gt-ink);
}

.gt-tab.active {
    background: var(--gt-surface);
    color: var(--gt-ink);
    box-shadow: var(--gt-shadow);
}

.gt-tab-count {
    font-family: var(--gt-font-mono);
    font-size: 11px;
    color: oklch(0.62 0.01 60);
}

.gt-tab.active .gt-tab-count {
    color: var(--gt-accent);
}

.gt-search {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    width: 320px;
    max-width: 100%;
    padding: 0 16px;
    border-radius: var(--gt-radius-pill);
    border: 1px solid var(--gt-border-strong);
    background: var(--gt-surface);
    color: oklch(0.55 0.01 60);
}

.gt-search svg {
    flex-shrink: 0;
}

.gt-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 14px;
    color: var(--gt-ink);
}

.gt-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gt-group-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 24px;
    text-align: left;
    border: 0;
    font: inherit;
    cursor: pointer;
    color: inherit;
}

.gt-group-chevron {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: oklch(0.5 0.01 60);
    flex-shrink: 0;
    transition: transform .2s;
}

.gt-group-header[aria-expanded="false"] .gt-group-chevron {
    transform: rotate(-90deg);
}

.gt-group-header[aria-expanded="false"] + .gt-group-body {
    display: none;
}

.gt-group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gt-ink);
    flex-shrink: 0;
}

.gt-group-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gt-group-count {
    font-family: var(--gt-font-mono);
    font-size: 12px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: var(--gt-radius-pill);
    background: var(--gt-surface);
    color: inherit;
}

/* Колонки шапки и строк тикетов — одна и та же сетка на обеих, поэтому
   ширины колонок между группами всегда совпадают сами по себе, без JS
   (в отличие от прежних отдельных <table> на каждую группу). */
.gt-cols,
.gt-row {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 110px 150px 100px 130px;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
}

.gt-cols {
    border-top: 1px solid var(--gt-border);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: oklch(0.58 0.01 60);
}

.gt-row {
    padding-top: 14px;
    padding-bottom: 14px;
    border-top: 1px solid var(--gt-border);
    color: inherit;
    text-decoration: none;
}

.gt-row:hover {
    background: oklch(0.975 0.005 75);
    color: inherit;
}

.gt-row.ticket-row-final {
    opacity: 0.6;
}

.gt-col-priority,
.gt-col-status,
.gt-col-deadline {
    text-align: center;
}

.gt-col-updated {
    text-align: right;
}

.gt-cell-updated {
    font-family: var(--gt-font-mono);
    font-size: 12px;
    color: oklch(0.55 0.01 60);
}

.gt-cell-title {
    min-width: 0;
}

.gt-cell-title-text {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--gt-ink);
}

.gt-cell-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: oklch(0.55 0.01 60);
}

.gt-cell-meta .gt-meta-id {
    font-family: var(--gt-font-mono);
}

.gt-cell-meta .gt-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

.gt-people {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    color: oklch(0.4 0.01 60);
}

.gt-avatar-mini {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font-size: 8px;
    font-weight: 700;
    flex-shrink: 0;
}

.gt-cell-priority {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: oklch(0.4 0.01 60);
}

.gt-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.gt-bars span {
    display: block;
    width: 3px;
    border-radius: 1px;
    background: oklch(0.88 0.006 70);
}

.gt-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gt-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.gt-empty {
    padding: 80px 0;
    text-align: center;
    color: oklch(0.55 0.01 60);
    font-size: 15px;
    border: 1px dashed oklch(0.88 0.006 70);
    border-radius: var(--gt-radius-lg);
}

/* ---------- Вложения (шапка-описание тикета + комментарии) ---------- */

.gt-files {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gt-file-chip {
    position: relative;
}

.gt-file-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 220px;
    padding: 8px 36px 8px 8px;
    border-radius: var(--gt-radius-md);
    border: 1px solid var(--gt-border);
    background: oklch(0.985 0.003 75);
    text-decoration: none;
    color: inherit;
}

.gt-file-link:hover {
    border-color: var(--gt-border-strong);
    color: inherit;
}

.gt-file-thumb {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    flex-shrink: 0;
    background-color: oklch(0.94 0.005 70);
    background-size: cover;
    background-position: center;
}

.gt-file-thumb-doc {
    background: oklch(0.94 0.03 42);
    color: oklch(0.48 0.14 42);
    display: grid;
    place-items: center;
    font-family: var(--gt-font-mono);
    font-size: 10px;
    font-weight: 500;
}

.gt-file-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gt-file-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gt-file-size {
    font-family: var(--gt-font-mono);
    font-size: 11px;
    color: var(--gt-muted);
}

.gt-file-remove-form {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    margin: 0;
}

.gt-file-remove {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--gt-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
}

.gt-file-remove:hover {
    background: oklch(0.94 0.04 25);
    color: oklch(0.52 0.18 25);
}

/* ---------- Страница тикета ---------- */

.gt-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    align-items: start;
}

@media (max-width: 900px) {
    .gt-detail-grid {
        grid-template-columns: 1fr;
    }
}

.gt-detail-main {
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-width: 0;
}

.gt-detail-heading {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gt-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gt-muted);
    align-self: flex-start;
    text-decoration: none;
}

.gt-back-link:hover {
    color: var(--gt-ink);
}

.gt-detail-title {
    margin: 0;
    font-size: 40px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.gt-detail-id {
    font-family: var(--gt-font-mono);
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0;
    color: oklch(0.6 0.01 60);
    margin-left: 6px;
}

.gt-copy-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: 32px;
    height: 32px;
    margin-left: 10px;
    border: 1px solid var(--gt-border);
    border-radius: 50%;
    background: var(--gt-surface);
    color: oklch(0.5 0.01 60);
    cursor: pointer;
}

.gt-copy-link-btn:hover {
    background: oklch(0.95 0.005 70);
    color: var(--gt-ink);
}

.gt-copy-link-btn.is-copied {
    color: oklch(0.55 0.14 155);
    border-color: oklch(0.55 0.14 155);
}

.gt-copy-link-btn .gt-copy-icon-check {
    display: none;
}

.gt-copy-link-btn.is-copied .gt-copy-icon-link {
    display: none;
}

.gt-copy-link-btn.is-copied .gt-copy-icon-check {
    display: block;
}

.gt-pills-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.badge.gt-pill {
    border-radius: var(--gt-radius-pill);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
}

.gt-pill-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--gt-radius-pill);
    border: 1px solid var(--gt-border-strong);
    color: oklch(0.35 0.01 60);
}

.gt-card {
    background: var(--gt-surface);
    border: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-lg);
    box-shadow: var(--gt-shadow);
    overflow: hidden;
}

.gt-desc-card {
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gt-desc-card .richtext-content {
    font-size: 16px;
    line-height: 1.65;
    color: oklch(0.26 0.01 60);
    max-width: 760px;
}

.gt-desc-attachments {
    padding-top: 20px;
    border-top: 1px solid var(--gt-border);
}

.gt-comments-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gt-comments-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.gt-comments-count {
    font-family: var(--gt-font-mono);
    font-size: 12px;
    padding: 2px 9px;
    border-radius: var(--gt-radius-pill);
    background: oklch(0.94 0.005 70);
    color: oklch(0.45 0.01 60);
}

.gt-comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gt-comment {
    scroll-margin-top: 96px;
    border-radius: var(--gt-radius-lg);
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid var(--gt-border);
    background: var(--gt-surface);
    transition: box-shadow .3s;
}

.gt-comment.is-highlighted {
    box-shadow: 0 0 0 3px oklch(0.7 0.15 275 / 0.45);
}

.gt-comment.role-admin {
    background: oklch(0.965 0.02 275);
    border-color: oklch(0.89 0.04 275);
}

.gt-comment-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gt-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
}

.gt-comment-author {
    font-size: 14px;
    font-weight: 600;
}

.gt-comment-role {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--gt-radius-pill);
    background: oklch(0.93 0.04 160);
    color: oklch(0.4 0.1 160);
}

.gt-comment.role-admin .gt-comment-role {
    background: oklch(0.92 0.04 275);
    color: oklch(0.42 0.12 275);
}

.gt-comment-edited {
    font-size: 11px;
    font-style: italic;
    color: oklch(0.58 0.01 60);
}

.gt-comment-head-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gt-comment-date {
    font-family: var(--gt-font-mono);
    font-size: 11px;
    color: oklch(0.55 0.01 60);
    white-space: nowrap;
}

.gt-comment-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: oklch(0.55 0.01 60);
    cursor: pointer;
    flex-shrink: 0;
}

.gt-comment-action-btn:hover {
    background: oklch(0.93 0.01 70 / 0.6);
    color: var(--gt-ink);
}

.gt-comment.role-admin .gt-comment-action-btn:hover {
    background: oklch(0.9 0.03 275 / 0.5);
}

.gt-comment-action-btn.is-copied {
    color: oklch(0.55 0.14 155);
}

.gt-comment-action-btn .gt-copy-icon-check {
    display: none;
}

.gt-comment-action-btn.is-copied .gt-copy-icon-link {
    display: none;
}

.gt-comment-action-btn.is-copied .gt-copy-icon-check {
    display: block;
}

.gt-comment-body {
    font-size: 15px;
    line-height: 1.6;
    color: oklch(0.26 0.01 60);
}

.gt-comment .gt-files {
    margin-top: 6px;
}

.gt-comment-edit-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gt-comment-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.gt-comment-edit-save {
    height: 36px;
    padding: 0 18px;
    border-radius: var(--gt-radius-pill);
    border: 0;
    background: oklch(0.22 0.01 60);
    color: oklch(0.98 0.004 80);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.gt-comment-edit-save:hover {
    background: var(--gt-accent);
}

.gt-comment-edit-cancel {
    height: 36px;
    padding: 0 16px;
    border-radius: var(--gt-radius-pill);
    border: 1px solid var(--gt-border-strong);
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: oklch(0.4 0.01 60);
}

.gt-comment-edit-cancel:hover {
    background: oklch(0.95 0.005 70);
}

/* ---------- Композер комментария ---------- */

.gt-composer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gt-border);
}

.richtext-wrap {
    border-radius: var(--gt-radius-lg);
}

.richtext-wrap:focus-within {
    border-color: oklch(0.75 0.08 42);
}

.richtext-toolbar {
    background: transparent;
    padding: 8px 10px;
}

.richtext-btn {
    width: 32px;
    height: 32px;
}

.richtext-wrap .richtext-editor {
    padding: 16px 20px;
    font-size: 15px;
    line-height: 1.55;
}

.gt-composer-files {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--gt-border);
}

.gt-composer-files:has(.gt-file-list:empty) {
    display: none;
}

.gt-file-list:empty {
    display: none;
}

.gt-file-list.gt-files {
    display: flex;
}

.gt-composer-files-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: oklch(0.5 0.01 60);
}

.gt-composer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.gt-composer-pick {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.gt-composer-pick-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: oklch(0.35 0.01 60);
}

.gt-composer-pick-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: var(--gt-radius-pill);
    border: 1px dashed oklch(0.8 0.01 70);
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.gt-composer-pick-label:hover .gt-composer-pick-btn {
    border-color: var(--gt-accent);
    color: var(--gt-accent-strong);
}

.gt-composer-hint {
    font-size: 12px;
    color: oklch(0.55 0.01 60);
}

.gt-composer-submit {
    height: 44px;
    padding: 0 22px;
    border-radius: var(--gt-radius-pill);
    border: 0;
    background: oklch(0.22 0.01 60);
    color: oklch(0.98 0.004 80);
    font-size: 15px;
    font-weight: 500;
}

.gt-composer-submit:disabled {
    background: oklch(0.82 0.008 70);
    cursor: not-allowed;
}

/* ---------- Сайдбар: Сведения / Управление / История / Опасная зона ---------- */

.gt-side-card {
    background: var(--gt-surface);
    border: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-lg);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gt-side-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: oklch(0.5 0.01 60);
}

.gt-info-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 16px;
    font-size: 14px;
    align-items: center;
}

.gt-info-grid .gt-info-label {
    color: oklch(0.52 0.01 60);
}

.gt-info-grid .gt-info-value {
    font-weight: 500;
}

.gt-info-people {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gt-avatar-mini.md {
    width: 22px;
    height: 22px;
    font-size: 9px;
}

.gt-info-meta {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 16px;
    font-size: 13px;
    padding-top: 14px;
    border-top: 1px solid var(--gt-border);
}

.gt-info-meta .gt-info-label {
    color: oklch(0.52 0.01 60);
}

.gt-info-meta .gt-info-value {
    font-family: var(--gt-font-mono);
    font-size: 12px;
    text-align: right;
}

.gt-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gt-field-label {
    font-size: 12px;
    font-weight: 500;
    color: oklch(0.45 0.01 60);
}

.gt-field-row {
    display: flex;
    gap: 6px;
}

.gt-field-control {
    position: relative;
    flex: 1;
    min-width: 0;
}

.gt-field-control select,
.gt-field-control input,
.gt-field-control .gt-select-trigger {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border-radius: var(--gt-radius-sm);
    border: 1px solid var(--gt-border-strong);
    background: oklch(0.985 0.003 75);
    font: inherit;
    font-size: 14px;
    color: var(--gt-ink);
}

.gt-field-control select:focus,
.gt-field-control input:focus,
.gt-field-control .gt-select-trigger:focus {
    outline: 0;
    border-color: var(--gt-ink);
}

.gt-field-save {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--gt-radius-sm);
    border: 1px solid var(--gt-border-strong);
    background: transparent;
    color: oklch(0.72 0.01 60);
    display: grid;
    place-items: center;
    cursor: default;
    transition: all .15s;
}

.gt-field-save.is-dirty {
    background: oklch(0.22 0.01 60);
    color: oklch(0.98 0.004 80);
    border-color: oklch(0.22 0.01 60);
    cursor: pointer;
}

.gt-history-item {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 12px;
}

.gt-history-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gt-history-dot {
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
    background: oklch(0.82 0.008 70);
    flex-shrink: 0;
}

.gt-history-item.is-latest .gt-history-dot {
    background: var(--gt-accent);
}

.gt-history-line {
    flex: 1;
    width: 1px;
    background: var(--gt-border);
    margin-top: 4px;
}

.gt-history-item.is-latest .gt-history-line {
    background: transparent;
}

.gt-history-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-bottom: 16px;
}

.gt-history-text {
    font-size: 13px;
    line-height: 1.45;
    color: oklch(0.28 0.01 60);
}

.gt-history-date {
    font-family: var(--gt-font-mono);
    font-size: 11px;
    color: oklch(0.55 0.01 60);
}

.gt-danger-card {
    border: 1px solid oklch(0.88 0.05 25);
    background: oklch(0.985 0.008 25);
    border-radius: var(--gt-radius-lg);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.gt-danger-card .gt-side-title {
    color: oklch(0.52 0.18 25);
}

.gt-danger-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: oklch(0.45 0.02 40);
}

.gt-danger-btn {
    margin-top: 4px;
    height: 40px;
    border-radius: var(--gt-radius-pill);
    border: 1px solid oklch(0.62 0.19 25);
    background: transparent;
    color: oklch(0.52 0.18 25);
    font-size: 14px;
    width: 100%;
}

.gt-danger-btn:hover {
    background: oklch(0.58 0.2 25);
    color: oklch(0.99 0.005 80);
}

/* ---------- Страница логина ---------- */

.gt-login-page {
    min-height: 100vh;
    max-width: 1360px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    padding: 16px;
    gap: 16px;
}

@media (max-width: 900px) {
    .gt-login-page {
        grid-template-columns: 1fr;
    }
    .gt-login-visual {
        display: none;
    }
}

.gt-login-visual {
    position: relative;
    border-radius: 32px;
    background: oklch(0.21 0.01 60);
    overflow: hidden;
    height: calc(100vh - 32px);
    min-height: 560px;
    max-height: 900px;
    align-self: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 36px 40px;
}

.gt-login-lanes {
    position: absolute;
    inset: -20% -30%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    transform: rotate(-8deg);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}

.gt-login-lane {
    display: flex;
    width: max-content;
}

.gt-login-lane-track {
    display: flex;
    gap: 14px;
    padding-right: 14px;
    animation: lane var(--dur, 70s) linear infinite;
    animation-direction: var(--dir, normal);
}

.gt-login-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 16px;
    background: oklch(0.27 0.01 60);
    border: 1px solid oklch(0.33 0.01 60);
    color: oklch(0.93 0.005 80);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}

.gt-login-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gt-login-chip-id {
    font-family: var(--gt-font-mono);
    font-size: 12px;
    color: oklch(0.62 0.01 60);
}

.gt-login-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 50% at 50% 55%, transparent, oklch(0.21 0.01 60 / 0.85));
}

.gt-login-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    color: oklch(0.97 0.004 80);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.gt-login-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--gt-accent);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.gt-login-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gt-login-brand-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: oklch(0.99 0.005 80);
}

.gt-login-form-col {
    display: grid;
    place-items: center;
    padding: 40px 24px;
}

.gt-login-form {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.gt-login-head {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.gt-login-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--gt-accent);
    display: grid;
    place-items: center;
    animation: pulse 2.8s ease-in-out infinite;
}

.gt-login-icon span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: oklch(0.99 0.005 80);
}

.gt-login-title {
    margin: 0;
    font-size: 56px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.gt-login-field {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gt-login-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gt-login-label > span {
    font-size: 14px;
    font-weight: 500;
    color: oklch(0.4 0.01 60);
}

.gt-login-input-wrap {
    position: relative;
}

.gt-login-input-wrap.is-shaking {
    animation: shakeA .4s ease;
}

.gt-login-input {
    width: 100%;
    height: 60px;
    padding: 0 60px 0 20px;
    border-radius: 18px;
    border: 1.5px solid var(--gt-border-strong);
    background: var(--gt-surface);
    font: inherit;
    font-size: 18px;
    color: var(--gt-ink);
    outline: 0;
    transition: border-color .15s, box-shadow .15s;
}

.gt-login-input:focus {
    border-color: var(--gt-ink);
    box-shadow: 0 0 0 4px oklch(0.93 0.006 70);
}

.gt-login-input.is-invalid {
    border-color: oklch(0.62 0.19 25);
    box-shadow: 0 0 0 4px oklch(0.94 0.04 25);
}

.gt-login-eye {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: oklch(0.5 0.01 60);
}

.gt-login-eye:hover {
    background: oklch(0.95 0.005 70);
}

.gt-login-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.gt-login-note-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.gt-login-note.is-error {
    color: oklch(0.55 0.19 25);
}

.gt-login-note.is-caps {
    color: oklch(0.55 0.13 70);
}

.gt-login-submit {
    margin-top: 8px;
    width: 100%;
    height: 60px;
    border-radius: 18px;
    border: 0;
    background: var(--gt-ink);
    color: oklch(0.98 0.004 80);
    font: inherit;
    font-size: 17px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: background .2s;
    box-shadow: 0 10px 30px -12px oklch(0.22 0.01 60 / 0.6);
}

.gt-login-submit:hover {
    background: var(--gt-accent);
}

.gt-login-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid oklch(0.98 0.004 80 / 0.3);
    border-top-color: oklch(0.98 0.004 80);
    animation: spin .7s linear infinite;
}

@keyframes lane {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

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

@keyframes shakeA {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

/* ---------- Списки в админке (постановщики / категории / файлы / письма) ---------- */

.gt-list-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.gt-list-title-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.gt-list-title {
    margin: 0;
    font-size: 52px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.gt-list-count {
    font-family: var(--gt-font-mono);
    font-size: 14px;
    padding: 3px 10px;
    border-radius: var(--gt-radius-pill);
    background: oklch(0.93 0.005 70);
    color: oklch(0.45 0.01 60);
}

.gt-list-new-btn {
    height: 48px;
    padding: 0 22px 0 18px;
    border-radius: var(--gt-radius-pill);
    border: 0;
    background: var(--gt-ink);
    color: oklch(0.98 0.004 80);
    font-size: 15px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 20px -8px oklch(0.22 0.01 60 / 0.5);
    text-decoration: none;
    flex-shrink: 0;
}

.gt-list-new-btn:hover {
    background: var(--gt-accent);
    color: oklch(0.98 0.004 80);
}

.gt-table-wrap {
    overflow-x: auto;
}

.gt-t-head,
.gt-t-row {
    display: grid;
    gap: 16px;
    align-items: center;
    padding: 16px 24px;
}

.gt-t-head {
    padding-top: 14px;
    padding-bottom: 14px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: oklch(0.56 0.01 60);
    background: oklch(0.985 0.003 75);
    border-bottom: 1px solid oklch(0.93 0.005 70);
}

.gt-t-row {
    border-top: 1px solid oklch(0.95 0.004 70);
    transition: background .12s, opacity .15s;
    text-decoration: none;
    color: inherit;
}

.gt-t-row:hover {
    color: inherit;
}

.gt-t-row:hover {
    background: oklch(0.98 0.004 75);
}

.gt-t-empty {
    padding: 56px 24px;
    text-align: center;
    font-size: 15px;
    color: oklch(0.55 0.01 60);
}

.gt-t-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.gt-t-btn {
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--gt-border-strong);
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: oklch(0.3 0.01 60);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.gt-t-btn:hover {
    background: oklch(0.95 0.005 70);
    color: oklch(0.3 0.01 60);
}

.gt-t-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--gt-border-strong);
    background: transparent;
    display: grid;
    place-items: center;
    color: oklch(0.4 0.01 60);
    flex-shrink: 0;
}

.gt-t-icon-btn:hover {
    background: oklch(0.95 0.005 70);
}

.gt-t-icon-btn.gt-t-danger {
    border-color: oklch(0.88 0.05 25);
    color: oklch(0.55 0.18 25);
}

.gt-t-icon-btn.gt-t-danger:hover {
    background: oklch(0.58 0.2 25);
    color: oklch(0.99 0.005 80);
}

.gt-t-mini-btn {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid var(--gt-border-strong);
    background: transparent;
    display: grid;
    place-items: center;
    color: oklch(0.4 0.01 60);
    flex-shrink: 0;
}

.gt-t-mini-btn:hover:not(:disabled) {
    background: oklch(0.95 0.005 70);
}

.gt-t-mini-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.gt-avatar-md {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.gt-t-name {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.gt-t-email-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.gt-t-email {
    font-family: var(--gt-font-mono);
    font-size: 12px;
    color: oklch(0.5 0.01 60);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gt-t-copy-btn {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    color: oklch(0.5 0.01 60);
    cursor: pointer;
}

.gt-t-copy-btn:hover {
    background: oklch(0.94 0.005 70);
}

.gt-t-copy-btn.is-copied {
    color: oklch(0.5 0.15 155);
}

.gt-t-pill-name {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--gt-radius-pill);
    border: 1px solid var(--gt-border-strong);
    background: oklch(0.985 0.003 75);
    color: oklch(0.25 0.01 60);
}

.gt-t-status-ok {
    color: oklch(0.45 0.14 155);
}

.gt-t-status-muted {
    color: oklch(0.55 0.01 60);
}

/* ---------- Формы редактирования (постановщик / категория / админ / шаблон письма) ---------- */

.gt-form-page {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.gt-form-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.gt-form-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.gt-form-heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.gt-form-title {
    margin: 0;
    font-size: 36px;
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.gt-form-subtitle {
    font-family: var(--gt-font-mono);
    font-size: 13px;
    color: oklch(0.52 0.01 60);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gt-form-card {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.gt-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gt-form-field > span:first-child,
.gt-form-field > label {
    font-size: 13px;
    font-weight: 500;
    color: oklch(0.4 0.01 60);
}

.gt-form-input,
.gt-form-select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--gt-border-strong);
    background: oklch(0.985 0.003 75);
    font: inherit;
    font-size: 16px;
    color: var(--gt-ink);
    outline: 0;
}

.gt-form-input:focus,
.gt-form-select:focus {
    border-color: var(--gt-ink);
}

.gt-form-input.mono {
    font-family: var(--gt-font-mono);
    font-size: 14px;
}

.gt-form-hint {
    font-size: 12px;
    color: oklch(0.55 0.01 60);
}

.gt-form-password-wrap {
    position: relative;
    display: block;
}

.gt-form-password-wrap input {
    padding-right: 52px;
}

.gt-form-eye {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: oklch(0.5 0.01 60);
}

.gt-form-eye:hover {
    background: oklch(0.95 0.005 70);
}

.gt-form-eye:disabled {
    opacity: 0.35;
    cursor: default;
}

.gt-form-eye:disabled:hover {
    background: transparent;
}

.gt-form-select-chip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 44px 0 12px;
    border-radius: 14px;
    border: 1px solid var(--gt-border-strong);
    background: oklch(0.985 0.003 75);
}

.gt-form-select-chip:hover {
    border-color: oklch(0.8 0.01 70);
}

.gt-form-select-chevron {
    position: absolute;
    right: 16px;
    top: 20px;
    pointer-events: none;
    color: oklch(0.5 0.01 60);
}

.gt-form-select-chip select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font: inherit;
}

.gt-form-select-chip-name {
    font-size: 15px;
    font-weight: 500;
}

.gt-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px solid var(--gt-border);
}

.gt-form-cancel-btn {
    height: 48px;
    padding: 0 18px;
    border-radius: var(--gt-radius-pill);
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    color: oklch(0.45 0.01 60);
    cursor: pointer;
}

.gt-form-cancel-btn:hover {
    background: oklch(0.95 0.005 70);
}

.gt-form-save-btn {
    height: 48px;
    padding: 0 26px;
    border-radius: var(--gt-radius-pill);
    border: 0;
    background: var(--gt-ink);
    color: oklch(0.98 0.004 80);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.gt-form-save-btn:hover {
    background: var(--gt-accent);
    color: oklch(0.98 0.004 80);
}

.gt-stepper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gt-stepper-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--gt-border-strong);
    background: var(--gt-surface);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: oklch(0.35 0.01 60);
    flex-shrink: 0;
}

.gt-stepper-btn:hover {
    background: oklch(0.95 0.005 70);
}

.gt-stepper input {
    width: 100px;
    height: 48px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid var(--gt-border-strong);
    background: oklch(0.985 0.003 75);
    font-family: var(--gt-font-mono);
    font-size: 15px;
    text-align: center;
    color: var(--gt-ink);
    outline: 0;
}

.gt-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.gt-toggle-btn {
    position: relative;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 18px 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--gt-border-strong);
    background: var(--gt-surface);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    color: oklch(0.25 0.01 60);
    cursor: pointer;
}

.gt-toggle-track {
    width: 36px;
    height: 20px;
    border-radius: var(--gt-radius-pill);
    padding: 2px;
    background: oklch(0.9 0.006 70);
    display: flex;
    justify-content: flex-start;
    transition: background .15s;
    flex-shrink: 0;
}

.gt-toggle-knob {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: oklch(0.995 0.002 80);
    box-shadow: 0 1px 2px oklch(0.2 0.01 60 / 0.3);
    flex-shrink: 0;
}

.gt-toggle-input:checked ~ .gt-toggle-track {
    background: var(--gt-ink);
    justify-content: flex-end;
}

/* ---------- Настройки групп статусов ---------- */

.gt-groups-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.gt-group-card {
    border: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: oklch(0.985 0.003 75);
}

.gt-group-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gt-border);
    min-height: 46px;
}

.gt-group-card-head .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gt-group-card-head span.label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gt-group-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gt-group-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: oklch(0.45 0.01 60);
    margin-bottom: 6px;
}

.gt-group-field-num {
    font-family: var(--gt-font-mono);
    font-size: 11px;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: oklch(0.93 0.005 70);
    display: grid;
    place-items: center;
    color: oklch(0.35 0.01 60);
    flex-shrink: 0;
}

.gt-group-input,
.gt-group-select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--gt-border-strong);
    background: var(--gt-surface);
    font: inherit;
    font-size: 14px;
    color: var(--gt-ink);
    outline: 0;
}

.gt-swatch-row {
    display: flex;
    gap: 4px;
}

.gt-swatch {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    max-width: 26px;
    aspect-ratio: 1;
    cursor: pointer;
}

.gt-swatch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.gt-swatch-fill {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid oklch(0.86 0.006 70);
    transition: box-shadow .12s;
}

.gt-swatch-input:checked ~ .gt-swatch-fill {
    box-shadow: 0 0 0 2px oklch(0.995 0.002 80), 0 0 0 4px oklch(0.22 0.01 60);
}

.gt-groups-save-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.gt-groups-save-btn {
    height: 44px;
    padding: 0 20px;
    border-radius: var(--gt-radius-pill);
    border: 1px solid var(--gt-border-strong);
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    color: oklch(0.3 0.01 60);
}

.gt-groups-save-btn:hover {
    background: oklch(0.95 0.005 70);
}

.gt-group-table-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
}

.gt-group-table-head .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.gt-group-table-head .gt-group-table-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gt-group-table-head .count {
    font-family: var(--gt-font-mono);
    font-size: 12px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: var(--gt-radius-pill);
    background: oklch(0.995 0.002 80);
}

.gt-bool-yes {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: oklch(0.22 0.01 60);
    color: oklch(0.98 0.004 80);
    display: grid;
    place-items: center;
}

.gt-bool-no {
    color: oklch(0.78 0.01 60);
}

/* ---------- Настройки ---------- */

.gt-settings-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

@media (max-width: 900px) {
    .gt-settings-grid {
        grid-template-columns: 1fr;
    }
    .gt-settings-nav {
        position: static !important;
        top: auto !important;
    }
}

.gt-settings-nav {
    position: sticky;
    top: 140px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.gt-settings-nav-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gt-settings-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: oklch(0.48 0.01 60);
    text-decoration: none;
}

.gt-settings-nav-link:hover {
    background: oklch(0.94 0.005 70);
    color: oklch(0.48 0.01 60);
}

.gt-settings-nav-link .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.gt-settings-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.gt-settings-sections > form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gt-settings-section {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.gt-settings-section h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.gt-settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.gt-favicon-box {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--gt-border);
    background: oklch(0.985 0.003 75);
}

.gt-favicon-preview {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--gt-accent);
}

.gt-favicon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.gt-favicon-preview .dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: oklch(0.99 0.005 80);
}

.gt-pill-file-btn {
    height: 38px;
    padding: 0 16px;
    border-radius: var(--gt-radius-pill);
    border: 1px solid oklch(0.88 0.006 70);
    background: var(--gt-surface);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    color: var(--gt-ink);
}

.gt-pill-file-btn:hover {
    border-color: var(--gt-accent);
    color: var(--gt-accent-strong);
}

.gt-input-suffix-wrap {
    position: relative;
    display: block;
}

.gt-input-suffix {
    position: absolute;
    right: 14px;
    top: 14px;
    font-size: 13px;
    color: oklch(0.55 0.01 60);
    pointer-events: none;
}

.gt-input-prefix {
    position: absolute;
    left: 14px;
    top: 14px;
    font-family: var(--gt-font-mono);
    font-size: 14px;
    color: oklch(0.62 0.01 60);
    pointer-events: none;
}

.gt-input-suffix-wrap .gt-form-input {
    padding-right: 50px;
}

.gt-input-prefix-wrap .gt-form-input {
    padding-left: 28px;
}

.gt-chips-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 46px;
    padding: 6px 8px;
    border-radius: 12px;
    border: 1px solid var(--gt-border-strong);
    background: oklch(0.985 0.003 75);
    cursor: text;
}

.gt-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 4px 0 10px;
    border-radius: 8px;
    background: var(--gt-surface);
    border: 1px solid var(--gt-border-strong);
    font-family: var(--gt-font-mono);
    font-size: 12px;
    color: oklch(0.3 0.01 60);
}

.gt-chip-remove {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: oklch(0.55 0.01 60);
}

.gt-chip-remove:hover {
    background: oklch(0.94 0.04 25);
    color: oklch(0.52 0.18 25);
}

.gt-chips-input input {
    flex: 1;
    min-width: 120px;
    height: 30px;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: var(--gt-font-mono);
    font-size: 13px;
    color: var(--gt-ink);
}

.gt-settings-savebar {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1040;
    transform: translate(-50%, 0);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 10px 10px 22px;
    border-radius: var(--gt-radius-pill);
    background: oklch(0.22 0.01 60);
    color: oklch(0.96 0.004 80);
    box-shadow: 0 20px 50px -16px oklch(0.2 0.01 60 / 0.6);
    transition: transform .25s ease, opacity .2s ease;
}

.gt-settings-savebar[hidden] {
    display: flex;
    transform: translate(-50%, 100px);
    opacity: 0;
    pointer-events: none;
}

.gt-settings-savebar span {
    font-size: 14px;
    white-space: nowrap;
}

.gt-settings-savebar-cancel {
    height: 40px;
    padding: 0 16px;
    border-radius: var(--gt-radius-pill);
    border: 0;
    background: transparent;
    color: oklch(0.8 0.01 70);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.gt-settings-savebar-cancel:hover {
    color: oklch(0.98 0.004 80);
}

.gt-settings-savebar-save {
    height: 40px;
    padding: 0 20px;
    border-radius: var(--gt-radius-pill);
    border: 0;
    background: var(--gt-accent);
    color: oklch(0.99 0.005 80);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.gt-settings-savebar-save:hover {
    background: oklch(0.62 0.19 42);
}

/* ---------- Страница создания тикета ---------- */

.gt-ticket-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .gt-ticket-form-grid {
        grid-template-columns: 1fr;
    }
}

.gt-ticket-form-main {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.gt-ticket-form-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 96px;
}

.gt-title-input-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.gt-title-counter {
    font-family: var(--gt-font-mono);
    font-size: 11px;
    color: oklch(0.6 0.01 60);
}

.gt-title-counter.is-full {
    color: oklch(0.55 0.19 25);
}

.gt-title-input {
    width: 100%;
    height: 56px;
    padding: 0 18px;
    border-radius: 16px;
    border: 1.5px solid var(--gt-border-strong);
    background: oklch(0.985 0.003 75);
    font: inherit;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--gt-ink);
    outline: 0;
    transition: border-color .15s, box-shadow .15s;
}

.gt-title-input:focus {
    border-color: var(--gt-ink);
    box-shadow: 0 0 0 4px oklch(0.93 0.006 70);
}

.gt-title-input.is-invalid {
    border-color: oklch(0.62 0.19 25);
    box-shadow: 0 0 0 4px oklch(0.94 0.04 25);
}

.gt-title-input.is-shaking {
    animation: shakeA .4s ease;
}

.gt-dropzone {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1.5px dashed oklch(0.8 0.01 70);
    background: oklch(0.985 0.003 75);
    cursor: pointer;
    transition: all .15s;
}

.gt-dropzone:hover,
.gt-dropzone.is-dragover {
    border-color: var(--gt-accent);
    background: oklch(0.975 0.012 42);
}

.gt-dropzone-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    flex-shrink: 0;
    background: oklch(0.94 0.03 42);
    color: oklch(0.52 0.15 42);
    display: grid;
    place-items: center;
}

.gt-dropzone-title {
    font-weight: 600;
    color: oklch(0.25 0.01 60);
}

.gt-dropzone-hint {
    font-size: 12px;
    color: oklch(0.55 0.01 60);
}

.gt-avatar-select-chip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 60px;
    padding: 0 40px 0 12px;
    border-radius: 16px;
    border: 1px solid var(--gt-border-strong);
    background: oklch(0.985 0.003 75);
}

.gt-avatar-select-chip:hover {
    border-color: oklch(0.8 0.01 70);
}

.gt-avatar-select-chip select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font: inherit;
}

.gt-avatar-select-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gt-avatar-select-email {
    font-size: 12px;
    color: oklch(0.52 0.01 60);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gt-chip-pick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gt-chip-pick {
    position: relative;
    cursor: pointer;
}

.gt-chip-pick-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.gt-chip-pick-visual {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--gt-radius-pill);
    border: 1px solid var(--gt-border-strong);
    background: var(--gt-surface);
    color: oklch(0.35 0.01 60);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all .15s;
}

.gt-chip-pick-input:checked ~ .gt-chip-pick-visual {
    background: var(--gt-ink);
    border-color: var(--gt-ink);
    color: oklch(0.98 0.004 80);
}

.gt-priority-pick {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: oklch(0.94 0.005 70);
}

.gt-priority-pick-opt {
    position: relative;
    cursor: pointer;
}

.gt-priority-pick-visual {
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 500;
    color: oklch(0.48 0.01 60);
    transition: all .15s;
}

.gt-chip-pick-input:checked ~ .gt-priority-pick-visual {
    background: var(--gt-surface);
    box-shadow: 0 1px 3px oklch(0.2 0.01 60 / 0.12);
    color: var(--gt-ink);
}

.gt-ticket-submit-btn {
    height: 56px;
    border-radius: 18px;
    border: 0;
    background: var(--gt-ink);
    color: oklch(0.98 0.004 80);
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: background .2s;
    box-shadow: 0 10px 30px -12px oklch(0.22 0.01 60 / 0.6);
    width: 100%;
}

.gt-ticket-submit-btn:hover {
    background: var(--gt-accent);
}

.gt-ticket-form-error {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: oklch(0.55 0.19 25);
    padding: 0 8px;
}

/* ---------- Шаблоны писем ---------- */

.gt-var-chip {
    font-family: var(--gt-font-mono);
    font-size: 12px;
    padding: 1px 7px;
    margin: 0 1px;
    border-radius: 6px;
    background: oklch(0.94 0.03 42);
    color: oklch(0.48 0.14 42);
    white-space: nowrap;
}

.gt-template-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    flex-shrink: 0;
    background: oklch(0.94 0.03 42);
    color: oklch(0.48 0.14 42);
    display: grid;
    place-items: center;
}

.gt-template-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .gt-template-edit-grid {
        grid-template-columns: 1fr;
    }
}

.gt-template-edit-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 140px;
}

.gt-var-insert-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 40px;
    padding: 0 10px 0 12px;
    border-radius: 12px;
    border: 1px solid var(--gt-border);
    background: oklch(0.985 0.003 75);
    cursor: pointer;
    font: inherit;
    color: inherit;
    width: 100%;
}

.gt-var-insert-btn:hover {
    border-color: var(--gt-accent);
    background: oklch(0.975 0.015 42);
}

.gt-var-insert-token {
    font-family: var(--gt-font-mono);
    font-size: 12px;
    color: oklch(0.48 0.14 42);
}

.gt-preview-card {
    overflow: hidden;
}

.gt-preview-head {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gt-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gt-preview-head .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gt-accent);
}

.gt-preview-body {
    padding: 18px 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: oklch(0.985 0.003 75);
}

.gt-preview-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gt-preview-brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--gt-accent);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.gt-preview-brand-icon .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: oklch(0.99 0.005 80);
}

.gt-preview-subject {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.gt-preview-content {
    font-size: 14px;
    line-height: 1.6;
    color: oklch(0.3 0.01 60);
}

/* ---------- Кастомный выпадающий список (замена нативного <select>) ----------
   Нативный <select> нельзя стилизовать кроссбраузерно (ни радиус, ни тень,
   ни шрифт открытого списка — это рисует ОС/браузер). Поэтому сам <select>
   прячем (но оставляем в DOM под тем же name — он по-прежнему участвует в
   отправке формы), а поверх строим свою кнопку-триггер и свою панель
   вариантов на чистом JS (см. custom_select.js). Для уже существующих
   "чипов" (gt-avatar-select-chip/gt-form-select-chip) сама кнопка — это
   сам чип, его визуал не меняется, меняется только то, что открывается
   по клику. */

.gt-select-native {
    display: none !important;
}

.gt-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    background-image: none !important;
    appearance: none;
    -webkit-appearance: none;
}

.gt-select-trigger-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gt-select-trigger-chevron {
    flex-shrink: 0;
    color: oklch(0.5 0.01 60);
    transition: transform .15s;
}

.gt-select-trigger[aria-expanded="true"] .gt-select-trigger-chevron,
.gt-avatar-select-chip[aria-expanded="true"] .gt-form-select-chevron,
.gt-form-select-chip[aria-expanded="true"] .gt-form-select-chevron {
    transform: rotate(180deg);
}

.gt-avatar-select-chip,
.gt-form-select-chip {
    cursor: pointer;
}

.gt-select-panel {
    position: fixed;
    z-index: 1200;
    overflow-y: auto;
    padding: 6px;
    background: var(--gt-surface);
    border: 1px solid var(--gt-border);
    border-radius: var(--gt-radius-lg);
    box-shadow: 0 30px 80px -24px oklch(0.2 0.01 60 / 0.3), 0 2px 6px oklch(0.2 0.01 60 / 0.06);
}

.gt-select-option {
    padding: 9px 12px;
    border-radius: var(--gt-radius-md);
    font-size: 14px;
    color: var(--gt-ink);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gt-select-option.is-active {
    background: oklch(0.95 0.005 70);
}

.gt-select-option.is-selected {
    font-weight: 600;
}

.gt-select-option.is-selected::after {
    content: '✓';
    float: right;
    color: var(--gt-accent-strong);
}

.gt-select-option.is-disabled {
    color: oklch(0.72 0.01 60);
    cursor: default;
}
