:root {
    --primary-color: #111827;
    --secondary-color: #1f2937;
    --accent-color: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #3b82f6, #6366f1);
    --text-color: #111827;
    --muted-text: #6b7280;
    --bg-color: #020617;
    --bg-soft: rgba(15, 23, 42, 0.9);
    --white: #ffffff;
    --border-color: rgba(148, 163, 184, 0.4);
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.65);
    --radius-lg: 18px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, #1d4ed8 0, transparent 50%),
        radial-gradient(circle at bottom right, #22c55e 0, transparent 55%),
        #020617;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 24px;
    gap: 24px;

    @media (max-width: 768px) {
        flex-direction: column;
    }
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.85));
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 20px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    align-self: flex-start;

    @media (max-width: 768px) {
        width: 100%;
        top: 0;
        position: relative;
    }
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 24px;
}

.sidebar-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-title {
    font-size: 20px;
    font-weight: 700;
    color: #e5e7eb;
}

.logo-subtitle {
    font-size: 12px;
    color: #9ca3af;
}

.logo-subtitle a {
    color: #bfdbfe;
    text-decoration: none;
}

.logo-subtitle a:hover {
    text-decoration: underline;
}

.logo-version {
    font-size: 10px;
    color: #6b7280;
    margin-top: 2px;
    opacity: 0.7;
}

.sidebar.sidebar-open {

    .sidebar-nav-wrap {
        opacity: 1;
        visibility: visible;
        pointer-events: all;
    }
}

.sidebar-nav-wrap {
    overflow: hidden;
    transition: max-height .3s ease-in-out, opacity .3s ease-in-out, visibility .3s ease-in-out;

    @media (max-width: 768px) {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-burger {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;

    @media (max-width: 768px) {
        display: flex;
    }
}

.sidebar-burger:hover {
    background: rgba(55, 65, 81, 0.9);
    border-color: rgba(148, 163, 184, 0.8);
}

.sidebar-burger span,
.sidebar-burger span::before,
.sidebar-burger span::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #e5e7eb;
    position: relative;
    transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.sidebar-burger span::before,
.sidebar-burger span::after {
    content: "";
    position: absolute;
    left: 0;
}

.sidebar-burger span::before {
    top: -5px;
}

.sidebar-burger span::after {
    top: 5px;
}

.sidebar.sidebar-open .sidebar-burger span {
    background: transparent;
}

.sidebar.sidebar-open .sidebar-burger span::before {
    top: 0;
    transform: rotate(45deg);
}

.sidebar.sidebar-open .sidebar-burger span::after {
    top: 0;
    transform: rotate(-45deg);
}

.nav-link {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.18s ease, transform 0.12s ease, color 0.18s ease;
}

.nav-link:hover {
    background: rgba(55, 65, 81, 0.85);
    transform: translateY(-1px);
    color: #f9fafb;
}

.nav-link.active {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.75);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
    color: #f9fafb;
}

/* Main Content */
.content {
    flex-grow: 1;
    padding: 22px 24px;
    background: var(--bg-soft);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(22px);
}

.tool-section {
    width: 100%;
    margin: 0;
}

.tool-section h1 {
    font-size: 26px;
    margin-bottom: 12px;
    color: #e5e7eb;
}

.tool-description {
    margin-bottom: 24px;
    color: var(--muted-text);
    font-size: 14px;
    line-height: 1.6;
}

.tool-description a {
    color: #93c5fd;
    text-decoration: underline;
}

/* Cards grid (главная) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 8px;
}

.tool-card {
    display: block;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 55%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.12), transparent 60%),
        rgba(15, 23, 42, 0.92);
    border-radius: 16px;
    padding: 18px 18px 16px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    text-decoration: none;
    color: #e5e7eb;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.8);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tool-card h2 {
    font-size: 18px;
    margin-bottom: 6px;
    border: none;
    padding: 0;
}

.tool-card p {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 10px;
}

.card-link {
    font-size: 13px;
    color: #bfdbfe;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.95);
    border-color: rgba(59, 130, 246, 0.75);
}

/* Карточки внутри инструментов */
.card {
    background: rgba(15, 23, 42, 0.92);
    border-radius: 16px;
    padding: 18px 18px 16px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    margin-bottom: 18px;
}

.card h2 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #e5e7eb;
    border: none;
    padding: 0;
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: #d1d5db;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.9);
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: #6b7280;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    border-color: rgba(59, 130, 246, 0.85);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.6);
    background: rgba(15, 23, 42, 0.98);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e5e7eb' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: rgba(59, 130, 246, 0.9);
}

input[type="date"] {
    width: auto;
    min-width: 150px;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.row {
    display: flex;
    gap: 18px;
    margin-bottom: 16px;
}

.col {
    flex: 1;
}

.options {
    margin-bottom: 18px;
    font-size: 13px;
    color: #d1d5db;
}

.options input[type="checkbox"] {
    margin-right: 6px;
}

/* Современные чекбоксы */
.modern-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: #e5e7eb;
}

.modern-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    appearance: none;
    border: 2px solid rgba(148, 163, 184, 0.6);
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.9);
    position: relative;
    transition: all 0.2s ease;
}

.modern-checkbox input[type="checkbox"]:hover {
    border-color: rgba(59, 130, 246, 0.8);
    background: rgba(15, 23, 42, 0.98);
}

.modern-checkbox input[type="checkbox"]:checked {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
}

.modern-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.hint {
    font-size: 12px;
    color: var(--muted-text);
    margin-bottom: 10px;
}

/* HTML editor */
.html-editor {
    min-height: 260px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.9);
}

/* Адаптивная сетка для основного текста */
@media (max-width: 960px) {
    #main-text-content > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

.html-editor .ql-container {
    border: none;
    height: 220px;
}

.html-editor .ql-editor {
    min-height: 100%;
    padding-bottom: 16px;
    cursor: text;
}

.code-area {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
}

/* Buttons */
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.secondary-actions {
    margin-top: 14px;
}

button {
    padding: 9px 18px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.primary-btn {
    background-image: var(--accent-gradient);
    color: var(--white);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.55);
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.8);
}

.secondary-btn {
    background: rgba(31, 41, 55, 0.9);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.6);
}

.secondary-btn:hover {
    background: rgba(31, 41, 55, 1);
}

.danger-btn {
    background: rgba(239, 68, 68, 0.9);
    color: var(--white);
}

.danger-btn:hover {
    background: rgba(220, 38, 38, 1);
}

/* Server Checker Results */
.result-box {
    margin-top: 18px;
    padding: 14px 14px 10px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 55%),
        rgba(15, 23, 42, 0.96);
    color: #e5e7eb;
    font-size: 13px;
}

.status-code {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
}

