/*
 * TRAFFIC TRACKER – NEO ANALYTICS THEME (v1.0)
 * УНИКАЛЬНЫЙ ПРОФЕССИОНАЛЬНЫЙ ДИЗАЙН
 */

/* --- 1. :ROOT (ПАЛИТРА, ТИПОГРАФИКА, ТЕНИ) --- */
:root {
    /* Базовый фон и поверхности */
    --color-bg-main: #f5f5f7;
    /* общий фон */
    --color-bg-surface-soft: #eeeff3;
    --color-bg-card: #ffffff;
    /* карты и формы */

    /* Сайдбар / бренд */
    --color-bg-sidebar: #020617;
    /* почти чёрный, без синевы */
    --color-bg-sidebar-soft: #020617;
    --color-primary: #4f46e5;
    /* индиго */
    --color-primary-soft: rgba(79, 70, 229, 0.08);
    --color-primary-strong: #312e81;
    --color-accent: #22c55e;
    /* неоновый лайм для мелких акцентов */

    /* Текст */
    --color-text-primary: #111827;
    --color-text-secondary: #4b5563;
    --color-text-muted: #9ca3af;
    --color-text-light: #6b7280;
    --color-text-white: #f9fafb;
    --color-text-sidebar: #d1d5db;
    --color-text-sidebar-dim: #6b7280;

    /* Границы и разделители (чёткие, но не грубые) */
    --color-border: #d4d4dc;
    --color-border-strong: #b4b4c4;
    --color-border-light: #e4e4ec;

    /* Статусы */
    --color-success: #15803d;
    --color-success-bg: #ecfdf3;
    --color-error: #b91c1c;
    --color-error-bg: #fef2f2;
    --color-warning: #b45309;
    --color-warning-bg: #fffbeb;

    /* Статусы для pills */
    --color-status-geo: #0369a1;
    --color-status-mobile: #0f766e;
    --color-status-render: #15803d;
    --color-status-redirect: #b45309;
    --color-status-iframe: #b91c1c;

    /* Тени – «дорогой» софт-шэдо */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.08);
    --shadow: 0 10px 25px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);

    /* Фокус */
    --ring-color-primary: rgba(79, 70, 229, 0.26);

    /* Радиусы */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* Шрифт */
    --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Скроллбар */
    --scrollbar-track: #e5e7eb;
    --scrollbar-thumb: #9ca3af;
}

/* --- 2. БАЗА / ГЛОБАЛЬНОЕ --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at top left, #e5e7eb 0, #f5f5f7 45%, #e5e7eb 100%);
    color: var(--color-text-secondary);
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

/* Кастомный скроллбар */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 999px;
}

/* --- 3. ЛЕЙАУТ АДМИНКИ --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* --- 4. САЙДБАР --- */
.sidebar {
    width: 250px;
    background:
        radial-gradient(circle at top, rgba(34, 197, 94, 0.12), transparent 55%),
        var(--color-bg-sidebar);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(55, 65, 81, 0.8);
    box-shadow: 14px 0 35px -30px rgba(15, 23, 42, 0.9);
    position: relative;
    z-index: 20;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    padding: 16px 18px 14px;
    height: 66px;
    color: var(--color-text-white);
    border-bottom: 1px solid rgba(75, 85, 99, 0.8);
}

.sidebar-logo-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: rgba(34, 197, 94, 0.14);
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.sidebar-nav {
    padding: 14px 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-section-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(148, 163, 184, 0.7);
    padding: 8px 12px 4px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--color-text-sidebar);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    stroke: var(--color-text-sidebar-dim);
    flex-shrink: 0;
    transition: stroke 0.18s ease, transform 0.12s ease;
}

.nav-item::before {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: border-color 0.18s ease;
}

.nav-item:hover {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.28), rgba(15, 23, 42, 0.9));
    color: var(--color-text-white);
    transform: translateX(1px);
    box-shadow: 0 10px 24px -18px rgba(79, 70, 229, 0.8);
}

