/* BusinessPad-style: белый фон, тёмно-синий акцент, светлые декоративные элементы */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #FFFFFF;
    --bg-soft: #F8FAFC;
    --card: #FFFFFF;
    --text: #0D2A7A;
    --text-secondary: #333333;
    --muted: #64748B;
    --accent: #0D2A7A;
    --accent-light: #1E40AF;
    --accent-soft: #DBEAFE;
    --border: #E2E8F0;
    --shadow: 0 1px 3px rgba(13, 42, 122, 0.08);
    --shadow-md: 0 4px 12px rgba(13, 42, 122, 0.12);
    --orb-light: rgba(147, 197, 253, 0.35);
    --success: #059669;
    --warning: #D97706;
    --error: #DC2626;
}

* { box-sizing: border-box; }

body {
    font-family: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-secondary);
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Декоративные элементы в стиле Figma */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle at center, var(--orb-light) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    bottom: -15%;
    right: -5%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle at center, var(--orb-light) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.container { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 1.5rem; }

/* Header в стиле настройки аналитики BP */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.brand-wrap {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.header-logo {
    display: block;
    height: 36px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.header a.brand {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.header nav a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.header nav a:hover { text-decoration: underline; }

.header nav a.nav-icon:hover { text-decoration: none; }

.header nav { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    min-width: 2.25rem;
    border-radius: 8px;
}

.nav-icon svg {
    flex-shrink: 0;
}

.header nav a.nav-icon {
    color: var(--accent);
}

.header nav a.nav-icon:hover {
    background: var(--bg-soft);
}

/* Блок заголовка страницы (как в настройках) */
.page-head {
    margin-bottom: 1.5rem;
}

.page-head h1 {
    margin-bottom: 0.25rem;
}

.page-head .breadcrumb {
    font-size: 0.875rem;
    color: var(--muted);
}

.page-head .breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.page-head .breadcrumb a:hover { text-decoration: underline; }

.btn {
    display: inline-block;
    padding: 0.55rem 1.15rem;
    background: var(--accent);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(13, 42, 122, 0.25);
    transition: background 0.2s, box-shadow 0.2s;
}

.btn:hover { background: var(--accent-light); box-shadow: 0 4px 10px rgba(13, 42, 122, 0.3); }

.btn-ghost {
    background: transparent;
    color: var(--muted) !important;
    box-shadow: none;
}

.btn-ghost:hover { color: var(--text) !important; background: var(--bg-soft); }

.btn-create {
    background: var(--success);
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}
.btn-create:hover {
    background: #047857;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.4);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.muted { color: var(--muted); font-size: 0.9rem; }

.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}
.message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.message-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.message-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.message-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.message-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #93C5FD; }

h1, h2 {
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 0;
}

h1 { font-size: 1.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.25rem; margin-bottom: 0.75rem; margin-top: 2rem; }

/* Секция с заголовком (как в настройках аналитики) */
.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

/* Вкладки метода поиска */
.search-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 0;
    padding: 0 1.5rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    overflow: hidden;
}

.search-tab {
    display: inline-block;
    padding: 0.85rem 1.35rem;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.15s, background 0.15s;
}

.search-tab:hover {
    color: var(--text-secondary);
    background: var(--card);
}

.search-tab.active {
    color: var(--accent);
    background: var(--card);
    border-bottom: 2px solid var(--accent);
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

/* Панель под вкладками визуально слита с полоской вкладок */
.search-tabs ~ .tab-pane.active.card {
    border-radius: 0 0 12px 12px;
    margin-top: -1px;
    padding-top: 1.25rem;
}

/* Отступы в блоке поиска: контент табов не прилипает к краям */
.search-tabs ~ .tab-pane.card {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.theme-toggle {
    padding: 0.4rem 0.6rem;
    font-size: 1.1rem;
    line-height: 1;
}

/* Тёмная тема */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-soft: #1e293b;
    --card: #1e293b;
    --text: #e2e8f0;
    --text-secondary: #cbd5e1;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --accent-light: #7dd3fc;
    --accent-soft: #0c4a6e;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --orb-light: rgba(56, 189, 248, 0.12);
    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;
}

[data-theme="dark"] body::before,
[data-theme="dark"] body::after {
    opacity: 0.5;
}

[data-theme="dark"] .btn-create { background: #047857; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
[data-theme="dark"] .btn-create:hover { background: #059669; }
[data-theme="dark"] .message-success { background: #064e3b; color: #a7f3d0; border-color: #065f46; }
[data-theme="dark"] .message-error { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }
[data-theme="dark"] .message-warning { background: #78350f; color: #fde68a; border-color: #92400e; }
[data-theme="dark"] .message-info { background: #0c4a6e; color: #bae6fd; border-color: #075985; }

/* Адаптив */
@media (max-width: 768px) {
    .container { padding: 1rem; }
    .header {
        margin-left: -1rem;
        margin-right: -1rem;
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .header-logo { height: 32px; max-width: 130px; }
    .header nav { flex-wrap: wrap; gap: 0.35rem; }
    .nav-icon { width: 2rem; height: 2rem; min-width: 2rem; }
    .nav-icon svg { width: 18px; height: 18px; }
}

@media (max-width: 480px) {
    body::before, body::after { opacity: 0.7; }
    .container { padding: 0.75rem; }
    .header {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        padding: 0.5rem 0.75rem;
    }
    .header-logo { height: 28px; max-width: 110px; }
    .card { padding: 1rem; border-radius: 10px; }
    h1 { font-size: 1.25rem; }
    h2 { font-size: 1.1rem; margin-top: 1.5rem; }
}