.status-200 { color: var(--success-color); }
.status-301, .status-302 { color: #facc15; }
.status-404, .status-500 { color: var(--danger-color); }

.redirect-chain {
    margin-top: 8px;
    padding-left: 16px;
}

.hidden {
    display: none !important;
}

/* Result table */
.result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 4px;
    font-size: 13px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* На светлой теме таблица светлая */
body.theme-light .result-table,
html.theme-light body .result-table {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 0.9);
}

.result-table th,
.result-table td {
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
    padding: 10px 12px;
    text-align: left;
    transition: background 0.2s ease;
}

/* Цвет текста по умолчанию для темной темы - светлый */
.result-table td,
.result-table th {
    color: #e5e7eb;
}

.result-table th {
    font-weight: 600;
    color: #d1d5db;
    background: rgba(15, 23, 42, 0.95);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid rgba(148, 163, 184, 0.4);
}

/* Столбцы с датами имеют фиксированную ширину */
.result-table th.position-date-header {
    width: 80px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.result-table th.position-date-header:hover {
    background: rgba(31, 41, 55, 0.95);
}

.result-table th.keywords-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.result-table th.keywords-header:hover {
    background: rgba(31, 41, 55, 0.95);
}

.method-hint {
    font-size: 10px;
    font-weight: normal;
    color: #9ca3af;
    display: block;
    margin-top: 2px;
}

.result-table tbody tr {
    transition: background 0.15s ease;
}

.result-table tbody tr:hover {
    background: rgba(31, 41, 55, 0.6);
}

.result-table tbody tr:hover td {
    background: transparent;
}

/* Убираем заливку строк с ключевыми словами */
.result-table tr:nth-child(even) td {
    background: transparent;
}

.result-table tr:nth-child(odd) td {
    background: transparent;
}

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

/* Цветовая кодировка позиций в таблице ключевых слов */
.result-table .position-cell {
    text-align: center;
    font-weight: 600;
    padding: 0;
    position: relative;
    width: 80px;
    height: 40px;
    vertical-align: middle;
}

.result-table .position-1-3 {
    background: rgba(59, 130, 246, 0.25) !important;
    color: #e5e7eb;
    border-left: 3px solid rgba(59, 130, 246, 0.8);
}

.result-table .position-4-5 {
    background: rgba(147, 197, 253, 0.25) !important;
    color: #e5e7eb;
    border-left: 3px solid rgba(147, 197, 253, 0.7);
}

.result-table .position-6-10 {
    background: rgba(22, 163, 74, 0.25) !important;
    color: #e5e7eb;
    border-left: 3px solid rgba(22, 163, 74, 0.7);
}

.result-table .position-11-20 {
    background: rgba(163, 230, 53, 0.2) !important;
    color: #e5e7eb;
    border-left: 3px solid rgba(163, 230, 53, 0.6);
}

.result-table .position-21-30 {
    background: rgba(234, 179, 8, 0.2) !important;
    color: #e5e7eb;
    border-left: 3px solid rgba(234, 179, 8, 0.6);
}

.result-table .position-31-50 {
    background: rgba(253, 224, 71, 0.15) !important;
    color: #e5e7eb;
    border-left: 3px solid rgba(253, 224, 71, 0.5);
}

.result-table .position-51-100 {
    background: rgba(246, 233, 197, 0.3) !important;
    color: #e5e7eb;
    border-left: 3px solid rgba(246, 233, 197, 0.6);
}

.result-table .position-no {
    background: transparent !important;
    color: #9ca3af;
}

.result-table .position-error {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5;
    border-left: 3px solid rgba(239, 68, 68, 0.8);
}

.result-table .position-not-found {
    background: rgba(156, 163, 175, 0.2) !important;
    color: #d1d5db;
    border-left: 3px solid rgba(156, 163, 175, 0.5);
}

.result-table .position-missing {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #e5e7eb;
    border-left: 3px solid rgba(239, 68, 68, 0.5);
}

.result-table .position-change {
    font-size: 11px;
    font-weight: 500;
    margin-left: 4px;
    padding: 2px 4px;
    border-radius: 3px;
    display: inline-block;
}

.result-table .position-change.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.25);
    font-weight: 600;
}

.result-table .position-change.negative {
    color: #f87171;
    background: rgba(248, 113, 113, 0.25);
    font-weight: 600;
}

/* Исправляем цвета для динамики на цветных фонах */
.result-table .position-6-10 .position-change.positive,
.result-table .position-11-20 .position-change.positive {
    color: #065f46;
    background: rgba(16, 185, 129, 0.4);
}

.result-table .position-1-3 .position-change.positive,
.result-table .position-4-5 .position-change.positive {
    color: #065f46;
    background: rgba(16, 185, 129, 0.4);
}

.result-table .position-cell-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
}

/* Кликабельные ячейки с позициями */
.result-table .position-cell-clickable {
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.result-table .position-cell-clickable:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.url-cell {
    max-width: 360px;
    word-break: break-all;
}

.final-url-cell {
    max-width: 360px;
    word-break: break-all;
}

.code-cell {
    white-space: nowrap;
    font-weight: 600;
}

/* SERP checker */
.serp-results-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 18px;
}

.serp-result-block {
    width: 100%;
    min-width: 0;
}

.serp-result-status {
    margin-bottom: 8px;
}

/* На тёмной теме результаты делаем светлыми для лучшей читаемости */
body:not(.theme-light) .serp-result-block {
    background: #f9fafb;
    color: #111827;
    border-color: rgba(209, 213, 219, 0.9);
}

body:not(.theme-light) .serp-result-block .result-table th {
    background: #e5e7eb;
    color: #111827;
    border-bottom-color: #d1d5db;
}

body:not(.theme-light) .serp-result-block .result-table tr:nth-child(even) td {
    background: #ffffff;
}

body:not(.theme-light) .serp-result-block .result-table tr:nth-child(odd) td {
    background: #f9fafb;
}

/* Projects & pages */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-item {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    padding: 16px;
    background: rgba(15, 23, 42, 0.94);
}

.project-item-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.project-item-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.project-favicon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 2px;
}

.project-item-title-text {
    flex: 1;
}

.project-name-link {
    text-decoration: none;
    display: block;
}

.project-name {
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 6px;
    transition: color 0.2s ease;
}

.project-name-link:hover .project-name {
    color: #93c5fd;
}

.project-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.project-url {
    font-size: 13px;
    color: #9ca3af;
}

.project-region {
    font-size: 13px;
    color: #9ca3af;
}

.project-item-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.project-stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 60px;
}

.project-stat-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.project-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #e5e7eb;
    line-height: 1.2;
}

.project-stat-item-date .project-stat-value {
    font-size: 14px;
    font-weight: 600;
}