.nav-item:hover svg {
    stroke: var(--color-text-white);
    transform: translateX(1px);
}

.nav-item:hover::before {
    border-color: rgba(129, 140, 248, 0.65);
}

.nav-item.active {
    background: linear-gradient(90deg, #4f46e5, #22c55e);
    color: var(--color-text-white);
    box-shadow: 0 16px 40px -20px rgba(79, 70, 229, 0.95);
}

.nav-item.active svg {
    stroke: var(--color-text-white);
}

.nav-item.active::before {
    border-color: rgba(250, 250, 255, 0.18);
}

/* --- 5. ХЕДЕР --- */
.main-header {
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: rgba(248, 250, 252, 0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(209, 213, 219, 0.9);
    z-index: 15;
    position: sticky;
    top: 0;
}

.header-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.header-title h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: 0.01em;
}

.header-title-sub {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user span {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: conic-gradient(from 180deg, #22c55e, #4f46e5, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-white);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 0 0 2px #f9fafb;
}

.logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 999px;
    color: var(--color-text-muted);
    border: 1px solid transparent;
    transition: all 0.18s ease;
}

.logout-link svg {
    width: 18px;
    height: 18px;
}

.logout-link:hover {
    color: var(--color-error);
    background-color: #fef2f2;
    border-color: rgba(248, 113, 113, 0.4);
}

/* --- 6. ОСНОВНОЙ КОНТЕНТ / КАРТЫ --- */
.main-content {
    flex-grow: 1;
    padding: 24px 26px 30px;
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .main-content {
        padding: 18px 16px 24px;
    }
}

.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    padding: 20px 22px 22px;
    margin-bottom: 22px;
    position: relative;
}

.card h3 {
    margin: 0 0 18px 0;
    padding-bottom: 12px;
    color: var(--color-text-primary);
    font-size: 1.02rem;
    font-weight: 600;
    border-bottom: 1px solid var(--color-border-light);
}

/* --- 6.1. KPI / СТАТИСТИКА (РОВНАЯ ВЁРСТКА) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}

.card-kpi {
    padding: 12px 13px 13px;
    border-radius: 12px;
    border: 1px solid var(--color-border-light);
    background: linear-gradient(145deg, #f9fafb, #eff1f5);
    box-shadow: var(--shadow-xs);
}

.card-kpi-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-text-muted);
}

.card-metric {
    margin-top: 4px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
}

.card-kpi-sub {
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--color-text-light);
}

/* --- 6.2. ГРИД ДЛЯ ГРАФИКОВ  (70/30, БЕЗ КРИВИЗНЫ) --- */
.dashboard-grid-charts {
    display: grid;
    grid-template-columns: 2.3fr 1fr;
    gap: 18px;
    align-items: stretch;
}

@media (max-width: 1100px) {
    .dashboard-grid-charts {
        grid-template-columns: 1fr;
    }
}

#line-chart-container,
#donut-chart-container {
    width: 100%;
    min-height: 320px;
}

/* Топ-листы / дополнительные блоки */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

/* --- 7. КНОПКИ / ТУЛБАР --- */
.toolbar {
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 15px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.16s ease;
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    background: transparent;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #22c55e);
    color: var(--color-text-white);
    border-color: transparent;
}

.btn-primary:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

.btn-secondary {
    background-color: #f9fafb;
    color: var(--color-text-secondary);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background-color: #eef2ff;
    border-color: var(--color-border-strong);
}

.btn-action {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-primary);
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.btn-action:hover {
    text-decoration: underline;
}

.btn-delete {
    color: var(--color-error);
    margin-left: 8px;
}

/* --- 8. ФОРМЫ --- */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border-light);
}

.form-header h3 {
    margin: 0;
    border: none;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
}

.form-group {
    display: flex;
    flex-direction: column;
}

/* --- ИСПРАВЛЕНИЕ ОТСТУПОВ --- */
/* Стандартный отступ для вертикальных форм */
.form-group+.form-group {
    margin-top: 10px;
}

