/* ── Базовые стили командного центра (светлая тема) ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #f5f6fa;
    color: #1f2433;
    font-size: 14px;
    line-height: 1.5;
}

/* Навбар */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 0 24px;
    height: 52px;
    border-bottom: 1px solid #e0e4ec;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand { font-size: 16px; font-weight: 600; color: #5a6cf0; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: #5a6275; text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav-links a.active, .nav-links a:hover { color: #1f2433; border-bottom-color: #7c8cf8; }
.nav-user { color: #8a92a8; font-size: 13px; }
.btn-logout { background: #f0e6fa; color: #8050c0 !important; padding: 4px 12px !important; border-radius: 6px; border: none !important; cursor: pointer; }

/* Контейнер */
.container { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* Алерты */
.alert { padding: 10px 16px; border-radius: 6px; margin-bottom: 16px; }
.alert-error { background: #fce8e8; border: 1px solid #f5b8b8; color: #c84444; }
.alert-success { background: #e6f5ec; border: 1px solid #b8e0c8; color: #2e8856; }

/* Страница логина */
.login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
    background: #ffffff;
    border: 1px solid #e0e4ec;
    border-radius: 12px;
    padding: 40px;
    width: 360px;
    box-shadow: 0 4px 20px rgba(30,40,80,0.06);
}
.login-card h1 { font-size: 20px; margin-bottom: 28px; text-align: center; color: #1f2433; }

/* Формы */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: #5a6275; font-size: 13px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 2px solid #b8c0d0;
    color: #1f2433;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color .12s, box-shadow .12s;
}
.form-group input:hover, .form-group select:hover, .form-group textarea:hover {
    border-color: #98a2b8;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #7c8cf8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(124,140,248,0.18);
}

/* Кнопки */
.btn-primary {
    background: #7c8cf8;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.btn-primary:hover { background: #5a6cf0; }
.btn-secondary {
    background: #eef0f7;
    color: #5a6275;
    border: 2px solid #b8c0d0;
    padding: 7px 20px;
    border-radius: 6px;
    cursor: pointer;
}
.btn-secondary:hover { background: #e0e4ec; border-color: #98a2b8; }
.btn-sm {
    padding: 3px 8px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    margin: 0 2px;
}
.btn-pause { background: #fff1dc; color: #b87b1e; }
.btn-start { background: #e6f5ec; color: #2e8856; }
.btn-budget { background: #e8eefb; color: #4060c0; }

/* Фильтр */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 20px; color: #1f2433; }
.filter-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-form input, .filter-form select {
    background: #ffffff;
    border: 2px solid #b8c0d0;
    color: #1f2433;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
}
.filter-form input:hover, .filter-form select:hover { border-color: #98a2b8; }
.filter-form input:focus, .filter-form select:focus { outline: none; border-color: #7c8cf8; box-shadow: 0 0 0 3px rgba(124,140,248,0.18); }

/* Виджеты */
.widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.widget {
    background: #ffffff;
    border: 1px solid #e0e4ec;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(30,40,80,0.04);
}
.widget-cpa { border-color: #b8b8e0; }
.widget-label { font-size: 12px; color: #8a92a8; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.widget-value { font-size: 24px; font-weight: 600; color: #1f2433; }

/* Секции */
.section { margin-bottom: 32px; }
.section h3 { font-size: 16px; color: #2a3148; margin-bottom: 14px; }

/* Таблицы */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    padding: 8px 12px;
    background: #eef0f7;
    color: #5a6275;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 1px solid #d8dde8;
}
.data-table td { padding: 8px 12px; border-bottom: 1px solid #eef0f7; font-size: 13px; }
.data-table tbody tr:hover { background: #f5f6fa; }
.row-error td { color: #c84444; }
.row-warning td { color: #b87b1e; }
.row-success td { color: inherit; }

/* Гипотезы */
.hypothesis-block {
    background: #ffffff;
    border: 1px solid #e0e4ec;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.hypothesis-block h4 { color: #2a3148; margin-bottom: 10px; font-size: 14px; }
.hypothesis-block ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.hypothesis-block li { padding: 8px 12px; background: #f5f6fa; border-radius: 6px; border-left: 3px solid #7c8cf8; }
.hypothesis-block .effect { display: block; color: #2e8856; font-size: 12px; margin-top: 4px; }

/* Модальное окно */
.modal {
    position: fixed; inset: 0;
    background: rgba(30,40,80,0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.modal.hidden { display: none; }
.modal-content {
    background: #ffffff;
    border: 1px solid #e0e4ec;
    border-radius: 12px;
    padding: 28px;
    width: 400px;
    box-shadow: 0 8px 32px rgba(30,40,80,0.18);
}
.modal-content h3 { margin-bottom: 20px; color: #1f2433; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Результат действия */
.action-result {
    display: none;
    margin-top: 12px;
    padding: 10px 14px;
    background: #e8eefb;
    border: 1px solid #c4d2f5;
    border-radius: 6px;
    color: #4060c0;
    font-size: 13px;
}

/* Статусы мониторинга */
.overall-status { font-weight: 600; padding: 4px 12px; border-radius: 6px; }
.status-ok { background: #e6f5ec; color: #2e8856; }
.status-warnings { background: #fff5e6; color: #b87b1e; }
.status-errors { background: #fce8e8; color: #c84444; }

.section-errors { border-left: 3px solid #f5b8b8; padding-left: 16px; }

.widget-error .widget-value { color: #c84444; }
.widget-warning .widget-value { color: #b87b1e; }
.widget-success .widget-value { color: #2e8856; }

.manual-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Дополнительные стили ── */

.count-badge { background: #e8eefb; color: #5a6cf0; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.empty-state { text-align: center; padding: 48px 24px; color: #aab1c2; font-size: 15px; }
.table-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.scroll-table { overflow-x: auto; }
.small-text { font-size: 12px; color: #8a92a8; }
.form-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.run-panel { background: #ffffff; border: 1px solid #e0e4ec; border-radius: 10px; padding: 20px; }

/* Бейджи */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #eef0f7; color: #5a6275; }
.badge-ON, .badge-success { background: #e6f5ec; color: #2e8856; }
.badge-SUSPENDED, .badge-warning { background: #fff5e6; color: #b87b1e; }
.badge-OFF, .badge-error { background: #fce8e8; color: #c84444; }
.badge-info { background: #e8eefb; color: #4060c0; }
.badge-empty { background: #f0f1f6; color: #aab1c2; }

/* Статусные строки */
.status-row-SUSPENDED td { opacity: 0.7; }
.status-row-OFF td { opacity: 0.5; }

/* Текстовые акценты */
.text-warn { color: #b87b1e; }
.text-good { color: #2e8856; }

/* Настройки */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 20px; }
.settings-card { background: #ffffff; border: 1px solid #e0e4ec; border-radius: 10px; padding: 24px; box-shadow: 0 1px 3px rgba(30,40,80,0.04); }
.settings-card-wide { grid-column: 1 / -1; }
.settings-card h3 { font-size: 15px; color: #2a3148; margin-bottom: 16px; border-bottom: 1px solid #eef0f7; padding-bottom: 8px; }
.settings-card small { color: #8a92a8; font-size: 11px; line-height: 1.6; display: block; margin-top: 6px; }
.settings-card small code { color: #5a6cf0; }
.code-hint { background: #f3f5fa; border: 1px solid #e0e4ec; border-radius: 6px; padding: 12px; margin-bottom: 10px; }
.code-hint pre { font-size: 12px; color: #4a5878; white-space: pre-wrap; }
.file-status { margin-bottom: 6px; }

/* Гипотезы */
.hyp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 20px; }
.hyp-card { background: #ffffff; border: 1px solid #e0e4ec; border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(30,40,80,0.04); }
.hyp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.hyp-name { font-weight: 600; color: #2a3148; font-size: 14px; }
.hyp-count { font-size: 11px; color: #5a6cf0; background: #e8eefb; padding: 2px 8px; border-radius: 10px; }
.hyp-list { list-style: decimal; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.hyp-list li { padding: 8px 12px; background: #f5f6fa; border-radius: 6px; border-left: 3px solid #7c8cf8; }
.hyp-text { color: #2a3148; font-size: 13px; }
.hyp-effect { color: #2e8856; font-size: 12px; margin-top: 4px; }

/* Кнопка стратегии */
.btn-strategy { background: #e8eefb; color: #4060c0; }
.actions-cell { white-space: nowrap; }
.camp-name { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Настройки: табы ── */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid #e0e4ec; padding-bottom: 0; }
.tab { background: none; border: none; color: #8a92a8; padding: 10px 20px; cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: #2a3148; }
.tab.active { color: #5a6cf0; border-bottom-color: #7c8cf8; font-weight: 500; }
.tab-content { }
.tab-content.hidden { display: none; }

/* ── OAuth подсказка ── */
.oauth-hint { background: #f8f9fc; border: 1px solid #e0e4ec; border-left: 3px solid #7c8cf8; border-radius: 8px; padding: 16px 20px; }
.oauth-hint ol { margin: 10px 0 12px 18px; color: #5a6275; font-size: 13px; line-height: 1.8; }
.oauth-hint small { color: #aab1c2; font-size: 11px; display: block; margin-top: 8px; }
.btn-oauth { display: inline-block; background: #ff6428; color: #fff; text-decoration: none; padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 600; margin-top: 8px; }
.btn-oauth:hover { background: #e05520; }

/* ── Список аккаунтов ── */
.accounts-list { min-height: 60px; }
.row-tested { background: #e6f5ec !important; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }

/* ── Info block ── */
.info-block { background: #f8f9fc; border: 1px solid #e0e4ec; border-radius: 8px; padding: 16px 20px; font-size: 13px; color: #5a6275; line-height: 1.7; }
.info-block ul, .info-block ol { margin: 8px 0 8px 20px; }
.info-block p { margin-bottom: 8px; }
.info-block a { color: #5a6cf0; }

/* OAuth кнопки */
.btn-oauth-small { background: #ffe8d0; color: #c8631e; }

/* ── Подключение аккаунта ── */
.connect-row { display: flex; gap: 10px; align-items: center; }
.connect-row input { flex: 1; background: #ffffff; border: 2px solid #b8c0d0; color: #1f2433; padding: 10px 14px; border-radius: 6px; font-size: 14px; transition: border-color .12s, box-shadow .12s; }
.connect-row input:hover { border-color: #98a2b8; }
.connect-row input:focus { outline: none; border-color: #7c8cf8; box-shadow: 0 0 0 3px rgba(124,140,248,0.18); }
.btn-connect { padding: 10px 24px; font-size: 14px; white-space: nowrap; }

/* ── OAuth шаги ── */
.oauth-steps { display: flex; flex-direction: column; gap: 16px; }
.oauth-step { display: flex; gap: 14px; align-items: flex-start; }
.step-num { background: #7c8cf8; color: #fff; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.cb-uri { background: #f3f5fa; padding: 2px 6px; border-radius: 4px; font-size: 12px; color: #4060c0; }
.btn-copy { background: none; border: 1px solid #d8dde8; color: #8a92a8; padding: 2px 6px; border-radius: 4px; cursor: pointer; font-size: 11px; margin-left: 6px; }
.link-yandex { color: #ff6428; font-weight: 600; }

.auto-token-notice { background: #e6f5ec; border: 1px solid #b8e0c8; border-radius: 8px; padding: 12px 16px; color: #2e8856; font-size: 13px; line-height: 1.6; }

.btn-google { background:#fff; color:#3c4043; border:1px solid #dadce0; padding:10px 20px; border-radius:6px; cursor:pointer; font-size:14px; font-weight:500; display:inline-flex; align-items:center; }
.btn-google:hover { background:#f8f9fa; box-shadow:0 1px 3px rgba(0,0,0,.2); }

/* ── Дашборд: виджеты ── */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.widgets-grid .widget {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid #e0e4ec;
    border-radius: 10px;
    padding: 16px 18px;
    transition: border-color .15s, box-shadow .15s;
    box-shadow: 0 1px 3px rgba(30,40,80,0.04);
}
.widgets-grid .widget:hover { border-color: #c4d2f5; box-shadow: 0 2px 8px rgba(30,40,80,0.08); }
.widgets-grid .widget-accent { border-left: 3px solid #7c8cf8; }
.widgets-grid .widget-cpa { border-left: 3px solid #2e8856; grid-column: span 2; }
.widget-icon { font-size: 22px; flex-shrink: 0; }
.widget-body { min-width: 0; }
.widgets-grid .widget-label { font-size: 11px; color: #8a92a8; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.widgets-grid .widget-value { font-size: 22px; font-weight: 700; color: #1f2433; white-space: nowrap; }
.widget-sub { font-size: 11px; color: #8a92a8; margin-top: 2px; }

/* ── Дашборд: быстрые периоды ── */
.period-btns { display: flex; gap: 6px; width: 100%; margin-bottom: 8px; }
.period-btn {
    background: #ffffff;
    border: 2px solid #b8c0d0;
    color: #5a6275;
    padding: 4px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all .15s;
}
.period-btn:hover { color: #1f2433; border-color: #7c8cf8; }
.period-btn.active { background: #7c8cf8; color: #fff; border-color: #7c8cf8; }

/* ── Дашборд: фильтры ── */
.date-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.date-field { display: flex; align-items: center; gap: 6px; }
.date-field label { font-size: 12px; color: #8a92a8; }
.date-field input[type="date"] {
    background: #ffffff;
    border: 2px solid #b8c0d0;
    color: #1f2433;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}
.date-field input[type="date"]:hover { border-color: #98a2b8; }
.date-field input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}
.date-field input[type="date"]:focus { border-color: #7c8cf8; outline: none; box-shadow: 0 0 0 3px rgba(124,140,248,0.18); }

/* ── Бургер-меню (скрыт на десктопе) ── */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 0;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #2a3148;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── МОБИЛЬНАЯ ВЕРСИЯ ── */
@media (max-width: 768px) {
    body { font-size: 13px; }

    /* Навбар */
    .navbar { padding: 0 14px; height: 52px; flex-wrap: wrap; }
    .nav-brand { font-size: 15px; }
    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 52px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: #ffffff;
        border-bottom: 1px solid #e0e4ec;
        gap: 0;
        padding: 8px 0;
        box-shadow: 0 8px 16px rgba(30,40,80,0.12);
        z-index: 99;
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        padding: 14px 20px;
        border-bottom: 1px solid #eef0f7;
        border-left: 3px solid transparent;
        font-size: 15px;
    }
    .nav-links a:hover, .nav-links a.active {
        border-bottom-color: #eef0f7;
        border-left-color: #7c8cf8;
        background: #f5f6fa;
    }
    .nav-links a:last-child { border-bottom: none; }
    .btn-logout { margin: 8px 16px 4px; text-align: center; }

    /* Контейнер */
    .container { padding: 14px 12px; }

    /* Заголовки страниц */
    .page-header { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 16px; }
    .page-header h2 { font-size: 18px; }
    .filter-form { width: 100%; }
    .filter-form input, .filter-form select { width: 100%; padding: 10px 12px; font-size: 14px; }
    .date-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .date-field { justify-content: space-between; }
    .date-field input[type="date"] { flex: 1; padding: 10px 12px; font-size: 14px; }
    .period-btns { flex-wrap: wrap; }
    .period-btn { flex: 1; min-width: 60px; padding: 8px 10px; }

    /* Виджеты — 2 колонки на телефоне */
    .widgets, .widgets-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 18px;
    }
    .widget, .widgets-grid .widget { padding: 12px 14px; gap: 10px; }
    .widget-icon { font-size: 18px; }
    .widget-label, .widgets-grid .widget-label { font-size: 10px; margin-bottom: 3px; }
    .widget-value, .widgets-grid .widget-value { font-size: 17px; }
    .widgets-grid .widget-cpa { grid-column: span 2; }

    /* Таблицы — горизонтальный скролл */
    .scroll-table, table { overflow-x: auto; display: block; max-width: 100%; }
    .data-table { min-width: 100%; }
    .data-table th, .data-table td { padding: 6px 8px; font-size: 12px; white-space: nowrap; }
    .camp-name { max-width: 180px; }

    /* Кнопки увеличить для пальцев */
    .btn-primary, .btn-secondary { padding: 10px 18px; font-size: 14px; }
    .btn-sm { padding: 6px 10px; font-size: 12px; }

    /* Секции */
    .section { margin-bottom: 20px; }
    .section h3 { font-size: 14px; }

    /* Настройки — одна колонка */
    .settings-grid { grid-template-columns: 1fr; gap: 14px; }
    .settings-card { padding: 18px 16px; }
    .tabs { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .tab { padding: 10px 14px; font-size: 13px; flex-shrink: 0; }

    /* Гипотезы — одна колонка */
    .hyp-grid, .hyp-grid-v2 { grid-template-columns: 1fr; gap: 12px; }
    .hyp-card, .hyp-card-v2 { padding: 14px; }

    /* Модалки */
    .modal-content { width: calc(100% - 28px); padding: 20px; }

    /* Логин */
    .login-card { width: calc(100% - 28px); max-width: 360px; padding: 28px 22px; }

    /* Connect-row */
    .connect-row { flex-direction: column; align-items: stretch; }
    .btn-connect { width: 100%; }

    /* Manual actions */
    .manual-actions { flex-direction: column; }
    .manual-actions .btn-primary, .manual-actions .btn-secondary { width: 100%; }

    /* Toast */
    .toast { left: 12px; right: 12px; bottom: 12px; font-size: 13px; padding: 10px 14px; }

    /* Форма логина */
    .form-group input, .form-group select { padding: 12px; font-size: 15px; }
}

/* Маленькие телефоны */
@media (max-width: 380px) {
    .widgets, .widgets-grid { grid-template-columns: 1fr; }
    .widgets-grid .widget-cpa { grid-column: span 1; }
    .nav-brand { font-size: 14px; }
    .nav-brand::before { content: ""; }
}

/* ── Брендовые иконки ── */
.brand-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: -4px;
    margin-right: 6px;
}
.brand-icon-lg {
    display: inline-block;
    width: 26px;
    height: 26px;
    vertical-align: -5px;
    margin-right: 8px;
}

/* ── Multiselect (раскрывающийся список с чекбоксами) ── */
.multiselect { position: relative; }
.multiselect-display {
    display: flex; align-items: center; gap: 8px;
    background: #ffffff;
    border: 2px solid #b8c0d0;
    color: #1f2433;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition: border-color .12s, box-shadow .12s;
}
.multiselect-display:hover { border-color: #98a2b8; }
.multiselect-arrow { color: #8a92a8; font-size: 12px; flex-shrink: 0; transition: transform .15s; }
.multiselect.open .multiselect-arrow { transform: rotate(180deg); }
.multiselect-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #ffffff;
    border: 2px solid #b8c0d0;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(30,40,80,0.12);
    z-index: 50;
    max-height: 380px;
    flex-direction: column;
    overflow: hidden;
}
.multiselect.open .multiselect-dropdown { display: flex; }
.multiselect-search { padding: 8px; border-bottom: 1px solid #eef0f7; }
.multiselect-search input {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid #d8dde8;
    border-radius: 6px;
    background: #f8f9fc;
    color: #1f2433;
    font-size: 13px;
}
.multiselect-search input:focus { outline: none; border-color: #7c8cf8; background: #ffffff; }
.multiselect-options { overflow-y: auto; max-height: 300px; }
.multiselect-option {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #eef0f7;
    transition: background .1s;
}
.multiselect-option:hover { background: #f5f6fa; }
.multiselect-option:last-child { border-bottom: none; }
.multiselect-option input[type="checkbox"] {
    width: 16px; height: 16px; cursor: pointer; accent-color: #7c8cf8; flex-shrink: 0;
}
.multiselect-option .goal-name { flex: 1; color: #1f2433; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multiselect-option .goal-id { color: #8a92a8; font-size: 11px; font-family: monospace; flex-shrink: 0; }
.multiselect-option .goal-type { color: #5a6cf0; font-size: 11px; background: #e8eefb; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #ffffff;
    border: 1px solid #c4d2f5;
    color: #1f2433;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(30,40,80,0.18);
    transition: opacity .3s, transform .3s;
}
.toast.hidden { opacity: 0; transform: translateY(10px); pointer-events: none; }