.project-item-actions {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.icon-btn-refresh {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.icon-btn-refresh:hover {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
    transform: scale(1.05);
}

.icon-btn-refresh:active {
    transform: scale(0.95);
}

.icon-btn-refresh:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.icon-btn-refresh svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.icon-btn-refresh svg.spin {
    animation: spin 1s linear infinite;
}

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

/* Collapsible card */
.collapsible-card {
    margin-bottom: 20px;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 0;
    margin: 0;
    transition: opacity 0.2s ease;
}

.collapsible-header:hover {
    opacity: 0.8;
}

.collapsible-icon {
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.2s ease;
    margin-left: 12px;
}

.collapsible-content {
    margin-top: 16px;
}

@media (max-width: 768px) {
    .project-item-main {
        flex-direction: column;
        gap: 16px;
    }
    
    .project-item-title {
        width: 100%;
    }
    
    .project-item-stats {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
        align-items: center;
    }
    
    .project-stat-item {
        flex: 1;
        min-width: auto;
    }
    
    .project-stat-item-date {
        flex: 1.5;
    }

    .project-item-actions {
        margin-left: 0;
        margin-top: 4px;
    }
}

.project-header {
    margin-bottom: 10px;
}

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

.project-title {
    font-size: 22px;
    margin: 0 0 4px;
}

.project-base-url {
    font-size: 13px;
}

.project-base-url a {
    color: #93c5fd;
}

.project-pages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.page-item {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.94);
}

.page-item-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.page-item-left {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.page-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.page-cluster {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
}

.page-url {
    font-size: 12px;
    color: var(--muted-text);
}

.page-meta-small {
    font-size: 11px;
    color: var(--muted-text);
}

.page-item-stats-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.page-stat-mini {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-stat-mini-label {
    font-size: 11px;
    color: #9ca3af;
}

.page-stat-mini-value {
    font-size: 12px;
    font-weight: 600;
    color: #e5e7eb;
}

.page-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.small-btn {
    padding: 6px 10px;
    font-size: 12px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.icon-btn:hover {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
    transform: scale(1.05);
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* Кнопка настроек */
.icon-btn-settings {
    width: 36px;
    height: 36px;
}

.icon-btn-settings:hover {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
}

/* Кнопка обновления (синяя) */
.icon-btn-refresh-blue {
    background: rgba(31, 41, 55, 0.9);
}

.icon-btn-refresh-blue:hover {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
}

/* Кнопка быстрого обновления (зеленая) */
.icon-btn-refresh-green {
    background: rgba(31, 41, 55, 0.9);
}

.icon-btn-refresh-green:hover {
    background: rgba(34, 197, 94, 0.9);
    border-color: rgba(34, 197, 94, 0.9);
    color: #ffffff;
}

/* Кнопка удаления (красная) */
.icon-btn-delete {
    background: rgba(31, 41, 55, 0.9);
}

.icon-btn-delete:hover {
    background: rgba(239, 68, 68, 0.9);
    border-color: rgba(239, 68, 68, 0.9);
    color: #ffffff;
}

/* Кнопка сбора мета */
.icon-btn-collect {
    background: rgba(31, 41, 55, 0.9);
}

.icon-btn-collect:hover {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
}

/* Кнопка скачивания */
.icon-btn-download {
    background: rgba(31, 41, 55, 0.9);
}

.icon-btn-download:hover {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
}

/* Кнопка скачивания ядра */
.icon-btn-download-core {
    background: rgba(31, 41, 55, 0.9);
}

.icon-btn-download-core:hover {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
}

/* Кнопка добавления посадочной страницы */
.icon-btn-add-page {
    background: rgba(31, 41, 55, 0.9);
}

.icon-btn-add-page:hover {
    background: rgba(34, 197, 94, 0.9);
    border-color: rgba(34, 197, 94, 0.9);
    color: #ffffff;
}

/* Кнопка меню */
.icon-btn-menu {
    background: rgba(31, 41, 55, 0.9);
}

.icon-btn-menu:hover {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
}

/* Кнопка свернуть/развернуть */
.icon-btn-toggle {
    background: rgba(31, 41, 55, 0.9);
}

.icon-btn-toggle:hover {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
}

.icon-btn-link {
    background: rgba(31, 41, 55, 0.9);
}

.icon-btn-link:hover {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
}

/* Синий ховер для всех иконок по умолчанию (если не переопределен зеленым/красным) */
.icon-btn:not(.icon-btn-refresh-green):not(.icon-btn-add-page):not(.icon-btn-delete):not(.icon-btn-menu):hover {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
}

/* Бейдж для счетчика */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    font-size: 13px;
    font-weight: 600;
    margin-left: 8px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    background: rgba(15, 23, 42, 0.98);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.5);
    box-shadow: var(--shadow-soft);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
    pointer-events: auto;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #e5e7eb;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: #e5e7eb;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
    padding: 0;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Кнопка "Отмена" в форме - не должна иметь стили modal-close */
.form-actions .modal-close {
    width: auto;
    height: auto;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 999px;
    background: rgba(31, 41, 55, 0.9);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.6);
}

.form-actions .modal-close:hover {
    background: rgba(31, 41, 55, 1);
    border-color: rgba(148, 163, 184, 0.8);
}

body.theme-light .form-actions .modal-close {
    background: rgba(255, 255, 255, 0.9);
    color: #111827;
    border-color: rgba(209, 213, 219, 0.7);
}

body.theme-light .form-actions .modal-close:hover {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.8);
}

.modal-body {
    padding: 24px;
    position: relative;
    z-index: 1002;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
    pointer-events: auto;
    position: relative;
    z-index: 1003;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.modal-body small {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    line-height: 1.4;
}

body.theme-light .modal-body small {
    color: #6b7280;
}

body.theme-light .form-actions {
    border-top-color: rgba(209, 213, 219, 0.7);
}

/* Меню-бургер для страницы */
.page-menu-container {
    position: relative;
}

.page-menu-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    z-index: 100;
    overflow: hidden;
}

.page-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.page-menu-item:hover {
    background: rgba(55, 65, 81, 0.9);
}

.page-menu-item svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    flex-shrink: 0;
}

.breadcrumbs {
    font-size: 12px;
    color: var(--muted-text);
    margin-bottom: 10px;
}

.breadcrumb-link {
    color: #93c5fd;
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 4px;
}

.page-header .page-title {
    font-size: 22px;
    margin-bottom: 4px;
}

.page-header .page-url {
    font-size: 13px;
    margin-bottom: 6px;
}

.page-header .page-url a {
    color: #93c5fd;
}

.page-status-line {
    font-size: 12px;
    color: var(--muted-text);
}

.page-status-line .divider {
    margin: 0 6px;
}

.status-code-value,
.status-date-value {
    font-weight: 600;
    color: #e5e7eb;
}

.page-cluster-link {
    color: #e5e7eb;
    text-decoration: none;
}

.page-cluster-link:hover {
    text-decoration: underline;
}

/* Meta box layout */
.meta-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.meta-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.4);
}

