/* =====================================================================
   Killbot-group — дизайн-система. Светлая градиентная тема.
   Палитра: белый, оттенки графита (#0f172a…#94a3b8), синий (#2563eb).
   ===================================================================== */

:root {
    --c-bg: #f4f7fc;
    --c-surface: #ffffff;
    --c-surface-2: #f8fafd;
    --c-border: #e4eaf4;
    --c-border-focus: #93b4f5;

    --c-text: #0f172a;
    --c-text-2: #475569;
    --c-text-3: #94a3b8;

    --c-primary: #2563eb;
    --c-primary-2: #4f8cff;
    --c-primary-dark: #1e4fc2;
    --c-primary-soft: #eaf1ff;

    --c-success: #16a34a;
    --c-success-soft: #e8f8ee;
    --c-warning: #d97706;
    --c-warning-soft: #fdf3e3;
    --c-danger: #dc2626;
    --c-danger-soft: #fdecec;
    --c-info-soft: #eaf4ff;

    --grad-primary: linear-gradient(135deg, #2563eb 0%, #4f8cff 55%, #6aa6ff 100%);
    --grad-page: radial-gradient(1200px 500px at 85% -10%, #dfeaff 0%, transparent 60%),
                 radial-gradient(900px 420px at -10% 110%, #e7efff 0%, transparent 55%),
                 linear-gradient(180deg, #f6f9ff 0%, #f2f5fb 100%);
    --grad-card-top: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);

    --shadow-1: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(37, 99, 235, .06);
    --shadow-2: 0 4px 12px rgba(15, 23, 42, .08), 0 12px 40px rgba(37, 99, 235, .10);
    --shadow-3: 0 12px 28px rgba(15, 23, 42, .14), 0 24px 64px rgba(37, 99, 235, .14);

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;

    --sidebar-w: 264px;
    --header-h: 64px;

    --t-fast: .16s ease;
    --t-med: .28s cubic-bezier(.4, 0, .2, 1);

    --font: 'Inter', 'SF Pro Display', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* --------------------------- Reset / база --------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--c-text);
    background: var(--grad-page);
    background-attachment: fixed;
    min-height: 100vh;
}
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; }
h1 { font-size: 24px; letter-spacing: -.02em; }
h2 { font-size: 19px; letter-spacing: -.015em; }
h3 { font-size: 16px; }
p { margin: 0 0 1em; }
a { color: var(--c-primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-primary-dark); }
img, svg { vertical-align: middle; }

::selection { background: rgba(37, 99, 235, .18); }

.icon { width: 20px; height: 20px; flex: 0 0 auto; transition: transform var(--t-fast), filter var(--t-fast); }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

/* ------------------------------ Каркас ------------------------------ */
.layout { display: flex; min-height: 100vh; }

.main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    transition: margin var(--t-med);
}
.content { padding: 26px 30px 44px; flex: 1; width: 100%; max-width: 1340px; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-head p { color: var(--c-text-2); margin: 4px 0 0; }

/* ------------------------------ Sidebar ------------------------------ */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(195deg, #0d1830 0%, #122448 58%, #16306a 100%);
    color: #dbe6ff;
    display: flex;
    flex-direction: column;
    z-index: 60;
    transition: transform var(--t-med);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 22px 18px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.01em;
}
.sidebar-brand .brand-badge {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: var(--grad-primary);
    display: grid;
    place-items: center;
    box-shadow: 0 6px 18px rgba(79, 140, 255, .45);
}
.sidebar-brand .brand-badge svg { stroke: #fff; }
.sidebar-brand small { display: block; font-size: 11px; font-weight: 500; color: #8da6d8; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px 20px; scrollbar-width: thin; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #7d96c9; padding: 18px 12px 7px; }

.nav-item { margin-bottom: 2px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10.5px 12px;
    border-radius: var(--r-md);
    color: #c4d4f6;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast);
}
.nav-link .icon { stroke: currentColor; opacity: .85; }
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link.active {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .4);
}
.nav-link.active .icon { opacity: 1; }
.nav-link .nav-caret { margin-left: auto; transition: transform var(--t-fast); }
.nav-item.open > .nav-link .nav-caret { transform: rotate(180deg); }

.nav-sub { list-style: none; margin: 2px 0 4px; padding: 0 0 0 44px; display: none; }
.nav-item.open > .nav-sub { display: block; }
.nav-sub a {
    display: block;
    padding: 7px 10px;
    border-radius: var(--r-sm);
    color: #a9bfe9;
    font-size: 13.5px;
    transition: background var(--t-fast), color var(--t-fast);
}
.nav-sub a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-sub a.active { color: #fff; font-weight: 600; }

/* ------------------------------ Header ------------------------------ */
.header {
    height: var(--header-h);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header .burger {
    display: none;
    background: none;
    border: 0;
    padding: 8px;
    cursor: pointer;
    border-radius: var(--r-sm);
}
.header .burger:hover { background: var(--c-surface-2); }
.header-info { color: var(--c-text-3); font-size: 13px; }
.header-spacer { flex: 1; }

.header-user { position: relative; }
.header-user-btn {
    display: flex;
    align-items: center;
    gap: 11px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 6px 10px 6px 6px;
    border-radius: 50px;
    transition: background var(--t-fast);
    font: inherit;
}
.header-user-btn:hover { background: var(--c-surface-2); }
.avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 650;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}
.header-user-name { text-align: left; line-height: 1.25; }
.header-user-name b { display: block; font-size: 13.5px; }
.header-user-name span { font-size: 12px; color: var(--c-text-3); }

.dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 210px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    padding: 6px;
    z-index: 80;
}
.dropdown a, .dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    background: none;
    border-radius: var(--r-sm);
    color: var(--c-text);
    font: inherit;
    cursor: pointer;
    text-align: left;
    transition: background var(--t-fast);
}
.dropdown a:hover, .dropdown button:hover { background: var(--c-surface-2); }
.dropdown .danger { color: var(--c-danger); }
.dropdown hr { border: 0; border-top: 1px solid var(--c-border); margin: 5px 8px; }

.impersonation-bar {
    background: linear-gradient(90deg, #b45309, #d97706);
    color: #fff;
    font-size: 13.5px;
    padding: 8px 30px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.impersonation-bar button {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    border: 0;
    padding: 5px 14px;
    border-radius: 50px;
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    transition: background var(--t-fast);
}
.impersonation-bar button:hover { background: rgba(255, 255, 255, .3); }

/* ------------------------------ Карточки ------------------------------ */
.card {
    background: var(--grad-card-top);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    padding: 22px 24px;
    transition: box-shadow var(--t-med), transform var(--t-med);
}
.card + .card { margin-top: 18px; }
.card-hover:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}
.card-head h2, .card-head h3 { margin: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat-card { display: flex; align-items: center; gap: 16px; }
.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    background: var(--c-primary-soft);
    flex: 0 0 auto;
}
.stat-card:hover .stat-icon .icon { transform: scale(1.12) rotate(-4deg); }
.stat-value { font-size: 25px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { color: var(--c-text-3); font-size: 12.5px; margin-top: 3px; }

/* ------------------------------ Кнопки ------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--t-fast);
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}
.btn .icon { width: 17px; height: 17px; stroke: currentColor; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(37, 99, 235, .48); filter: brightness(1.05); }

.btn-secondary {
    background: var(--c-surface);
    border-color: var(--c-border);
    color: var(--c-text);
    box-shadow: var(--shadow-1);
}
.btn-secondary:hover { border-color: var(--c-border-focus); background: var(--c-surface-2); }

.btn-danger { background: var(--c-danger); color: #fff; box-shadow: 0 4px 14px rgba(220, 38, 38, .3); }
.btn-danger:hover { filter: brightness(1.08); }

.btn-ghost { background: transparent; color: var(--c-text-2); }
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }

.btn-sm { padding: 6.5px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-icon { padding: 8px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

.btn .spinner { display: none; }
.btn.loading { pointer-events: none; opacity: .8; }
.btn.loading .spinner { display: inline-block; }

.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------ Формы ------------------------------ */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-2);
    margin-bottom: 6px;
}
.form-label .req { color: var(--c-danger); }
.form-hint { font-size: 12px; color: var(--c-text-3); margin-top: 5px; }

.form-control {
    width: 100%;
    padding: 10.5px 14px;
    font: inherit;
    color: var(--c-text);
    background: var(--c-surface);
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-md);
    transition: border var(--t-fast), box-shadow var(--t-fast);
    outline: none;
}
.form-control:hover { border-color: #d4dff0; }
.form-control:focus {
    border-color: var(--c-primary-2);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.form-control::placeholder { color: var(--c-text-3); }
textarea.form-control { resize: vertical; min-height: 92px; }

.form-group.has-error .form-control { border-color: var(--c-danger); box-shadow: 0 0 0 4px rgba(220, 38, 38, .1); }
.form-error { display: none; font-size: 12px; color: var(--c-danger); margin-top: 5px; }
.form-group.has-error .form-error { display: block; animation: shake .3s; }
@keyframes shake {
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }

/* Checkbox и switch */
.checkbox, .switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.checkbox input, .switch input { position: absolute; opacity: 0; }
.checkbox .box {
    width: 20px; height: 20px;
    border: 1.5px solid var(--c-border);
    border-radius: 6px;
    background: var(--c-surface);
    display: grid;
    place-items: center;
    transition: all var(--t-fast);
}
.checkbox .box svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; opacity: 0; transform: scale(.4); transition: all var(--t-fast); }
.checkbox input:checked + .box { background: var(--grad-primary); border-color: var(--c-primary); }
.checkbox input:checked + .box svg { opacity: 1; transform: scale(1); }

.switch .track {
    width: 42px; height: 24px;
    border-radius: 50px;
    background: #d8e0ef;
    position: relative;
    transition: background var(--t-med);
    flex: 0 0 auto;
}
.switch .track::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .25);
    transition: transform var(--t-med);
}
.switch input:checked + .track { background: var(--grad-primary); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* Range slider */
.range { width: 100%; appearance: none; height: 6px; border-radius: 6px;
    background: linear-gradient(90deg, var(--c-primary) var(--range-fill, 50%), #dbe4f3 var(--range-fill, 50%)); outline: none; }
.range::-webkit-slider-thumb {
    appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid var(--c-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, .35);
    cursor: grab;
    transition: transform var(--t-fast);
}
.range::-webkit-slider-thumb:hover { transform: scale(1.15); }

/* ------------------------------ Таблицы ------------------------------ */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--c-text-3);
    font-weight: 600;
    padding: 10px 14px;
    border-bottom: 1.5px solid var(--c-border);
    white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--c-primary-soft); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .actions .btn-icon .icon { width: 15px; height: 15px; }

/* ------------------------------ Бейджи ------------------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 50px;
    line-height: 1.4;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--c-success-soft); color: var(--c-success); }
.badge-warning { background: var(--c-warning-soft); color: var(--c-warning); }
.badge-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.badge-info { background: var(--c-info-soft); color: var(--c-primary); }
.badge-muted { background: #eef2f8; color: var(--c-text-3); }

/* ------------------------------ Табы ------------------------------ */
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--c-border); margin-bottom: 20px; overflow-x: auto; }
.tab {
    padding: 10px 18px;
    font-weight: 600;
    font-size: 14px;
    color: var(--c-text-3);
    border: 0;
    background: none;
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px;
    transition: color var(--t-fast), border-color var(--t-fast);
    white-space: nowrap;
    font-family: inherit;
}
.tab:hover { color: var(--c-text); }
.tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.tab-pane { display: none; animation: fadeUp .25s ease; }
.tab-pane.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }

/* ------------------------------ Прогресс ------------------------------ */
.progress { height: 8px; background: #e4eaf6; border-radius: 50px; overflow: hidden; }
.progress-bar {
    height: 100%;
    background: var(--grad-primary);
    border-radius: 50px;
    transition: width .6s cubic-bezier(.4, 0, .2, 1);
    position: relative;
}
.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    animation: shimmer 1.8s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ------------------------------ Таймлайн ------------------------------ */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
    content: '';
    position: absolute;
    left: 9px; top: 6px; bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--c-primary-2), var(--c-border));
}
.timeline li { position: relative; padding: 0 0 18px 34px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .dot {
    position: absolute;
    left: 0; top: 4px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--c-surface);
    border: 2.5px solid var(--c-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.timeline .time { font-size: 12px; color: var(--c-text-3); }

/* ------------------------------ Модалки ------------------------------ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(13, 24, 48, .45);
    backdrop-filter: blur(4px);
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-med);
}
.modal-backdrop.show { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--c-surface);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-3);
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    transform: translateY(18px) scale(.97);
    transition: transform var(--t-med);
}
.modal-backdrop.show .modal { transform: none; }
.modal-lg { max-width: 720px; }
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close { background: none; border: 0; padding: 6px; cursor: pointer; border-radius: var(--r-sm); color: var(--c-text-3); }
.modal-close:hover { background: var(--c-surface-2); color: var(--c-text); }
.modal-body { padding: 18px 24px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 22px; }

/* ------------------------------ Тосты ------------------------------ */
.toast-stack {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 44px));
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    padding: 14px 16px;
    transform: translateX(calc(100% + 30px));
    transition: transform .38s cubic-bezier(.21, 1.02, .55, 1.01), opacity .3s;
    position: relative;
    overflow: hidden;
}
.toast.show { transform: none; }
.toast.hide { opacity: 0; transform: translateX(40px); }
.toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.toast-info::before { background: var(--grad-primary); }
.toast-success::before { background: linear-gradient(180deg, #16a34a, #4ade80); }
.toast-error::before { background: linear-gradient(180deg, #dc2626, #f87171); }
.toast-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.toast-info .toast-icon { background: var(--c-info-soft); }
.toast-success .toast-icon { background: var(--c-success-soft); }
.toast-error .toast-icon { background: var(--c-danger-soft); }
.toast-icon svg { width: 18px; height: 18px; }
.toast-info .toast-icon svg { stroke: var(--c-primary); }
.toast-success .toast-icon svg { stroke: var(--c-success); }
.toast-error .toast-icon svg { stroke: var(--c-danger); }
.toast-body b { display: block; font-size: 13.5px; margin-bottom: 1px; }
.toast-body p { margin: 0; font-size: 13px; color: var(--c-text-2); }
.toast-close { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--c-text-3); padding: 2px; }

/* ------------------------------ Tom Select ------------------------------ */
.ts-wrapper .ts-control {
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 9.5px 14px;
    font: inherit;
    background: var(--c-surface);
    box-shadow: none;
    transition: border var(--t-fast), box-shadow var(--t-fast);
}
.ts-wrapper.focus .ts-control {
    border-color: var(--c-primary-2);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.ts-dropdown {
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    font: inherit;
    margin-top: 6px;
    overflow: hidden;
}
.ts-dropdown .option { padding: 9px 14px; }
.ts-dropdown .active { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.ts-wrapper.multi .ts-control > .item {
    background: var(--c-primary-soft);
    color: var(--c-primary-dark);
    border-radius: 7px;
    padding: 3px 9px;
    font-weight: 500;
}

/* ------------------------------ Утилиты ------------------------------ */
.muted { color: var(--c-text-3); }
.text-2 { color: var(--c-text-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; align-items: center; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.right { margin-left: auto; }
.center { text-align: center; }
.w-100 { width: 100%; }

.empty-state { text-align: center; padding: 46px 20px; color: var(--c-text-3); }
.empty-state .icon { width: 52px; height: 52px; opacity: .5; margin-bottom: 12px; }

/* ------------------------------ Адаптив ------------------------------ */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    .sidebar.open { transform: none; box-shadow: var(--shadow-3); }
    .main { margin-left: 0; }
    .header .burger { display: block; }
    .sidebar-overlay {
        position: fixed; inset: 0;
        background: rgba(13, 24, 48, .4);
        z-index: 55;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--t-med);
    }
    .sidebar.open ~ .sidebar-overlay { opacity: 1; pointer-events: auto; }
}
@media (max-width: 640px) {
    .content { padding: 18px 16px 36px; }
    .header { padding: 0 16px; }
    .header-info { display: none; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .card { padding: 18px 16px; }
    .page-head { margin-bottom: 16px; }
    h1 { font-size: 20px; }
    .header-user-name { display: none; }
    .modal-foot { flex-wrap: wrap; }
    .modal-foot .btn { flex: 1; }
}