/* ОТМЕНА отступа, если форма внутри Grid-сетки */
[class*="form-grid"]>.form-group+.form-group {
    margin-top: 0;
}

/* ---------------------------- */

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text-primary);
}

.form-group small {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: -2px;
    margin-bottom: 6px;
    min-height: 1.1em;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.93rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background-color: #ffffff;
    color: var(--color-text-primary);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    font-family: var(--font-family);
}

.form-group textarea {
    min-height: 110px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--ring-color-primary);
    outline: none;
}

/* Сетки форм */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px 20px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 20px;
}

.form-grid-2 .form-group-span-2 {
    grid-column: span 2;
}

.form-grid-4 .form-group-span-1 {
    grid-column: span 1;
}

.form-grid-4 .form-group-span-2 {
    grid-column: span 2;
}

.form-grid-4 .form-group-span-3 {
    grid-column: span 3;
}

.form-grid-4 .form-group-span-4 {
    grid-column: span 4;
}

@media (max-width: 960px) {

    .form-grid-2,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }

    .form-grid-2 .form-group-span-2,
    .form-grid-4 .form-group-span-2,
    .form-grid-4 .form-group-span-3,
    .form-grid-4 .form-group-span-4 {
        grid-column: span 1;
    }
}

.form-actions {
    grid-column: 1 / -1;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border-light);
    text-align: right;
}

/* --- 9. ТАБЛИЦЫ --- */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    background: var(--color-bg-card);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.88rem;
    vertical-align: middle;
    white-space: nowrap;
    text-align: left;
}