.meta-row:last-child {
    border-bottom: none;
}

.meta-label {
    font-size: 13px;
    color: var(--muted-text);
}

.meta-value {
    font-size: 13px;
    color: #e5e7eb;
    white-space: pre-wrap;
    word-break: break-word;
}

.keywords-count {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted-text);
    margin-left: 6px;
}

/* Theme toggle icon */
.theme-toggle-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle-icon:hover {
    background: rgba(55, 65, 81, 0.9);
    border-color: rgba(148, 163, 184, 0.8);
    transform: scale(1.05);
}

.theme-toggle-icon:active {
    transform: scale(0.95);
}

.theme-toggle-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    transition: transform 0.3s ease;
}

.theme-toggle-icon:hover svg {
    transform: rotate(180deg);
}

/* Quill editor text color for dark theme */
.html-editor .ql-editor {
    color: #e5e7eb;
}

/* Light theme overrides */
body.theme-light,
html.theme-light body {
    background: #f3f4f6;
    color: #111827;
}

body.theme-light .sidebar,
html.theme-light body .sidebar {
    background: #ffffff;
    color: #111827;
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

body.theme-light .nav-link,
html.theme-light body .nav-link {
    color: #374151;
}

body.theme-light .nav-link.active,
html.theme-light body .nav-link.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.85);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
}

body.theme-light .nav-link:hover,
html.theme-light body .nav-link:hover {
    background: #e5e7eb;
    color: #111827;
}

body.theme-light .content,
html.theme-light body .content {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 0.9);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

body.theme-light .tool-card,
html.theme-light body .tool-card {
    background: #ffffff;
    color: #111827;
    border-color: rgba(209, 213, 219, 0.9);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

body.theme-light .tool-card p,
html.theme-light body .tool-card p {
    color: #4b5563;
}

body.theme-light .card,
html.theme-light body .card {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 0.9);
}

body.theme-light .result-box,
html.theme-light body .result-box {
    background: #f9fafb;
    color: #111827;
    border-color: rgba(209, 213, 219, 0.9);
}

body.theme-light .result-table th,
html.theme-light body .result-table th {
    background: #f3f4f6 !important;
    color: #111827;
    border-bottom-color: #e5e7eb;
}

/* Шапка таблицы полностью светлая на светлой теме, включая sticky колонку */
body.theme-light .result-table th[style*="position: sticky"],
html.theme-light body .result-table th[style*="position: sticky"],
body.theme-light .result-table th.keywords-header,
html.theme-light body .result-table th.keywords-header {
    background: #f3f4f6 !important;
}

body.theme-light .result-table td[style*="position: sticky"],
html.theme-light body .result-table td[style*="position: sticky"] {
    background: inherit !important;
}

/* Блок фильтра дат - стили как у шапки таблицы */
.date-filter-block {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

body.theme-light .date-filter-block,
html.theme-light body .date-filter-block {
    background: #f3f4f6 !important;
    border-color: #e5e7eb;
}

/* На светлой теме строки таблицы светлые */
body.theme-light .result-table tr:nth-child(even) td,
html.theme-light body .result-table tr:nth-child(even) td {
    background: #ffffff;
}

body.theme-light .result-table tr:nth-child(odd) td,
html.theme-light body .result-table tr:nth-child(odd) td {
    background: #f9fafb;
}

body.theme-light .result-table tbody tr:hover,
html.theme-light body .result-table tbody tr:hover {
    background: #e5e7eb;
}

body.theme-light .result-table tbody tr:hover td,
html.theme-light body .result-table tbody tr:hover td {
    background: #e5e7eb;
}

/* Цвет текста на светлой теме - темный */
body.theme-light .result-table td,
html.theme-light body .result-table td,
body.theme-light .result-table th,
html.theme-light body .result-table th {
    color: #111827 !important;
}

/* Цвет текста позиций на светлой теме */
body.theme-light .result-table .position-cell,
html.theme-light body .result-table .position-cell {
    color: #111827;
}

body.theme-light .result-table .position-1-3,
html.theme-light body .result-table .position-1-3,
body.theme-light .result-table .position-4-5,
html.theme-light body .result-table .position-4-5,
body.theme-light .result-table .position-6-10,
html.theme-light body .result-table .position-6-10,
body.theme-light .result-table .position-11-20,
html.theme-light body .result-table .position-11-20,
body.theme-light .result-table .position-21-30,
html.theme-light body .result-table .position-21-30,
body.theme-light .result-table .position-31-50,
html.theme-light body .result-table .position-31-50,
body.theme-light .result-table .position-51-100,
html.theme-light body .result-table .position-51-100 {
    color: #111827;
}

body.theme-light .result-table .position-error,
html.theme-light body .result-table .position-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #111827;
}

body.theme-light .result-table .position-not-found,
html.theme-light body .result-table .position-not-found {
    background-color: rgba(156, 163, 175, 0.15);
    color: #6b7280;
}

body.theme-light .result-table .position-missing,
html.theme-light body .result-table .position-missing {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #111827;
}

body.theme-light .html-editor,
html.theme-light body .html-editor {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 0.9);
}

body.theme-light .html-editor .ql-editor,
html.theme-light body .html-editor .ql-editor {
    color: #111827;
}

body.theme-light input[type="text"],
body.theme-light textarea,
html.theme-light body input[type="text"],
html.theme-light body textarea {
    background: #ffffff;
    color: #111827;
    border-color: rgba(209, 213, 219, 0.9);
}

/* Light theme typography */
body.theme-light .tool-section h1,
html.theme-light body .tool-section h1 {
    color: #111827;
}

body.theme-light .tool-description,
html.theme-light body .tool-description {
    color: #4b5563;
}

body.theme-light .logo,
html.theme-light body .logo {
    color: #111827;
}

body.theme-light .logo-title,
html.theme-light body .logo-title {
    color: #111827;
}

body.theme-light .logo-subtitle,
html.theme-light body .logo-subtitle {
    color: #6b7280;
}

body.theme-light .logo-subtitle a,
html.theme-light body .logo-subtitle a {
    color: #1d4ed8;
}

body.theme-light .logo-version,
html.theme-light body .logo-version {
    color: #9ca3af;
}

body.theme-light .theme-toggle-icon,
html.theme-light body .theme-toggle-icon {
    background: #f3f4f6;
    border-color: rgba(209, 213, 219, 0.9);
    color: #374151;
}

body.theme-light .theme-toggle-icon:hover,
html.theme-light body .theme-toggle-icon:hover {
    background: #e5e7eb;
    border-color: rgba(209, 213, 219, 1);
}

body.theme-light .sidebar-burger,
html.theme-light body .sidebar-burger {
    background: #f3f4f6;
    border-color: rgba(209, 213, 219, 0.9);
}

body.theme-light .sidebar-burger:hover,
html.theme-light body .sidebar-burger:hover {
    background: #e5e7eb;
    border-color: rgba(209, 213, 219, 1);
}

body.theme-light .sidebar-burger span,
body.theme-light .sidebar-burger span::before,
body.theme-light .sidebar-burger span::after,
html.theme-light body .sidebar-burger span,
html.theme-light body .sidebar-burger span::before,
html.theme-light body .sidebar-burger span::after {
    background: #374151;
}

body.theme-light .sidebar.sidebar-open .sidebar-nav,
html.theme-light body .sidebar.sidebar-open .sidebar-nav {
    border-top-color: rgba(209, 213, 219, 0.5);
}

body.theme-light .card h2,
html.theme-light body .card h2 {
    color: #111827;
}

body.theme-light label,
html.theme-light body label {
    color: #374151;
}

/* Light theme overrides for projects & pages */
body.theme-light .project-item,
html.theme-light body .project-item {
    background: #f9fafb;
    border-color: rgba(209, 213, 219, 0.9);
}

body.theme-light .project-name-link .project-name,
html.theme-light body .project-name-link .project-name {
    color: #111827;
}

body.theme-light .project-name-link:hover .project-name,
html.theme-light body .project-name-link:hover .project-name {
    color: #2563eb;
}

body.theme-light .project-url,
html.theme-light body .project-url {
    color: #6b7280;
}

body.theme-light .project-region,
html.theme-light body .project-region {
    color: #6b7280;
}

/* Стили для информации о домене */
.project-domain-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.domain-expires-date {
    color: #e5e7eb;
}

.domain-expires-date.domain-expiring-soon {
    color: #fca5a5;
}

.domain-expires-date.domain-expired {
    color: #ef4444;
    font-weight: 600;
}

.domain-warning-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #dc2626;
    color: #ffffff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.domain-warning-badge.domain-not-renewed {
    background: #dc2626;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Стили для светлой темы */
body.theme-light .project-domain-info,
html.theme-light body .project-domain-info {
    border-top-color: rgba(209, 213, 219, 0.5);
}

body.theme-light .domain-expires-date,
html.theme-light body .domain-expires-date {
    color: #374151;
}

body.theme-light .domain-expires-date.domain-expiring-soon,
html.theme-light body .domain-expires-date.domain-expiring-soon {
    color: #dc2626;
}

body.theme-light .domain-expires-date.domain-expired,
html.theme-light body .domain-expires-date.domain-expired {
    color: #dc2626;
    font-weight: 600;
}

body.theme-light .project-stat-label,
html.theme-light body .project-stat-label {
    color: #6b7280;
}

body.theme-light .project-stat-value,
html.theme-light body .project-stat-value {
    color: #111827;
}

body.theme-light .icon-btn,
html.theme-light body .icon-btn {
    background: #f3f4f6;
    border-color: rgba(209, 213, 219, 0.9);
    color: #374151;
}

body.theme-light .icon-btn-settings:hover,
html.theme-light body .icon-btn-settings:hover,
body.theme-light .icon-btn-refresh-blue:hover,
html.theme-light body .icon-btn-refresh-blue:hover,
body.theme-light .icon-btn-download-core:hover,
html.theme-light body .icon-btn-download-core:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

body.theme-light .icon-btn-refresh-green:hover,
html.theme-light body .icon-btn-refresh-green:hover,
body.theme-light .icon-btn-add-page:hover,
html.theme-light body .icon-btn-add-page:hover {
    background: #22c55e;
    border-color: #22c55e;
    color: #ffffff;
}

body.theme-light .icon-btn-delete:hover,
html.theme-light body .icon-btn-delete:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

/* Синий ховер для всех остальных иконок в светлой теме */
body.theme-light .icon-btn-menu:hover,
html.theme-light body .icon-btn-menu:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

body.theme-light .icon-btn:not(.icon-btn-refresh-green):not(.icon-btn-add-page):not(.icon-btn-delete):not(.icon-btn-menu):hover,
html.theme-light body .icon-btn:not(.icon-btn-refresh-green):not(.icon-btn-add-page):not(.icon-btn-delete):not(.icon-btn-menu):hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

body.theme-light .badge,
html.theme-light body .badge {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

body.theme-light .modal-content,
html.theme-light body .modal-content {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 0.9);
}

body.theme-light .modal-header h2,
html.theme-light body .modal-header h2 {
    color: #111827;
}

body.theme-light .modal-close,
html.theme-light body .modal-close {
    border-color: rgba(209, 213, 219, 0.9);
    color: #374151;
}

body.theme-light .modal-close:hover,
html.theme-light body .modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
}

body.theme-light .page-menu-dropdown,
html.theme-light body .page-menu-dropdown {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 0.9);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

body.theme-light .page-menu-item,
html.theme-light body .page-menu-item {
    color: #111827;
}

body.theme-light .page-menu-item:hover,
html.theme-light body .page-menu-item:hover {
    background: #f3f4f6;
}

body.theme-light .page-stat-mini-label,
html.theme-light body .page-stat-mini-label {
    color: #6b7280;
}

body.theme-light .page-stat-mini-value,
html.theme-light body .page-stat-mini-value {
    color: #111827;
}

body.theme-light .page-cluster-link,
html.theme-light body .page-cluster-link {
    color: #111827;
}

body.theme-light .page-item,
html.theme-light body .page-item {
    background: #f9fafb;
    border-color: rgba(209, 213, 219, 0.9);
}

body.theme-light .page-cluster,
html.theme-light body .page-cluster {
    color: #111827;
}

body.theme-light .page-url,
body.theme-light .page-meta-small,
html.theme-light body .page-url,
html.theme-light body .page-meta-small {
    color: #6b7280;
}

body.theme-light .status-code-value,
body.theme-light .status-date-value,
html.theme-light body .status-code-value,
html.theme-light body .status-date-value {
    color: #111827;
}

body.theme-light .meta-label,
html.theme-light body .meta-label {
    color: #6b7280;
}

body.theme-light .meta-value,
html.theme-light body .meta-value {
    color: #111827;
}

body.theme-light .keywords-count,
html.theme-light body .keywords-count {
    color: #6b7280;
}

/* График статистики */
#keywords-statistics-chart,
#project-statistics-chart {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.3);
}