table th {
    background: linear-gradient(180deg, #f9fafb, #eff1f5);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

table td {
    color: var(--color-text-secondary);
}

/* "Зебра" */
table.table-striped tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

table tbody tr:hover {
    background-color: #eef2ff;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* --- ИСПРАВЛЕНИЕ ЦВЕТА БЛОКА --- */
/* Раньше был красный, теперь - светло-серый */
tr.click-row-blocked {
    background-color: #FFCCCB !important;
}

tr.click-row-blocked:hover {
    background-color: #FFCCCB !important;
}

/* -------------------------------- */

.td-url {
    max-width: 260px;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.84rem;
    color: var(--color-text-light);
    line-height: 1.4;
}

.td-url a {
    color: var(--color-text-secondary);
    text-decoration: none;
}

.td-url a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* --- 10. СТАТУСЫ (PILLS) --- */
.status-active,
.status-paused,
.status-geo,
.status-device,
.status-mobile,
.status-desktop,
.status-render,
.status-redirect,
.status-iframe {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
}

.status-active {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.status-paused {
    background: var(--color-border-light);
    color: var(--color-text-muted);
}

.status-geo {
    background: rgba(59, 130, 246, 0.08);
    color: var(--color-status-geo);
}

.status-mobile,
.status-desktop {
    background: rgba(45, 212, 191, 0.12);
    color: var(--color-status-mobile);
}

.status-render {
    background: var(--color-success-bg);
    color: var(--color-status-render);
}

.status-redirect {
    background: var(--color-warning-bg);
    color: var(--color-status-redirect);
}

.status-iframe {
    background: var(--color-error-bg);
    color: var(--color-status-iframe);
}

/* --- 11. ЛОГИН --- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
    background: radial-gradient(circle at top, #e5e7eb, #f5f5f7 40%, #e5e7eb 100%);
    }

    .login-card {
        position: relative;
        max-width: 380px;
        width: 100%;
        padding: 28px 26px 24px;
        border-radius: 18px;
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-lg);
        overflow: hidden;
    }

    .login-card::before {
        content: "";
        position: absolute;
        inset: -30%;
        background:
            radial-gradient(circle at top left, rgba(79, 70, 229, 0.18), transparent 55%),
            radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.22), transparent 55%);
        opacity: 0.9;
        pointer-events: none;
    }

    .login-card-inner {
        position: relative;
        z-index: 1;
    }

    .login-card h2 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--color-text-primary);
    }

    .login-subtitle {
        margin-top: 4px;
        font-size: 0.9rem;
        color: var(--color-text-light);
    }

    .login-card form {
        margin-top: 18px;
    }

    .login-card .form-group {
        margin-bottom: 14px;
    }

    .btn-login {
        width: 100%;
        margin-top: 16px;
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    .login-error {
        margin-bottom: 12px;
        padding: 10px 12px;
        border-radius: var(--radius-sm);
        background: var(--color-error-bg);
        border: 1px solid var(--color-error);
        color: var(--color-error);
        font-size: 0.86rem;
        font-weight: 500;
    }

    /* --- 12. ALERTS --- */
    .alert {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        padding: 11px 14px;
        border-radius: var(--radius-sm);
        border: 1px solid;
        font-size: 0.9rem;
        font-weight: 500;
        margin-bottom: 16px;
    }

    .alert::before {
        content: "";
        width: 6px;
        height: 6px;
        margin-top: 5px;
        border-radius: 999px;
        flex-shrink: 0;
    }

    .alert-error {
        background: var(--color-error-bg);
        border-color: rgba(185, 28, 28, 0.7);
        color: var(--color-error);
    }

    .alert-error::before {
        background: var(--color-error);
    }

    .alert-success {
        background: var(--color-success-bg);
        border-color: rgba(21, 128, 61, 0.7);
        color: var(--color-success);
    }

    .alert-success::before {
        background: var(--color-success);
    }

    /* --- 13. РўРђР‘Р« Р¤РР›Р¬РўР РћР’ / РџРђР“РРќРђР¦РРЇ --- */
    .filter-tabs-nav {
        display: flex;
        gap: 4px;
        border-bottom: 1px solid var(--color-border);
        margin-bottom: 14px;
        flex-wrap: wrap;
    }

    .tab-nav-item {
        padding: 8px 14px;
        font-size: 0.86rem;
        font-weight: 500;
        color: var(--color-text-muted);
        cursor: pointer;
        border: none;
        background: transparent;
        border-radius: 8px 8px 0 0;
        border-bottom: 2px solid transparent;
        margin-bottom: -1px;
        transition: all 0.16s ease;
    }

    .tab-nav-item:hover {
        color: var(--color-primary);
        background: #f3f4ff;
    }

    .tab-nav-item.active {
        color: var(--color-primary);
        border-bottom-color: var(--color-primary);
        background: #eef2ff;
        font-weight: 600;
    }

    .tab-content-panel.hidden {
        display: none;
    }

    .tab-content-panel .checkbox-grid {
        max-height: 250px;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        background: var(--color-bg-surface-soft);
    }

    /* РџР°РіРёРЅР°С†РёСЏ */
    .pagination-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .pagination-info {
        font-size: 0.84rem;
        color: var(--color-text-muted);
    }

    .pagination-links {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .pagination-links a,
    .pagination-links span {
        display: inline-block;
        padding: 7px 12px;
        border-radius: 999px;
        border: 1px solid var(--color-border);
        background: var(--color-bg-card);
        font-size: 0.86rem;
        font-weight: 500;
        color: var(--color-text-secondary);
        text-decoration: none;
        transition: all 0.16s ease;
    }

    .pagination-links a:hover {
        background: #eef2ff;
        border-color: var(--color-border-strong);
        color: var(--color-primary);
    }

    .pagination-links span.current {
        background: linear-gradient(135deg, #4f46e5, #22c55e);
        color: var(--color-text-white);
        border-color: transparent;
        box-shadow: var(--shadow-xs);
    }

    .pagination-links span.disabled {
        color: #cbd5e1;
        background: var(--color-bg-main);
        border-color: var(--color-border-light);
    }

    /* --- 14. CHOICES.JS --- */
    .choices {
        font-size: 0.9rem;
        position: relative;
        z-index: 5;
    }

    .choices__inner {
        background: var(--color-bg-card);
        border-radius: var(--radius-sm);
        border: 1px solid var(--color-border);
        font-size: 0.9rem;
        padding: 4px 8px !important;
        box-shadow: var(--shadow-xs);
        transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }

    .is-focused .choices__inner {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px var(--ring-color-primary) !important;
    }

    .choices__list--multiple .choices__item {
        background: #4f46e5;
        border-radius: 999px;
        font-size: 0.8rem;
        font-weight: 500;
        color: #ffffff;
        border: none;
    }

    .choices[data-type*="select-multiple"] .choices__button--remove {
        border-left: 1px solid rgba(255, 255, 255, 0.5);
        margin-left: 8px;
        padding-left: 8px;
    }

    .choices__button--remove svg {
        filter: invert(1) brightness(1.8);
    }

    .choices__list--dropdown {
        background: var(--color-bg-card);
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-lg);
        margin-top: 6px;
    }

    .choices__item--choice {
        padding: 7px 11px;
        font-size: 0.9rem;
        color: var(--color-text-secondary);
    }

    .choices__item--choice.is-highlighted {
        background: #eef2ff;
        color: var(--color-primary);
    }

    .choices__input {
        font-size: 0.9rem;
        background: transparent;
        color: var(--color-text-primary);
    }

    /* --- 15. APEXCHARTS --- */
    .apexcharts-tooltip {
        background: #ffffff !important;
        color: var(--color-text-primary) !important;
        border: 1px solid var(--color-border) !important;
        border-radius: var(--radius-md) !important;
        box-shadow: var(--shadow-lg) !important;
        padding: 8px 10px !important;
    }

    .apexcharts-tooltip-title {
        background: var(--color-bg-surface-soft) !important;
        border-bottom: 1px solid var(--color-border-light) !important;
        font-weight: 600 !important;
        color: var(--color-text-primary) !important;
    }

    .apexcharts-tooltip-text-value,
    .apexcharts-tooltip-text-z-value {
        font-weight: 600 !important;
        font-size: 13px !important;
    }

    /* --- 16. Р”Р РћРџР”РђРЈРќ "Р”Р•Р™РЎРўР’РРЇ" Р’ РўРђР‘Р›РР¦Р• --- */
    .td-actions {
        text-align: center;
        padding: 6px 10px;
        position: relative;
        white-space: nowrap;
    }

    .actions-dropdown {
        position: relative;
        display: inline-block;
    }

    .actions-toggle-btn {
        background: transparent;
        border-radius: 999px;
        border: 1px solid transparent;
        color: var(--color-text-muted);
        padding: 4px 7px;
        cursor: pointer;
        transition: all 0.16s ease;
    }

    .actions-toggle-btn svg {
        width: 16px;
        height: 16px;
    }

    .actions-toggle-btn:hover {
        background: #eef2ff;
        border-color: var(--color-border-light);
        color: var(--color-text-primary);
    }

    /* Р‘Р°Р·РѕРІРѕРµ РјРµРЅСЋ */
    .actions-menu {
        display: none;
        position: absolute;
        right: 0;
        top: calc(100% + 6px);
        min-width: 210px;
        background: var(--color-bg-card);
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-lg);
        padding: 4px;
        z-index: 100;
        animation: fadeInMenu 0.12s ease-out;
    }

    .actions-menu.show {
        display: block;
    }

    @keyframes fadeInMenu {
        from {
            opacity: 0;
            transform: translateY(-4px) scale(0.98);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .actions-menu-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 7px 9px;
        border-radius: var(--radius-sm);
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--color-text-secondary);
        text-decoration: none;
        transition: background 0.14s ease, color 0.14s ease;
    }

    .actions-menu-item svg {
        width: 16px;
        height: 16px;
        stroke: var(--color-text-muted);
    }

    .actions-menu-item:hover {
        background: #eef2ff;
        color: var(--color-text-primary);
    }

    .actions-menu-item:hover svg {
        stroke: var(--color-primary);
    }

    .actions-menu-item.delete {
        color: var(--color-error);
    }

    .actions-menu-item.delete:hover {
        background: var(--color-error-bg);
        color: var(--color-error);
    }

    .actions-menu-item.delete:hover svg {
        stroke: var(--color-error);
    }

    .actions-menu-divider {
        height: 1px;
        background: var(--color-border-light);
        margin: 4px 0;
    }

    /* РћС‚РєСЂРµРїР»С‘РЅРЅРѕРµ РјРµРЅСЋ РЅР°Рґ С‚Р°Р±Р»РёС†РµР№ (fix overflow) */
    .actions-menu.is-detached {
        position: fixed;
        display: block;
        z-index: 1000;
        background: #ffffff;
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border);
        box-shadow: var(--shadow-lg);
        min-width: 210px;
        padding: 4px;
        margin: 0;
    }

    /* --- 12. ГЛОБАЛЬНЫЕ МОДАЛЬНЫЕ ОКНА И NOFICATIONS --- */
    /* (Добавлено для consistency UI) */

    /* Стили для модального окна */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }


    /* --- 12. UI NOTIFICATIONS & MODALS (Premium Dark) --- */

    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        /* Темнее для контраста */
        backdrop-filter: blur(6px);
        /* Сильнее блюр */
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .modal-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .modal-content {
        background: #1e293b;
        /* Dark Slate Background */
        border-radius: var(--radius-lg);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        /* Deep Shadow */
        width: 100%;
        max-width: 420px;
        transform: translateY(20px) scale(0.95);
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        border: 1px solid rgba(255, 255, 255, 0.1);
        /* Subtle white border */
    }

    .modal-overlay.open .modal-content {
        transform: translateY(0) scale(1);
    }

    .modal-header {
        padding: 20px 24px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .modal-header h4 {
        margin: 0;
        font-size: 1.15rem;
        font-weight: 600;
        color: #f8fafc;
        /* White text */
        letter-spacing: -0.01em;
    }

    .modal-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #94a3b8;
        cursor: pointer;
        line-height: 1;
        transition: color 0.2s;
    }

    .modal-close:hover {
        color: #ffffff;
    }

    .modal-body {
        padding: 24px;
        color: #cbd5e1;
        /* Light gray text */
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .modal-footer {
        padding: 20px 24px;
        background: rgba(0, 0, 0, 0.2);
        /* Slightly darker footer */
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        border-bottom-left-radius: var(--radius-lg);
        border-bottom-right-radius: var(--radius-lg);
        display: flex;
        justify-content: flex-end;
        gap: 12px;
    }

    /* Modal Buttons */
    .modal-footer .btn {
        border: none;
        font-weight: 500;
    }

    .modal-footer .btn-secondary {
        background: rgba(255, 255, 255, 0.1);
        color: #f1f5f9;
    }

    .modal-footer .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    .modal-footer .btn-danger {
        background: #ef4444;
        color: white;
        box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
    }

    .modal-footer .btn-danger:hover {
        background: #dc2626;
        box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.4);
    }

    /* Helpers */
    .text-error {
        color: #f87171 !important;
    }

    /* Lighter red for dark mode */

    /* TOASTS (Updated) */
    .toast-notification {
        position: fixed;
        bottom: 30px;
        right: 30px;
        background: #0f172a;
        /* Dark toast bg */
        color: #f8fafc;
        padding: 14px 20px;
        border-radius: var(--radius-md);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
        font-weight: 500;
        transform: translateY(100px);
        opacity: 0;
        transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        z-index: 1100;
        border: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .toast-notification.show {
        transform: translateY(0);
        opacity: 1;
    }

    /* Success Toast */
    .toast-notification::before {
        content: '';
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #22c55e;
        box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    }

    /* Error Toast */
    .toast-notification.error::before {
        background: #ef4444;
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    }

    .toast-notification.error {
        background: #1e1b1b;
        /* slightly reddish dark */
    }