body.theme-light #keywords-statistics-chart,
html.theme-light body #keywords-statistics-chart,
body.theme-light #project-statistics-chart,
html.theme-light body #project-statistics-chart {
    background: transparent;
    border-color: rgba(209, 213, 219, 0.9);
}

#keywords-statistics-chart {
    background: transparent;
}

/* Убираем вертикальный скролл у графика */
#keywords-statistics-chart > div[style*="overflow-x"],
#project-statistics-chart > div[style*="overflow-x"] {
    overflow-y: visible !important;
}

/* Блок отображения основного текста */
.main-text-display {
    padding: 16px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    min-height: 100px;
    color: #e5e7eb;
}

body.theme-light .main-text-display,
html.theme-light body .main-text-display {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 0.9);
    color: #111827;
}

body.theme-light #keywords-statistics-chart h3,
html.theme-light body #keywords-statistics-chart h3,
body.theme-light #project-statistics-chart h3,
html.theme-light body #project-statistics-chart h3 {
    color: #111827;
}

/* Стили для контейнера графиков */
#project-charts-container,
#page-charts-container {
    color: #e5e7eb;
}

body.theme-light #project-charts-container,
html.theme-light body #project-charts-container,
body.theme-light #page-charts-container,
html.theme-light body #page-charts-container {
    color: #111827;
}

/* Стили для заголовков графиков */
#project-charts-container h3,
#page-charts-container h3 {
    color: #e5e7eb;
}

body.theme-light #project-charts-container h3,
html.theme-light body #project-charts-container h3,
body.theme-light #page-charts-container h3,
html.theme-light body #page-charts-container h3 {
    color: #111827;
}

/* Стили для кнопок переключения графиков */
.chart-switch-btn {
    color: #e5e7eb;
}

body.theme-light .chart-switch-btn,
html.theme-light body .chart-switch-btn {
    color: #111827;
}

body.theme-light .chart-switch-btn.active,
html.theme-light body .chart-switch-btn.active {
    color: #111827;
    background: rgba(59, 130, 246, 0.2) !important;
}

/* Стили для кнопок включения/выключения линий */
.line-toggle-btn {
    color: #e5e7eb;
}

body.theme-light .line-toggle-btn,
html.theme-light body .line-toggle-btn {
    color: #111827;
}

body.theme-light .line-toggle-btn.active,
html.theme-light body .line-toggle-btn.active {
    color: #111827;
}

/* Стили для текста в графиках */
#project-charts-container .chart-view,
#page-charts-container .chart-view {
    color: #e5e7eb;
}

body.theme-light #project-charts-container .chart-view,
html.theme-light body #project-charts-container .chart-view,
body.theme-light #page-charts-container .chart-view,
html.theme-light body #page-charts-container .chart-view {
    color: #111827;
}

/* Стили для подписей дат в графиках */
.chart-column > div[style*="font-size: 10px"] {
    color: #9ca3af;
}

body.theme-light .chart-column > div[style*="font-size: 10px"],
html.theme-light body .chart-column > div[style*="font-size: 10px"] {
    color: #6b7280;
}

/* Стили для легенды кругового графика */
#pie-chart-canvas div[style*="color: #e5e7eb"] {
    color: #e5e7eb;
}

body.theme-light #pie-chart-canvas div[style*="color: #e5e7eb"],
html.theme-light body #pie-chart-canvas div[style*="color: #e5e7eb"],
body.theme-light #pie-chart-canvas span,
html.theme-light body #pie-chart-canvas span,
body.theme-light .pie-legend-item,
html.theme-light body .pie-legend-item,
body.theme-light .pie-legend-label,
html.theme-light body .pie-legend-label,
body.theme-light .chart-no-data,
html.theme-light body .chart-no-data {
    color: #111827;
}

body.theme-light .chart-date-label,
html.theme-light body .chart-date-label {
    color: #6b7280;
}

/* Стили для модального окна выбора дат */
body.theme-light #date-selector-list,
html.theme-light body #date-selector-list {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 0.9);
}

body.theme-light #date-selector-list label,
html.theme-light body #date-selector-list label {
    color: #111827;
}

body.theme-light #date-selector-list label:hover,
html.theme-light body #date-selector-list label:hover {
    background: #f3f4f6 !important;
}

body.theme-light #keywords-statistics-chart .chart-tooltip,
html.theme-light body #keywords-statistics-chart .chart-tooltip,
body.theme-light #project-statistics-chart .chart-tooltip,
html.theme-light body #project-statistics-chart .chart-tooltip {
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
}

body.theme-light #keywords-statistics-chart div[style*="writing-mode"],
html.theme-light body #keywords-statistics-chart div[style*="writing-mode"] {
    color: #111827;
}

/* Структура статьи - как в блокноте */
.structure-text-display {
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #e5e7eb;
}

body.theme-light .structure-text-display,
html.theme-light body .structure-text-display {
    color: #000000;
}

/* Комментарий анализа текста */
#text-analysis-comment-content {
    color: #e5e7eb;
}

body.theme-light #text-analysis-comment-content,
html.theme-light body #text-analysis-comment-content {
    color: #111827;
}

/* Кнопки в заголовках блоков */
.collapsible-header .icon-btn {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.collapsible-header .icon-btn:hover {
    opacity: 1;
}

.collapsible-header .icon-btn:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 960px) {
    body {
        overflow-x: hidden;
    }

    .container {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }

    .sidebar {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
        gap: 0;
        position: static;
        order: -1;
        margin-bottom: 0;
    }

    .sidebar-top {
        margin-bottom: 0;
    }

    .logo-text {
        min-width: 0;
    }

    .logo-subtitle {
        display: none;
    }

    .sidebar-top-actions {
        gap: 8px;
        flex-shrink: 0;
    }

    .sidebar-burger {
        display: inline-flex;
    }

    .theme-toggle-icon {
        display: inline-flex;
    }

    .sidebar-nav {
        display: none;
        flex-direction: column;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(148, 163, 184, 0.3);
    }

    .sidebar.sidebar-open .sidebar-nav {
        display: flex;
    }

    .nav-link {
        padding: 8px 10px;
        font-size: 14px;
    }

    .content {
        padding: 18px 16px;
    }

    .tool-section {
        max-width: 100%;
    }

    .row {
        flex-direction: column;
    }
}

/* Top Analysis Tool Styles */
.top-results-container {
    margin-top: 24px;
}

.top-results-container .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.top-results-container .card-header h2 {
    margin: 0;
}

.top-keyword-block {
    margin-bottom: 24px;
}

.top-keyword-block:last-child {
    margin-bottom: 0;
}

.top-keyword-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.top-keyword-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #e5e7eb;
}

.secondary-btn.small {
    padding: 6px 14px;
    font-size: 12px;
}

.error-message {
    color: var(--danger-color);
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-top: 12px;
}

body.theme-light .top-keyword-header h3,
html.theme-light body .top-keyword-header h3 {
    color: var(--text-color);
}

body.theme-light .error-message,
html.theme-light body .error-message {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

/* SERP Checker Tool Styles */
.serp-result-info {
    margin-top: 12px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.serp-position,
.serp-url {
    margin-bottom: 8px;
    font-size: 13px;
    color: #e5e7eb;
}

.serp-position:last-child,
.serp-url:last-child {
    margin-bottom: 0;
}

.serp-position strong,
.serp-url strong {
    color: #d1d5db;
    margin-right: 8px;
}

body.theme-light .serp-result-info,
html.theme-light body .serp-result-info {
    background: rgba(249, 250, 251, 0.8);
    border-color: rgba(209, 213, 219, 0.5);
}

body.theme-light .serp-position,
body.theme-light .serp-url,
html.theme-light body .serp-position,
html.theme-light body .serp-url {
    color: var(--text-color);
}

body.theme-light .serp-position strong,
body.theme-light .serp-url strong,
html.theme-light body .serp-position strong,
html.theme-light body .serp-url strong {
    color: var(--text-color);
}

/* SERP Checker Method Block Styles */
.serp-method-block {
    margin-bottom: 24px;
}

.serp-method-block:last-child {
    margin-bottom: 0;
}

.serp-method-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.serp-method-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #e5e7eb;
}

.serp-method-status {
    margin-bottom: 12px;
}

.serp-method-table {
    margin-top: 12px;
}

.icon-btn-copy {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.icon-btn-copy:hover {
    background: rgba(59, 130, 246, 0.9);
    border-color: rgba(59, 130, 246, 0.9);
    color: #ffffff;
    transform: scale(1.05);
}

.icon-btn-copy:active {
    transform: scale(0.95);
}

.icon-btn-copy svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

body.theme-light .serp-method-header h3,
html.theme-light body .serp-method-header h3 {
    color: var(--text-color);
}

body.theme-light .icon-btn-copy,
html.theme-light body .icon-btn-copy {
    background: rgba(249, 250, 251, 0.9);
    border-color: rgba(209, 213, 219, 0.6);
    color: var(--text-color);
}

body.theme-light .icon-btn-copy:hover,
html.theme-light body .icon-btn-copy:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

/* Стили для модального окна импорта CSV */
.import-csv-info {
    margin-bottom: 20px;
}

.import-csv-description {
    margin-bottom: 16px;
    color: #d1d5db;
}

.import-csv-columns-info {
    background: rgba(148, 163, 184, 0.1);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.import-csv-columns-info h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    color: #e5e7eb;
}

.import-csv-columns-info ul {
    margin: 0;
    padding-left: 20px;
    color: #d1d5db;
    line-height: 1.8;
}

.import-csv-columns-list li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.import-csv-columns-list .column-name {
    font-family: 'Courier New', monospace;
    color: #3b82f6;
    min-width: 150px;
    flex-shrink: 0;
}

.import-csv-columns-list .column-description {
    flex: 1;
}

.import-csv-example-link {
    margin-bottom: 16px;
}

.import-csv-example-link .secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.csv-file-drop-zone {
    position: relative;
}

.csv-file-drop-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.csv-file-drop-area {
    border: 2px dashed rgba(148, 163, 184, 0.5);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(31, 41, 55, 0.5);
    cursor: pointer;
}

.csv-file-drop-area:hover {
    border-color: rgba(59, 130, 246, 0.7);
    background: rgba(31, 41, 55, 0.7);
}

.csv-file-drop-area.drag-over {
    border-color: rgba(59, 130, 246, 1);
    background: rgba(59, 130, 246, 0.1);
}

.csv-file-drop-area svg {
    color: #9ca3af;
    margin-bottom: 12px;
}

.csv-drop-text {
    margin: 0;
    color: #d1d5db;
    font-size: 14px;
}

.csv-drop-link {
    color: #3b82f6;
    text-decoration: underline;
    cursor: pointer;
}

.csv-drop-link:hover {
    color: #2563eb;
}

.csv-file-name {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
    color: #3b82f6;
    font-size: 14px;
    font-weight: 500;
}

.import-csv-status {
    margin-top: 12px;
    display: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
}

.import-csv-status[style*="color: #fca5a5"] {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.import-csv-status[style*="color: #10b981"] {
    background: rgba(16, 185, 129, 0.1) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.import-csv-status[style*="color: #fbbf24"] {
    background: rgba(251, 191, 36, 0.1) !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
}

/* Светлая тема для модального окна импорта */
body.theme-light .import-csv-description,
html.theme-light body .import-csv-description {
    color: #374151;
}

body.theme-light .import-csv-columns-info,
html.theme-light body .import-csv-columns-info {
    background: rgba(243, 244, 246, 0.8);
}

body.theme-light .import-csv-columns-info h3,
html.theme-light body .import-csv-columns-info h3 {
    color: #111827;
}

body.theme-light .import-csv-columns-info ul,
html.theme-light body .import-csv-columns-info ul {
    color: #374151;
}

body.theme-light .csv-file-drop-area,
html.theme-light body .csv-file-drop-area {
    border-color: rgba(209, 213, 219, 0.7);
    background: rgba(249, 250, 251, 0.8);
}

body.theme-light .csv-file-drop-area:hover,
html.theme-light body .csv-file-drop-area:hover {
    border-color: rgba(59, 130, 246, 0.7);
    background: rgba(239, 246, 255, 0.9);
}

body.theme-light .csv-file-drop-area.drag-over,
html.theme-light body .csv-file-drop-area.drag-over {
    border-color: rgba(59, 130, 246, 1);
    background: rgba(239, 246, 255, 1);
}

body.theme-light .csv-file-drop-area svg,
html.theme-light body .csv-file-drop-area svg {
    color: #6b7280;
}

body.theme-light .csv-drop-text,
html.theme-light body .csv-drop-text {
    color: #374151;
}

body.theme-light .csv-file-name,
html.theme-light body .csv-file-name {
    background: rgba(239, 246, 255, 0.8);
    color: #2563eb;
}

body.theme-light .import-csv-status,
html.theme-light body .import-csv-status {
    color: #111827;
}

/* Информация о разделителе */
.import-csv-delimiter-info {
    margin-top: 16px;
    padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    border-left: 3px solid rgba(59, 130, 246, 0.5);
}

.delimiter-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.delimiter-info-row p {
    margin: 0;
    color: #d1d5db;
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
}

.import-csv-delimiter-info code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #3b82f6;
}

.csv-delimiter-input-inline {
    width: 60px;
    font-family: 'Courier New', monospace;
    text-align: center;
    font-size: 16px;
    padding: 6px 8px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 6px;
    background: rgba(31, 41, 55, 0.5);
    color: #e5e7eb;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.csv-delimiter-input-inline:focus {
    border-color: rgba(59, 130, 246, 0.85);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.6);
    background: rgba(15, 23, 42, 0.98);
}

.delimiter-hint-text {
    margin: 0;
    font-size: 13px;
    opacity: 0.8;
    color: #d1d5db;
}

/* Светлая тема для информации о разделителе */
body.theme-light .import-csv-delimiter-info,
html.theme-light body .import-csv-delimiter-info {
    background: rgba(239, 246, 255, 0.8);
    border-left-color: rgba(59, 130, 246, 0.7);
}

body.theme-light .delimiter-info-row p,
html.theme-light body .delimiter-info-row p {
    color: #374151;
}

body.theme-light .import-csv-delimiter-info code,
html.theme-light body .import-csv-delimiter-info code {
    background: rgba(255, 255, 255, 0.8);
    color: #2563eb;
}

body.theme-light .csv-delimiter-input-inline,
html.theme-light body .csv-delimiter-input-inline {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(209, 213, 219, 0.7);
    color: #111827;
}

body.theme-light .csv-delimiter-input-inline:focus,
html.theme-light body .csv-delimiter-input-inline:focus {
    border-color: rgba(59, 130, 246, 0.85);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.6);
    background: #ffffff;
}

body.theme-light .delimiter-hint-text,
html.theme-light body .delimiter-hint-text {
    color: #6b7280;
}

/* Вкладки (Tabs) */
.tabs-container {
    margin-bottom: 18px;
}

.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    margin-bottom: 18px;
}

.tab-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: #e5e7eb;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Кнопки */
.btn-primary,
.primary-btn {
    background-image: var(--accent-gradient);
    color: var(--white);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.55);
    padding: 9px 18px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.btn-primary:hover,
.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.8);
}

.btn-secondary,
.secondary-btn {
    background: rgba(31, 41, 55, 0.9);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.6);
    padding: 9px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.btn-secondary:hover,
.secondary-btn:hover {
    background: rgba(31, 41, 55, 1);
}

.btn-danger,
.danger-btn {
    background: rgba(239, 68, 68, 0.9);
    color: var(--white);
    padding: 9px 18px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.btn-danger:hover,
.danger-btn:hover {
    background: rgba(220, 38, 38, 1);
}

/* Заголовок карточки */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.card-header h2 {
    margin: 0;
    font-size: 18px;
    color: #e5e7eb;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Фильтры */
.filters-row {
    display: flex;
    gap: 18px;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* Загрузка */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted-text);
    font-size: 14px;
}

/* Список API ключей */
.api-keys-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.api-key-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.api-key-item:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(15, 23, 42, 0.8);
}

.api-key-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.api-key-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.api-key-title {
    font-size: 15px;
    font-weight: 600;
    color: #e5e7eb;
}

.api-key-meta {
    font-size: 12px;
    color: #9ca3af;
}

.api-key-actions {
    display: flex;
    gap: 8px;
}

.api-key-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.api-key-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.api-key-detail-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-key-detail-value {
    font-size: 14px;
    color: #e5e7eb;
    font-weight: 500;
}

.api-key-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.api-key-status.active {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.api-key-status.inactive {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* Очередь проектов */
.queue-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.queue-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.queue-item:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(15, 23, 42, 0.8);
}

.queue-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.queue-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.queue-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #e5e7eb;
}

.queue-item-meta {
    font-size: 12px;
    color: #9ca3af;
}

.queue-item-actions {
    display: flex;
    gap: 8px;
}

.queue-item-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 128, 0.2);
}

.queue-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.queue-status.pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fcd34d;
}

.queue-status.processing {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.queue-status.completed {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.queue-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Статистика */
.statistics-overall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}

.stat-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}

.stat-card-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.stat-card-unit {
    font-size: 12px;
    color: #9ca3af;
}

/* Таблицы */
.table-container {
    overflow-x: auto;
}

/* Пагинация */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Иконки кнопок */
.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    padding: 0;
}

.icon-btn:hover {
    background: rgba(31, 41, 55, 0.9);
    border-color: rgba(148, 163, 184, 0.7);
}

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

/* Светлая тема */
body.theme-light .tab-btn {
    color: #6b7280;
}

body.theme-light .tab-btn:hover {
    color: #111827;
}

body.theme-light .tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

body.theme-light .api-key-item,
body.theme-light .queue-item {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 0.7);
}

body.theme-light .api-key-item:hover,
body.theme-light .queue-item:hover {
    background: #f9fafb;
    border-color: rgba(59, 130, 246, 0.5);
}

body.theme-light .api-key-title,
body.theme-light .queue-item-title {
    color: #111827;
}

body.theme-light .api-key-meta,
body.theme-light .queue-item-meta {
    color: #6b7280;
}

.error-text {
    color: #fca5a5;
    font-size: 12px;
}

body.theme-light .error-text {
    color: #dc2626;
}

body.theme-light .api-key-detail-value {
    color: #111827;
}

body.theme-light .api-key-detail-label {
    color: #6b7280;
}

body.theme-light .stat-card {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 0.7);
}

body.theme-light .stat-card-value {
    color: #111827;
}

body.theme-light .stat-card-label {
    color: #6b7280;
}

body.theme-light .stat-card-unit {
    color: #6b7280;
}

body.theme-light .card-header {
    border-bottom-color: rgba(209, 213, 219, 0.7);
}

body.theme-light .card-header h2 {
    color: #111827;
}

body.theme-light .queue-item-details {
    border-top-color: rgba(209, 213, 219, 0.5);
}

body.theme-light .api-key-details {
    border-top-color: rgba(209, 213, 219, 0.5);
}

body.theme-light .icon-btn {
    background: #ffffff;
    border-color: rgba(209, 213, 219, 0.7);
    color: #111827;
}

body.theme-light .icon-btn:hover {
    background: #f9fafb;
    border-color: rgba(148, 163, 184, 0.8);
}

body.theme-light .loading {
    color: #6b7280;
}

body.theme-light .hint {
    color: #6b7280;
}

/* Стили для плашки статуса съема позиций */
.positions-status-message {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    color: #d1d5db;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

body.theme-light .positions-status-message,
html.theme-light body .positions-status-message {
    color: #111827 !important;
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

/* Светлая тема для списка столбцов */
body.theme-light .import-csv-columns-list .column-name,
html.theme-light body .import-csv-columns-list .column-name {
    color: #2563eb;
}


