:root {
    color-scheme: light;
    --bg-page: #f5f6fb;
    --bg-panel: #ffffff;
    --bg-body: #f9fbff;
    --bg-hover: rgba(37, 99, 235, 0.06);
    --border-light: #e1e5ef;
    --border-strong: #c7cede;
    --text-primary: #1f2432;
    --text-secondary: #596078;
    --text-muted: #8c92a8;
    --accent: #2563eb;
    --accent-soft: #e7efff;
    --success: #22c55e;
    --warning: #f97316;
    --danger: #ef4444;
    --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    --radius: 14px;
    --font-base: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-base);
    background: var(--bg-page) !important;
    color: var(--text-primary);
    min-height: 100vh;
}

.layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-end;
}

.header__info {
    max-width: 620px;
}

.header__title {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.header__subtitle {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 15px;
}

.header__controls {
    display: flex;
    gap: 16px;
    align-items: stretch;
    flex-wrap: wrap;
}

.header-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
    flex: 1 1 0;
}

.header-control--auto {
    flex: 0 0 auto;
}

.header-control__action {
    width: 100%;
}

@media (max-width: 1024px) {
    .header__controls {
        flex-direction: column;
        align-items: stretch;
    }

    .header-control,
    .header-control--auto {
        width: 100%;
    }
}

/* Balance Widget */
.balance-widget {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    font-weight: 600;
    font-size: 15px;
    color: #047857;
    min-width: 120px;
    transition: all 0.2s ease;
}

.balance-widget--warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fcd34d;
    color: #b45309;
}

.balance-widget--danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fca5a5;
    color: #b91c1c;
}

.balance-widget--loading {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #6b7280;
}

.balance-widget__icon {
    font-size: 16px;
}

.balance-widget__amount {
    font-variant-numeric: tabular-nums;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.field__label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.field__select,
.field__textarea {
    font-family: inherit;
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: #fff;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.field__select:focus,
.field__textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.field__textarea {
    resize: vertical;
    min-height: 120px;
}

.content {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 24px;
    align-items: flex-start;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.column--sidebar {
    position: sticky;
    top: 24px;
    align-self: flex-start;
}

.panel {
    background: var(--bg-panel);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    padding: 20px 22px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.panel__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.panel__title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
}

.panel__subtitle {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.panel__meta {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.panel__header--collapsible {
    cursor: pointer;
    user-select: none;
}

.panel__collapse-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s, transform 0.2s;
}

.panel__collapse-btn:hover {
    background: var(--bg-hover);
}

.panel.is-collapsed .panel__collapse-btn {
    transform: rotate(-90deg);
}

.panel.is-collapsed .guide-list,
.panel.is-collapsed .panel__body {
    display: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.badge--idle {
    color: var(--warning);
    background: #fff2e6;
    border-color: #ffe2c2;
}

.badge--online {
    color: var(--success);
    background: #e6f9ef;
    border-color: #c5f0d8;
}

.badge--offline {
    color: var(--danger);
    background: #fee6e6;
    border-color: #fbc4c4;
}

.badge--typing {
    color: var(--accent);
    background: #eaf0ff;
    border-color: #d4e1ff;
}

.badge--demo {
    color: #6d28d9;
    background: #f1e9fe;
    border-color: #dcc8fb;
}

.badge--error {
    color: var(--danger);
    background: #fee6e6;
    border-color: #fbc4c4;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: #fff;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
    border-color: var(--accent);
}

.button--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.button--primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.button--ghost {
    background: transparent;
}

.button--dashed {
    background: #f8fafc;
    border: 2px dashed var(--border-strong);
    color: var(--text-secondary);
}

.button--dashed:hover {
    border-color: var(--accent);
    background: #f0f7ff;
    color: var(--accent);
}

.button--large {
    padding: 14px 24px;
    font-size: 16px;
}

.button--full {
    width: 100%;
}

.button--icon {
    padding: 8px;
    border-radius: 8px;
    line-height: 1;
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.button--icon:hover {
    background: var(--bg-page);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.button--danger {
    background: #fee6e6;
    color: var(--danger);
    border-color: #fecaca;
}

.button--danger:hover {
    background: #fecaca;
    border-color: #fca5a5;
}

.button--close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
    width: 24px;
    height: 24px;
}

.button--close:hover {
    color: var(--danger);
    background: #fee6e6;
}

.button--small {
    padding: 6px 12px;
    font-size: 13px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.summary-card {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: linear-gradient(135deg, #ffffff 0%, #f6f9ff 100%);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-card__label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.summary-card__value {
    font-size: 22px;
    font-weight: 600;
}

.insights-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.insights-list li {
    padding: 12px 14px;
    border-radius: 10px;
    background: #eef2ff;
    color: var(--text-secondary);
    border-left: 4px solid var(--accent);
    line-height: 1.4;
}

.table-wrapper {
    border-radius: 12px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #f0f4ff;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 12px;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
}

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

.data-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.06);
}

.placeholder {
    padding: 16px;
    border-radius: 10px;
    border: 1px dashed var(--border-strong);
    background: #f5f7ff;
    color: var(--text-secondary);
    font-size: 14px;
}

.hidden {
    display: none !important;
}

.metrica-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.metrica-card {
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 14px 16px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metrica-card--linked {
    border-color: var(--accent);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
}

.metrica-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.metrica-card__metric {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
}

.panel--chat {
    gap: 16px;
}

.panel--guide {
    gap: 16px;
}

.guide-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--text-secondary);
}

.guide-list li strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
}

.guide-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.guide-link::after {
    content: "↗";
    font-size: 12px;
}

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

.chat-history {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 14px;
    background: #f9fbff;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 460px;
    overflow-y: auto;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid var(--border-light);
}

.message--user {
    background: #eef2ff;
    border-color: rgba(37, 99, 235, 0.35);
}

.message__meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.message__content {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.55;
    white-space: pre-wrap;
}

.message__tools {
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 6px;
    border-top: 1px solid var(--border-light);
}

.chat-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-form__field .field__label {
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-secondary);
}

.chat-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.tool-visual {
    margin-top: 8px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.tool-visual__header {
    background: #f8fafc;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-visual__content {
    padding: 12px;
    font-size: 13px;
    color: var(--text-primary);
    overflow-x: auto;
}

.campaign-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.campaign-preview__row {
    display: flex;
    gap: 8px;
}

.campaign-preview__section {
    margin-top: 8px;
    border-top: 1px dashed var(--border-light);
    padding-top: 8px;
}

.campaign-preview__list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.campaign-preview__list li {
    background: #f9fbff;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.tag {
    display: inline-block;
    background: #eef2ff;
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-right: 4px;
    margin-top: 4px;
}

.text-small {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.highlight {
    color: var(--success);
    font-weight: bold;
}

.params-preview, .action-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.simple-list {
    list-style: disc;
    padding-left: 18px;
    margin: 4px 0 0;
    color: var(--text-secondary);
}

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

    .column--sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .layout {
        padding: 24px 16px 32px;
    }

    .header__title {
        font-size: 24px;
    }

    .button {
        width: 100%;
    }

    .header__controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== Modal Styles ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

.modal__content {
    position: relative;
    background: var(--bg-panel);
    border-radius: var(--radius);
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.25);
    width: 100%;
    max-width: 440px;
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
}

.modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal__close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal__close:hover {
    color: var(--danger);
}

.modal__body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal__instruction {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal__help {
    text-align: right;
}

.help-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
}

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

.help-text {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 14px 16px;
}

.help-text ol {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 22px;
    border-top: 1px solid var(--border-light);
    background: #f9fbff;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Auth Status */
.auth-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.auth-status__icon {
    font-size: 18px;
}

.auth-status--waiting {
    background: #fff7ed;
    color: var(--warning);
    border: 1px solid #fed7aa;
}

.auth-status--loading {
    background: #eef2ff;
    color: var(--accent);
    border: 1px solid #c7d2fe;
}

.auth-status--success {
    background: #ecfdf5;
    color: var(--success);
    border: 1px solid #a7f3d0;
}

.auth-status--error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

/* Field Input */
.field__input {
    font-family: inherit;
    font-size: 15px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: #fff;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.field__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.field__input::placeholder {
    color: var(--text-muted);
}

.field__input:disabled {
    background: #f5f7fa;
    cursor: not-allowed;
}

/* Button States */
.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button--loading {
    position: relative;
    pointer-events: none;
}

.button--loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* === Streaming styles === */
.message--streaming {
    position: relative;
}

.typing-cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: var(--accent);
    font-weight: bold;
}

@keyframes blink {
    50% { opacity: 0; }
}

.message__tools-container {
    margin-top: 8px;
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 6px;
    margin-bottom: 4px;
}

.tool-badge--loading {
    background: var(--accent-soft);
    color: var(--accent);
    animation: pulse 1.5s ease-in-out infinite;
}

.tool-badge--done {
    background: #dcfce7;
    color: #16a34a;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.error-text {
    color: var(--danger);
    font-weight: 500;
}

/* ===== Auth Pages Styles ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #f5f6fb 0%, #e7efff 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo__icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.auth-logo__title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-logo__subtitle {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-panel {
    background: var(--bg-panel);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    padding: 32px;
}

.auth-panel__title {
    margin: 0 0 24px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form .field {
    gap: 8px;
}

.auth-form .field__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: normal;
}

.auth-form .button {
    margin-top: 8px;
    padding: 14px 18px;
    font-size: 15px;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-error {
    padding: 12px 14px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    font-size: 14px;
    display: none;
}

.auth-error.visible {
    display: block;
}

.auth-success {
    padding: 12px 14px;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: var(--success);
    font-size: 14px;
    display: none;
}

.auth-success.visible {
    display: block;
}

.password-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Navigation Bar ===== */
.navbar {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-light);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.navbar__inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    gap: 16px;
    padding: 8px 0;
}

.navbar__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    white-space: nowrap;
}

.navbar__brand-icon {
    font-size: 22px;
}

/* Hamburger Menu Button */
.navbar__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.navbar__hamburger:hover {
    background: var(--accent-soft);
}

.navbar__hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.navbar__hamburger.is-active .navbar__hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.navbar__hamburger.is-active .navbar__hamburger-line:nth-child(2) {
    opacity: 0;
}

.navbar__hamburger.is-active .navbar__hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.navbar__nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.navbar__link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    min-width: 0;
}

.navbar__link:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.navbar__link--active {
    background: var(--accent-soft);
    color: var(--accent);
}

.navbar__link-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Navbar Dropdown */
.navbar__dropdown {
    position: relative;
}

.navbar__dropdown-toggle {
    border: none;
    background: none;
    cursor: pointer;
}

.navbar__dropdown-toggle[aria-expanded="true"] .navbar__dropdown-arrow {
    transform: rotate(180deg);
}

.navbar__dropdown-arrow {
    font-size: 10px;
    margin-left: 2px;
    opacity: 0.6;
    transition: transform 0.2s;
}

.navbar__dropdown:hover .navbar__dropdown-arrow {
    transform: rotate(180deg);
}

.navbar__dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 1000;
}

.navbar__dropdown:hover .navbar__dropdown-menu,
.navbar__dropdown.is-active .navbar__dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

/* Touch devices - click to open */
@media (hover: none) and (pointer: coarse) {
    .navbar__dropdown:hover .navbar__dropdown-menu {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
    }
    
    .navbar__dropdown.is-active .navbar__dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(4px);
    }
}

.navbar__dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.navbar__dropdown-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.navbar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.navbar__user-info {
    text-align: right;
}

.navbar__user-email {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar__user-role {
    font-size: 10px;
    color: var(--text-muted);
}

.navbar__logout {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.navbar__logout:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* Средние экраны — компактный режим */
@media (max-width: 1200px) {
    .navbar__nav {
        gap: 2px;
    }
    
    .navbar__link {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .navbar__link-icon {
        font-size: 14px;
    }
    
    .navbar__dropdown-arrow {
        font-size: 8px;
        opacity: 0.5;
    }
    
    .navbar__user-info {
        display: none;
    }
}

/* Планшеты */
@media (max-width: 960px) {
    .navbar__inner {
        flex-wrap: wrap;
        padding: 10px 0;
    }
    
    .navbar__nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
        margin-top: 8px;
        padding-top: 10px;
        border-top: 1px solid var(--border-light);
    }
    
    .navbar__link {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .navbar__hamburger {
        display: flex;
    }
    
    .navbar__nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: var(--bg-panel);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 80px 0 20px;
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        box-shadow: -4px 0 20px rgba(15, 23, 42, 0.15);
    }
    
    .navbar__nav.is-open {
        right: 0;
    }
    
    .navbar__link,
    .navbar__dropdown {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 20px;
        border-radius: 0;
    }
    
    .navbar__dropdown {
        flex-direction: column;
        align-items: stretch;
    }
    
    .navbar__dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 12px 20px;
    }
    
    .navbar__dropdown-arrow {
        display: block !important;
        margin-left: auto;
    }
    
    .navbar__dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: var(--accent-soft);
    }
    
    .navbar__dropdown.is-active .navbar__dropdown-menu {
        max-height: 500px;
        padding: 8px 0;
    }
    
    .navbar__dropdown-item {
        padding: 10px 20px 10px 40px;
    }
    
    .navbar__user-info {
        display: none;
    }
}

/* Mobile Navigation Backdrop */
.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
}

.mobile-nav-backdrop.is-active {
    opacity: 1;
    visibility: visible;
}

/* Close button for mobile menu */
@media (max-width: 768px) {
    .navbar__nav::before {
        content: '✕';
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: var(--text-muted);
        cursor: pointer;
        border-radius: 8px;
        transition: background 0.2s, color 0.2s;
    }
    
    .navbar__nav::before:hover {
        background: var(--accent-soft);
        color: var(--accent);
    }
}

/* Layout with navbar */
.layout--with-nav {
    padding-top: 0;
}

/* ===== Reports Page Styles ===== */
.content--single {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reports-filters {
    padding: 16px 20px;
}

.filters-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filters-row .field {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

.filters-row .button {
    flex-shrink: 0;
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Report Card */
.report-card {
    background: var(--bg-panel);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.report-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
}

.report-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-card__status {
    font-size: 10px;
    padding: 4px 8px;
}

.report-card__status::before {
    width: 6px;
    height: 6px;
}

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

.report-card__body {
    flex: 1;
}

.report-card__title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.report-card__campaign {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.report-card__preview {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.report-card__preview-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.report-card__preview-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.report-card__preview-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.report-card__progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-bar__label {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.report-card__actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.report-card__actions .button {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
}

.report-card__delete {
    color: var(--danger) !important;
    border-color: transparent !important;
}

.report-card__delete:hover {
    background: #fef2f2 !important;
    border-color: var(--danger) !important;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.pagination__info {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Field Row */
.field-row {
    display: flex;
    gap: 16px;
}

.field-row .field {
    flex: 1;
}

/* Large Modal */
.modal--large .modal__content--large {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal__body--preview {
    flex: 1;
    padding: 0;
    min-height: 500px;
    display: flex;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Recent Reports Widget */
.recent-reports {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s;
}

.recent-report-item:hover {
    border-color: var(--accent);
    background: #fff;
}

.recent-report-item__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recent-report-item__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.recent-report-item__date {
    font-size: 12px;
    color: var(--text-muted);
}

.recent-report-item__status {
    font-size: 10px;
    padding: 3px 6px;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    margin-top: 8px;
}

.view-all-link:hover {
    text-decoration: underline;
}

.view-all-link::after {
    content: "→";
}

@media (max-width: 768px) {
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .filters-row .field {
        max-width: none;
    }
    
    .modal--large .modal__content--large {
        max-width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

.template-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.template-item:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.template-item__icon {
    font-size: 24px;
}

.template-item__info {
    display: flex;
    flex-direction: column;
}

.template-item__info small {
    color: var(--text-secondary);
}

.tabs--modal .tabs__btn {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
}

.tabs--modal .tabs__btn--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.modal__body .tab-content {
    padding-top: 16px;
}

/* ===== Campaign Management Styles ===== */

/* Actions Column */
.th--actions {
    width: 120px;
    text-align: center;
}

.td--actions {
    text-align: center;
    white-space: nowrap;
}

/* Action Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s, transform 0.1s;
}

.action-btn:hover {
    background: var(--accent-soft);
    transform: scale(1.1);
}

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

.action-btn--play {
    color: var(--success);
}

.action-btn--pause {
    color: var(--warning);
}

.action-btn--menu {
    color: var(--text-secondary);
}

.action-btn--loading {
    pointer-events: none;
    opacity: 0.5;
}

.action-btn--loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
}

/* Context Menu */
.context-menu {
    position: fixed;
    z-index: 1100;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    padding: 6px 0;
    min-width: 180px;
    animation: contextMenuIn 0.15s ease-out;
}

@keyframes contextMenuIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.context-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    text-decoration: none;
}

.context-menu__item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.context-menu__item--link {
    color: var(--text-secondary);
}

.context-menu__item--danger:hover {
    background: #fef2f2;
    color: var(--danger);
}

.context-menu__icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.context-menu__divider {
    height: 1px;
    background: var(--border-light);
    margin: 6px 0;
}

/* Inline Budget Editor */
.inline-budget {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.inline-budget:hover {
    background: var(--accent-soft);
}

.inline-budget__value {
    font-weight: 500;
}

.inline-budget__edit-icon {
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.15s;
    color: var(--accent);
}

.inline-budget:hover .inline-budget__edit-icon {
    opacity: 1;
}

.inline-budget-editor {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.inline-budget-editor__input {
    width: 100px;
    padding: 4px 8px;
    border: 2px solid var(--accent);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}

.inline-budget-editor__input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.inline-budget-editor__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}

.inline-budget-editor__btn--save {
    background: var(--success);
    color: #fff;
}

.inline-budget-editor__btn--save:hover {
    background: #16a34a;
}

.inline-budget-editor__btn--cancel {
    background: var(--border-light);
    color: var(--text-secondary);
}

.inline-budget-editor__btn--cancel:hover {
    background: #d1d5db;
}

/* Campaign Name Link */
.campaign-name-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.campaign-name-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Status Badge in Table */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge--on {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge--off {
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge--suspended {
    background: #fef3c7;
    color: #d97706;
}

.status-badge--archived {
    background: #e5e7eb;
    color: #4b5563;
}

/* Modal Subtitle */
.modal__subtitle {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-panel);
    border-radius: 10px;
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    animation: toastIn 0.3s ease-out;
    max-width: 360px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast--success {
    border-left: 4px solid var(--success);
}

.toast--error {
    border-left: 4px solid var(--danger);
}

.toast--info {
    border-left: 4px solid var(--accent);
}

.toast__icon {
    font-size: 20px;
}

.toast__message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.toast__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    line-height: 1;
}

.toast__close:hover {
    color: var(--text-primary);
}

/* ===== Campaign Page Styles ===== */

/* Breadcrumb */
.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 8px;
}

.breadcrumb:hover {
    color: var(--accent);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-panel);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border-light);
}

.tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.tab:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.tab--active {
    background: var(--accent);
    color: #fff;
}

.tab--active:hover {
    background: var(--accent);
    color: #fff;
}

.tab-content {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Settings Form */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 8px;
}

/* Negatives Section */
.negatives-section {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

@media (max-width: 768px) {
    .negatives-section {
        grid-template-columns: 1fr;
    }
}

.negatives-list-wrapper {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 12px;
}

.negatives-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.negative-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 13px;
}

.negative-item__text {
    color: var(--text-primary);
}

.negative-item__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}

.negative-item__remove:hover {
    background: var(--danger);
    color: #fff;
}

.negatives-add {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.negatives-add .field__textarea {
    min-height: 150px;
}

/* Shared Sets */
.shared-sets-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.shared-sets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.shared-set-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--accent-soft);
    border-radius: 8px;
    font-size: 13px;
    color: var(--accent);
}

.shared-set-badge__unlink {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}

.shared-set-badge__unlink:hover {
    background: var(--danger);
    color: #fff;
}

/* Stats Placeholder */
.stats-placeholder {
    text-align: center;
    padding: 32px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px dashed var(--border-strong);
    margin-top: 16px;
}

.stats-placeholder p {
    margin: 0 0 16px;
    color: var(--text-secondary);
}

/* Error Text */
.error-text {
    color: var(--danger);
}

/* ===== Charts Styles ===== */

/* Chart Section */
.chart-section {
    margin-top: 8px;
}

.chart-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.field__select--small {
    padding: 6px 10px;
    font-size: 13px;
    min-width: 100px;
}

/* Chart Containers */
.chart-container {
    position: relative;
    background: #fafbff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
    overflow: hidden;
}

.chart-container--timeseries {
    height: 350px;
    min-height: 280px;
}

.chart-container--bar {
    height: 320px;
    min-height: 280px;
}

.chart-container--pie {
    height: 350px;
    min-height: 300px;
}

.chart-container--large {
    height: 500px;
    min-height: 400px;
}

.chart-container--fullscreen {
    height: 600px;
    min-height: 500px;
}

/* Chart Loading State */
.chart-container--loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container--loading::after {
    content: "Загрузка данных...";
    color: var(--text-muted);
    font-size: 14px;
}

/* Chart Actions */
.chart-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}

.chart-actions .button {
    padding: 6px 12px;
    font-size: 12px;
}

/* Sparkline */
.sparkline-cell {
    width: 80px;
    height: 30px;
}

.sparkline-cell canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Chart Legend Custom */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    justify-content: center;
}

.chart-legend__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.chart-legend__color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Analytics Page Styles */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.analytics-grid--single {
    grid-template-columns: 1fr;
}

@media (max-width: 900px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* Date Range Picker */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-range-picker__separator {
    color: var(--text-muted);
    font-size: 13px;
}

/* Period Comparison */
.period-comparison {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.period-comparison__label {
    font-size: 13px;
    color: var(--text-secondary);
}

.period-comparison__toggle {
    display: flex;
    gap: 4px;
}

.period-comparison__toggle input[type="checkbox"] {
    display: none;
}

.period-comparison__toggle label {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    background: transparent;
    color: var(--text-secondary);
}

.period-comparison__toggle input:checked + label {
    background: var(--accent);
    color: #fff;
}

/* Chart Tabs */
.chart-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.chart-tab {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.chart-tab:hover {
    color: var(--text-primary);
}

.chart-tab--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Metric Cards with Sparklines */
.metric-card-with-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
}

.metric-card-with-chart__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.metric-card-with-chart__value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-card-with-chart__change {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.metric-card-with-chart__change--positive {
    background: #dcfce7;
    color: #16a34a;
}

.metric-card-with-chart__change--negative {
    background: #fee2e2;
    color: #dc2626;
}

.metric-card-with-chart__label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-card-with-chart__sparkline {
    height: 40px;
    margin-top: 8px;
}

/* Comparison Info */
.comparison-info {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: #f0f4ff;
    border-radius: 8px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    margin-bottom: 16px;
}

.comparison-info__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comparison-info__label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.comparison-info__value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Empty Chart State */
.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    text-align: center;
}

.chart-empty__icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.chart-empty__text {
    font-size: 14px;
}

/* ===== Metrica Page Styles ===== */

/* Header Breadcrumb */
.header__breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.header__breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.header__breadcrumb a:hover {
    text-decoration: underline;
}

/* Tabs - Updated for metrica page */
.tabs__btn {
    flex: none;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.tabs__btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.tabs__btn--active {
    background: var(--accent);
    color: #fff;
}

.tabs__btn--active:hover {
    background: var(--accent);
    color: #fff;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content--active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* Metrica Summary Grid */
.metrica-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.metrica-summary-card {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: linear-gradient(135deg, #ffffff 0%, #f6f9ff 100%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.metrica-summary-card__label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metrica-summary-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.metrica-summary-card__change {
    font-size: 12px;
    font-weight: 600;
}

.metrica-summary-card__change.change--positive {
    color: var(--success);
}

.metrica-summary-card__change.change--negative {
    color: var(--danger);
}

.sparkline-container {
    position: relative;
    height: 50px;
    width: 100%;
    margin-top: auto;
    overflow: hidden;
}

.metrica-summary-card__sparkline {
    width: 100% !important;
    height: 100% !important;
}

/* Compare Toggle */
.compare-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle__slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle input:checked + .toggle__slider {
    background-color: var(--accent);
}

.toggle input:checked + .toggle__slider::before {
    transform: translateX(20px);
}

.toggle__label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Panel Row */
.panel-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.panel--half {
    /* Uses panel styles */
}

@media (max-width: 768px) {
    .panel-row {
        grid-template-columns: 1fr;
    }
}

/* Segment Card */
.segments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.segment-card {
    padding: 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.segment-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
}

.segment-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.segment-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.segment-card__size {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.segment-card__size-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

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

.segment-card__actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.segment-card__actions .button {
    flex: 1;
}

.button--small {
    padding: 8px 12px;
    font-size: 13px;
}

/* Logs Form */
.logs-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.logs-form__actions {
    display: flex;
    justify-content: flex-end;
}

.logs-info {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
}

.logs-info__icon {
    font-size: 20px;
}

.logs-info__text {
    flex: 1;
}

.logs-info__text strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.logs-info__text p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Goal Conditions */
.goal-condition {
    margin-top: 8px;
}

.segment-params {
    margin-top: 8px;
}

/* Wizard */
.wizard-steps {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
}

.wizard-step {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: #f1f5f9;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.wizard-step--active {
    background: var(--accent);
    color: #fff;
}

.wizard-step--completed {
    background: #dcfce7;
    color: #16a34a;
}

.wizard-content {
    min-height: 200px;
}

.wizard-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

/* Cart Summary */
.cart-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.cart-summary__item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
}

.cart-summary__item span {
    color: var(--text-secondary);
}

.cart-summary__item strong {
    color: var(--text-primary);
    text-align: right;
}

/* Modal Warning */
.modal__warning {
    margin: 0 0 8px;
    font-size: 15px;
    color: var(--text-primary);
}

.modal__hint {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* Button Danger */
.button--danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.button--danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.action-btn--danger {
    color: var(--danger);
}

.action-btn--danger:hover {
    background: #fee2e2;
}

/* Field Hint */
.field__hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Field Input Date */
.field__input--date {
    width: 140px;
}

/* Link style */
.link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

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

/* Text Muted */
.text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

/* Metrica Card Clickable */
.metrica-card--clickable {
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.metrica-card--clickable:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

.metrica-card__sparkline {
    height: 32px;
    margin-top: 8px;
}

.metrica-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.metrica-card__actions .button {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.3s, transform 0.3s;
}

.toast--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #059669;
}

.toast--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.toast--info {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #2563eb;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast--fadeout {
    opacity: 0;
    transform: translateX(100%);
}

.toast__close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    line-height: 1;
}

.toast__close:hover {
    opacity: 1;
}

/* ===== A/B Testing Page Styles ===== */

/* AB Form */
.ab-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.form-row--wrap {
    flex-wrap: wrap;
}

/* Trigger Chips */
.triggers-select {
    flex: 1;
    min-width: 300px;
}

.trigger-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.chip--selectable {
    cursor: pointer;
}

.chip--selectable input {
    display: none;
}

.chip--selectable:has(input:checked) {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
}

.chip__icon {
    font-size: 14px;
}

.chip--fear { }
.chip--benefit { }
.chip--curiosity { }
.chip--ego { }
.chip--urgency { }

/* Field Slider */
.field--slider {
    min-width: 200px;
}

.field__range {
    width: 100%;
    accent-color: var(--accent);
    height: 8px;
    margin-top: 8px;
}

.field__range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Button Large */
.button--lg {
    padding: 14px 28px;
    font-size: 16px;
}

.button__icon {
    font-size: 18px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Variants Grid */
.variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.variant-card {
    background: var(--bg-panel);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.variant-card:hover {
    border-color: var(--accent);
}

.variant-card--selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.variant-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.variant-card__checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.variant-card__checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.variant-card__number {
    font-weight: 600;
    color: var(--text-primary);
}

/* Ad Preview */
.ad-preview {
    padding: 12px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.ad-preview__title {
    font-size: 16px;
    font-weight: 600;
    color: #1a0dab;
    margin-bottom: 6px;
    line-height: 1.3;
}

.ad-preview__text {
    font-size: 13px;
    color: #545454;
    line-height: 1.4;
    margin-bottom: 4px;
}

.ad-preview__url {
    font-size: 12px;
    color: #006621;
}

.variant-card__meta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.variant-card__length {
    font-size: 11px;
    color: var(--text-muted);
}

/* A/B Tests Table */
.data-table--ab-tests .group-name {
    font-weight: 500;
    color: var(--text-primary);
}

.data-table--ab-tests .group-id {
    font-size: 11px;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.action-btn--chart {
    color: var(--accent);
}

.action-btn--stop {
    color: var(--danger);
}

/* Losers List */
.losers-list {
    max-height: 200px;
    overflow-y: auto;
    margin: 16px 0;
}

.loser-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fef2f2;
    border-radius: 8px;
    margin-bottom: 8px;
}

.loser-item__info {
    flex: 1;
}

.loser-item__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

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

/* Modal Warning */
.modal__warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    margin-bottom: 16px;
}

.modal__warning-icon {
    font-size: 24px;
}

.modal__warning p {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===== Statistics Page Styles ===== */

/* Stats Tabs */
.stats-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-panel);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    margin-bottom: 24px;
    overflow-x: auto;
}

.stats-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.stats-tab:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.stats-tab--active {
    background: var(--accent);
    color: #fff;
}

.stats-tab--active:hover {
    background: var(--accent);
    color: #fff;
}

.stats-tab__icon {
    font-size: 16px;
}

/* Stats Panel */
.stats-panel {
    animation: fadeIn 0.2s ease-out;
}

/* Stats Form */
.stats-form {
    margin-bottom: 24px;
}

.stats-form .form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.stats-form .field {
    min-width: 150px;
}

/* Stats Result */
.stats-result {
    animation: fadeIn 0.3s ease-out;
}

/* Correlation Display */
.correlation-display {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 24px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    border-radius: 12px;
    margin-bottom: 24px;
}

.correlation-value {
    text-align: center;
}

.correlation-value__number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.correlation-value__label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 8px;
}

.correlation-interpretation {
    flex: 1;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    text-align: center;
}

.stat-card__label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.stat-card__value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Outliers Summary */
.outliers-summary {
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.outliers-summary__count strong {
    color: var(--warning);
}

/* Grouping Summary */
.grouping-summary {
    padding: 12px 16px;
    background: var(--accent-soft);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--accent);
}

/* Item Name in Tables */
.item-name {
    font-weight: 500;
    color: var(--text-primary);
}

.item-id {
    font-size: 11px;
    color: var(--text-muted);
}

/* Rank Badge */
.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.rank--1 {
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
    color: #fff;
}

.rank--2 {
    background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%);
    color: #fff;
}

.rank--3 {
    background: linear-gradient(135deg, #fdba74 0%, #ea580c 100%);
    color: #fff;
}

.rank--other {
    background: #f1f5f9;
    color: var(--text-secondary);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--text-muted);
    margin-left: 6px;
}

/* Total Rank */
.total-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
}

.total-rank--1 {
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
}

.total-rank--2 {
    background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%);
}

.total-rank--3 {
    background: linear-gradient(135deg, #fdba74 0%, #ea580c 100%);
}

/* Comparison Table */
.data-table--comparison td {
    vertical-align: middle;
}

/* Chart Container Scatter */
.chart-container--scatter {
    height: 350px;
}

/* Text Colors */
.text--success {
    color: var(--success);
}

.text--danger {
    color: var(--danger);
}

.text--warning {
    color: var(--warning);
}

/* Field Grow */
.field--grow {
    flex: 1;
}

/* Multiple Select */
select[multiple] {
    min-height: 120px;
}

/* ===== Analytics Widgets (Dashboard) ===== */

.analytics-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.widget-card {
    background: var(--bg-panel);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    padding: 16px;
    box-shadow: var(--shadow);
}

.widget-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.widget-card__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-card__title-icon {
    font-size: 16px;
}

.widget-card__count {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}

.widget-card__count--warning {
    background: #fff7ed;
    color: var(--warning);
}

.widget-card__count--danger {
    background: #fef2f2;
    color: var(--danger);
}

.widget-card__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.widget-card__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
}

.widget-card__item-name {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.widget-card__item-value {
    font-weight: 600;
    color: var(--text-secondary);
}

.widget-card__item-value--danger {
    color: var(--danger);
}

.widget-card__item-value--success {
    color: var(--success);
}

/* Site Health Widget Items */
.widget-card__item--success {
    border-left: 3px solid var(--success);
}

.widget-card__item--warning {
    border-left: 3px solid var(--warning);
}

.widget-card__item--danger {
    border-left: 3px solid var(--danger);
}

.widget-card__item-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.15s;
}

.widget-card__item-link:hover {
    opacity: 0.8;
}

.widget-card__item-icon {
    flex-shrink: 0;
    font-size: 14px;
}

.widget-card__item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    font-size: 13px;
}

.widget-card__item-meta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.widget-card__empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.widget-card__action {
    display: block;
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.widget-card__action:hover {
    text-decoration: underline;
}

.widget-card__actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.widget-card__actions .widget-card__action {
    flex: 1;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Changes Log Widget */
.changes-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.changes-log__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: #f9f9fb;
    border-radius: 8px;
    border-left: 3px solid var(--border-light);
    transition: all 0.2s;
}

.changes-log__item:hover {
    background: #f0f0f5;
}

.changes-log__item--внешнее,
.changes-log__item--external {
    border-left-color: var(--warning);
}

.changes-log__item--ии,
.changes-log__item--ai_agent {
    border-left-color: var(--accent);
}

.changes-log__item--пользователь,
.changes-log__item--user {
    border-left-color: var(--success);
}

.changes-log__icon {
    font-size: 18px;
    flex-shrink: 0;
}

.changes-log__content {
    flex: 1;
    min-width: 0;
}

.changes-log__text {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.changes-log__meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.changes-log__source {
    padding: 2px 6px;
    background: var(--bg-light);
    border-radius: 4px;
    font-weight: 500;
}

.changes-log__time {
    color: var(--text-muted);
}

.changes-log__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.changes-log__empty span:first-child {
    font-size: 18px;
    color: var(--success);
}

.changes-log__summary {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

.changes-count--active {
    background: var(--warning) !important;
    color: #fff !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.quick-action-btn__icon {
    font-size: 18px;
}

/* =============================================================================
   ASSISTANT WIDGET - Контекстный AI-ассистент
   ============================================================================= */

.assistant-widget {
    font-family: var(--font-base);
}

/* FAB (Floating Action Button) позиция */
.assistant-widget--fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

/* FAB кнопка */
.assistant-widget__fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.assistant-widget__fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45);
}

.assistant-widget__fab--active {
    transform: scale(0.95);
    background: #1d4ed8;
}

.assistant-widget__fab-icon {
    font-size: 24px;
    filter: grayscale(0);
}

.assistant-widget__fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 1.5s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Панель чата */
.assistant-widget__panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-height: 560px;
    background: var(--bg-panel);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s ease-out;
    border: 1px solid var(--border-light);
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(16px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Header панели */
.assistant-widget__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border-bottom: 1px solid var(--border-light);
}

.assistant-widget__header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.assistant-widget__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.assistant-widget__context {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
}

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

.assistant-widget__status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8;
}

.assistant-widget__status--online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.assistant-widget__status--typing {
    background: var(--accent);
    animation: pulse 1s ease-in-out infinite;
}

.assistant-widget__status--error {
    background: var(--danger);
}

.assistant-widget__status--offline {
    background: #94a3b8;
}

.assistant-widget__minimize {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.assistant-widget__minimize:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

/* Область сообщений */
.assistant-widget__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    min-height: 150px;
    background: #fafbfc;
}

.assistant-widget__messages:empty::after {
    content: 'Начните диалог с ассистентом';
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 40px 20px;
}

/* Сообщения */
.assistant-widget__message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--border-light);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.assistant-widget__message--user {
    background: var(--accent-soft);
    border-color: rgba(37, 99, 235, 0.25);
    margin-left: 24px;
}

.assistant-widget__message--assistant {
    margin-right: 24px;
}

.assistant-widget__message-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.assistant-widget__message-content {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
}

.assistant-widget__message-content code {
    background: #f1f5f9;
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 12px;
}

.assistant-widget__message-tools {
    font-size: 11px;
    color: var(--text-muted);
    padding-top: 6px;
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
}

/* Quick prompts */
.assistant-widget__quick-prompts {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    overflow-x: auto;
    background: #fff;
    border-top: 1px solid var(--border-light);
    scrollbar-width: thin;
}

.assistant-widget__quick-prompts::-webkit-scrollbar {
    height: 4px;
}

.assistant-widget__quick-prompts::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 2px;
}

.assistant-widget__quick-prompts:empty {
    display: none;
}

.assistant-widget__quick-prompt {
    white-space: nowrap;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.assistant-widget__quick-prompt:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

/* Форма ввода */
.assistant-widget__form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid var(--border-light);
}

.assistant-widget__input {
    flex: 1;
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: #f8fafc;
    color: var(--text-primary);
    resize: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 42px;
    max-height: 100px;
}

.assistant-widget__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #fff;
}

.assistant-widget__input::placeholder {
    color: var(--text-muted);
}

.assistant-widget__form-actions {
    display: flex;
    gap: 4px;
}

.assistant-widget__clear,
.assistant-widget__send {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.assistant-widget__clear {
    background: #f1f5f9;
    color: var(--text-muted);
}

.assistant-widget__clear:hover {
    background: #fee2e2;
    color: var(--danger);
}

.assistant-widget__send {
    background: var(--accent);
    color: #fff;
}

.assistant-widget__send:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

/* Адаптив для мобильных */
@media (max-width: 480px) {
    .assistant-widget--fab {
        bottom: 16px;
        right: 16px;
    }
    
    .assistant-widget__panel {
        width: calc(100vw - 32px);
        right: 0;
        bottom: 80px;
        max-height: calc(100vh - 120px);
    }
    
    .assistant-widget__fab {
        width: 52px;
        height: 52px;
    }
    
    .assistant-widget__fab-icon {
        font-size: 22px;
    }
}

/* Sidebar вариант (встраивается в существующую панель) */
.assistant-widget--sidebar {
    position: static;
}

.assistant-widget--sidebar .assistant-widget__fab {
    display: none;
}

.assistant-widget--sidebar .assistant-widget__panel {
    position: static;
    width: 100%;
    max-height: none;
    box-shadow: none;
    border-radius: var(--radius);
    animation: none;
}

.assistant-widget--sidebar .assistant-widget__messages {
    max-height: 400px;
}

/* ========================================
   Phase 1: System-Wide UX Improvements
   ======================================== */

/* ===== NProgress Customization ===== */
#nprogress {
    pointer-events: none;
}

#nprogress .bar {
    background: var(--accent);
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
}

#nprogress .peg {
    display: block;
    position: absolute;
    right: 0;
    width: 100px;
    height: 100%;
    box-shadow: 0 0 10px var(--accent), 0 0 5px var(--accent);
    opacity: 1;
    transform: rotate(3deg) translate(0, -4px);
}

/* ===== Extended Toast Styles ===== */
.toast--loading {
    border-left: 4px solid var(--warning);
}

.toast__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toast__icon--spin {
    animation: toastSpin 1s linear infinite;
}

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

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast__progress {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.toast__progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ===== Empty State Component ===== */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f4ff 100%);
    border-radius: var(--radius);
    border: 2px dashed var(--border-strong);
    text-align: center;
    animation: emptyStateIn 0.3s ease-out;
}

@keyframes emptyStateIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.empty-state-card__icon {
    font-size: 56px;
    margin-bottom: 16px;
    filter: grayscale(30%);
}

.empty-state-card__title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-state-card__description {
    margin: 0 0 20px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    max-width: 320px;
    line-height: 1.5;
}

.empty-state-card__action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.empty-state-card__action:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

/* Empty State Variants */
.empty-state-card--small {
    padding: 32px 24px;
}

.empty-state-card--small .empty-state-card__icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.empty-state-card--small .empty-state-card__title {
    font-size: 1rem;
}

.empty-state-card--small .empty-state-card__description {
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.empty-state-card--small .empty-state-card__action {
    padding: 10px 18px;
    font-size: 0.875rem;
}

/* ===== Typography Improvements ===== */
/* Increase base font sizes for muted/help text */
.text-muted,
.help-text,
.field__label,
.panel__meta,
.message__meta,
.metrica-card__metric span:first-child,
.summary-card__label,
.report-card__date,
.report-card__preview-label,
.recent-report-item__date {
    font-size: 0.8125rem; /* 13px */
}

/* Ensure rem-based sizing for scalability */
:root {
    font-size: 16px; /* Base for rem calculations */
}

body {
    font-size: 1rem;
    line-height: 1.5;
}

/* Improved readability for secondary text */
.panel__meta,
.field__label,
.help-text p,
.guide-list {
    line-height: 1.6;
}

/* Better contrast for muted text */
.text-muted {
    color: var(--text-secondary);
}

/* ===== Onboarding State (No Account Selected) ===== */
.onboarding-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius);
}

.onboarding-card {
    text-align: center;
    padding: 48px 40px;
    max-width: 420px;
}

.onboarding-card__icon {
    font-size: 72px;
    margin-bottom: 20px;
}

.onboarding-card__title {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.onboarding-card__description {
    margin: 0 0 24px;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.onboarding-card__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.onboarding-card__primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.onboarding-card__primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.onboarding-card__secondary {
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: none;
}

.onboarding-card__secondary:hover {
    text-decoration: underline;
}

/* ===== Health Score Widget ===== */
.health-score-widget {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: var(--radius);
    border: 1px solid #bbf7d0;
}

.health-score-widget--warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
}

.health-score-widget--danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}

.health-score__circle {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.health-score__circle svg {
    transform: rotate(-90deg);
    width: 80px;
    height: 80px;
}

.health-score__circle-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.1);
    stroke-width: 8;
}

.health-score__circle-progress {
    fill: none;
    stroke: var(--success);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    transition: stroke-dashoffset 1s ease-out;
}

.health-score-widget--warning .health-score__circle-progress {
    stroke: var(--warning);
}

.health-score-widget--danger .health-score__circle-progress {
    stroke: var(--danger);
}

.health-score__value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.health-score__info {
    flex: 1;
}

.health-score__title {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.health-score__status {
    margin: 0 0 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.health-score__factors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.health-score__factor {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.health-score__factor--good {
    color: var(--success);
}

.health-score__factor--bad {
    color: var(--danger);
}

/* ===== Activity Feed ===== */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-feed__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-feed__item:last-child {
    border-bottom: none;
}

.activity-feed__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-feed__icon--budget {
    background: #dbeafe;
    color: #2563eb;
}

.activity-feed__icon--audit {
    background: #dcfce7;
    color: #16a34a;
}

.activity-feed__icon--connect {
    background: #f3e8ff;
    color: #9333ea;
}

.activity-feed__icon--status {
    background: #fef3c7;
    color: #d97706;
}

.activity-feed__content {
    flex: 1;
    min-width: 0;
}

.activity-feed__text {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.activity-feed__text strong {
    font-weight: 600;
}

.activity-feed__time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== Quick Date Chips ===== */
.quick-date-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.date-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.date-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.date-chip--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.date-chip--active:hover {
    background: #1d4ed8;
    color: #fff;
}

/* Compare Toggle */
.compare-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.compare-toggle:hover {
    border-color: var(--accent);
}

.compare-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.compare-toggle:has(input:checked) {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

/* Chart Hint */
.chart-hint {
    margin: 12px 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}

/* Modal Hint */
.modal__hint {
    margin: 16px 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* ===== Mobile Navigation (Hamburger Menu) ===== */
.navbar__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.navbar__hamburger:hover {
    background: var(--accent-soft);
}

.navbar__hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger animation when open */
.navbar__hamburger.is-active .navbar__hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.navbar__hamburger.is-active .navbar__hamburger-line:nth-child(2) {
    opacity: 0;
}

.navbar__hamburger.is-active .navbar__hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu backdrop */
.mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.is-active {
    display: block;
    opacity: 1;
}

/* Mobile menu styles */
@media (max-width: 768px) {
    .navbar__hamburger {
        display: flex;
    }
    
    .navbar__nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-panel);
        border-bottom: 1px solid var(--border-light);
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
        padding: 12px 16px;
        gap: 4px;
        z-index: 100;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    
    .navbar__nav.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    
    .navbar__link {
        width: 100%;
        padding: 12px 14px;
        border-radius: 10px;
    }
    
    .navbar__user-info {
        display: none;
    }
}

/* ===== Split View for Reports ===== */
.split-view {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
    height: calc(100vh - 180px);
    min-height: 500px;
}

.split-view__list {
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-page);
}

.split-view__preview {
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    overflow: hidden;
}

.split-view__preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    background: #f9fbff;
}

.split-view__preview-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.split-view__preview-frame {
    flex: 1;
    width: 100%;
    border: none;
}

.split-view__empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.split-view__empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.split-view__empty-text {
    font-size: 16px;
    margin: 0;
}

/* View toggle button */
.view-toggle {
    display: inline-flex;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle__btn {
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.view-toggle__btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.view-toggle__btn--active {
    background: var(--accent);
    color: #fff;
}

.view-toggle__btn--active:hover {
    background: var(--accent);
    color: #fff;
}

/* Report card in split view - compact */
.split-view .report-card {
    padding: 12px;
    cursor: pointer;
}

.split-view .report-card--selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

@media (max-width: 900px) {
    .split-view {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .split-view__list {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        max-height: 400px;
    }
    
    .split-view__preview {
        min-height: 500px;
    }
}

/* ===== A/B Test Winner Highlight ===== */
.row--winner {
    background: #fffbe6 !important;
    position: relative;
}

.row--winner td:first-child::before {
    content: "🏆";
    margin-right: 8px;
}

.winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #fef3c7;
    color: #b45309;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* ===== Wizard Sticky Footer ===== */
.wizard-footer--sticky {
    position: sticky;
    bottom: 0;
    background: var(--bg-panel);
    z-index: 10;
    padding: 16px 24px;
    margin: 0 -24px -24px;
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.08);
}

/* Wizard step validation indicator */
.wizard-step--valid::after {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    margin-left: 8px;
}

.wizard-step--invalid::after {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    margin-left: 8px;
}

/* ===== Date Presets ===== */
.date-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.date-preset-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--bg-panel);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.date-preset-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.date-preset-btn--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ===== Segment Reach Progress Bar ===== */
.segment-reach {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.segment-reach__label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.segment-reach__bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.segment-reach__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #60a5fa 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.segment-reach--micro .segment-reach__fill {
    background: #94a3b8;
}

.segment-reach--medium .segment-reach__fill {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.segment-reach--wide .segment-reach__fill {
    background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%);
}

/* ===== Health Score Clickable Factors ===== */
.health-score__factor {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.health-score__factor:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.health-score__factor--clickable {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

/* ===== Toast with Retry Button ===== */
.toast--with-retry {
    flex-wrap: wrap;
}

.toast__retry {
    width: 100%;
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.toast__retry:hover {
    background: #1d4ed8;
}

.toast--fadeout {
    animation: toastOut 0.3s ease-out forwards;
}

/* ===== Units Indicator Widget ===== */
.units-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    padding-bottom: 11px;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 13px;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.units-indicator--loading {
    opacity: 0.7;
}

.units-indicator--ok {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.units-indicator--warning {
    border-color: #fde68a;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.units-indicator--critical {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.units-indicator__icon {
    font-size: 16px;
    flex-shrink: 0;
}

.units-indicator__info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.units-indicator__label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.units-indicator__value {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.units-indicator--ok .units-indicator__value {
    color: var(--success);
}

.units-indicator--warning .units-indicator__value {
    color: #d97706;
}

.units-indicator--critical .units-indicator__value {
    color: var(--danger);
}

.units-indicator__bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-light);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.units-indicator__fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

.units-indicator--warning .units-indicator__fill {
    background: #f59e0b;
}

.units-indicator--critical .units-indicator__fill {
    background: var(--danger);
}

/* Compact version for narrow spaces */
.units-indicator--compact {
    min-width: auto;
    padding: 6px 10px;
}

.units-indicator--compact .units-indicator__label {
    display: none;
}


/* ===== Sync Status Widget ===== */
.sync-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    font-size: 14px;
}

.sync-status--ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.sync-status--warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.sync-status__info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-status__icon {
    font-size: 16px;
}

.sync-status__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sync-status__label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sync-status__time {
    color: var(--text-primary);
    font-weight: 500;
}

.sync-status__refresh {
    flex-shrink: 0;
}

/* Compact version for header */
.sync-status--compact {
    padding: 6px 10px;
    gap: 8px;
}

.sync-status--compact .sync-status__text {
    flex-direction: row;
    gap: 4px;
}

.sync-status--compact .sync-status__label {
    display: none;
}

/* Account indicator in header */
.account-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 10px;
}

.account-indicator__name {
    font-weight: 600;
    color: var(--text-primary);
}

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

.account-indicator__sync--stale {
    color: var(--warning);
}

.account-indicator__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 999px;
    background: #f0fdf4;
    color: #16a34a;
}

.account-indicator__badge--warning {
    background: #fffbeb;
    color: #d97706;
}

/* Global account header bar */
.account-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-light);
    margin: -32px -24px 24px;
    width: calc(100% + 48px);
}

.account-bar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-bar__select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-bar__label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-bar__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

@media (max-width: 768px) {
    .account-bar {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
        margin: -32px -16px 20px;
        width: calc(100% + 32px);
    }
    
    .account-bar__left,
    .account-bar__right {
        width: 100%;
    }
    
    .account-bar__right {
        flex-direction: column;
        gap: 8px;
    }
    
    .sync-status {
        width: 100%;
    }
}

/* =============================================
   Schedule / Time Analysis Page
   ============================================= */

/* Insights */
.insights-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.insight-item {
    padding: 12px 16px;
    background: var(--accent-soft);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

/* Recommendations Grid */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .recommendations-grid {
        grid-template-columns: 1fr;
    }
}

.recommendation-box {
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.recommendation-box h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
}

.recommendation-box--increase {
    background: #f0fdf4;
    border-color: #86efac;
}

.recommendation-box--decrease {
    background: #fefce8;
    border-color: #fde047;
}

.recommendation-box--pause {
    background: #fef2f2;
    border-color: #fca5a5;
}

.recommendation-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recommendation-item {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    font-size: 13px;
}

.recommendation-item strong {
    display: block;
    margin-bottom: 2px;
}

.recommendation-reason {
    color: var(--text-secondary);
    font-size: 12px;
}

.recommendation-empty {
    color: var(--text-muted);
    font-style: italic;
}

/* Heatmap */
.heatmap-container {
    overflow-x: auto;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.heatmap-gradient {
    width: 120px;
    height: 12px;
    background: linear-gradient(to right, rgba(54, 162, 235, 0.2), rgba(54, 162, 235, 1));
    border-radius: 2px;
}

.heatmap-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.heatmap-row {
    display: flex;
    gap: 2px;
}

.heatmap-row--header {
    margin-bottom: 4px;
}

.heatmap-cell {
    width: 40px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border-radius: 3px;
    cursor: default;
    transition: transform 0.1s;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    z-index: 1;
}

.heatmap-cell--label {
    width: 50px;
    background: none;
    font-weight: 500;
    color: var(--text-secondary);
    justify-content: flex-end;
    padding-right: 8px;
}

.heatmap-cell--header {
    background: var(--bg-page);
    font-weight: 600;
    color: var(--text-primary);
}

/* Schedule Editor */
.schedule-hint {
    margin: 0 0 20px;
    padding: 12px 16px;
    background: var(--accent-soft);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.schedule-editor {
    overflow-x: auto;
    margin-bottom: 20px;
}

.schedule-hours-header {
    display: flex;
    gap: 2px;
    margin-bottom: 4px;
}

.schedule-hours-header .schedule-label {
    width: 40px;
}

.schedule-hours-header .schedule-hours {
    display: flex;
    gap: 2px;
}

.schedule-hours-header .schedule-hours span {
    width: 32px;
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
}

.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.schedule-row {
    display: flex;
    gap: 2px;
    align-items: center;
}

.schedule-label {
    width: 40px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.schedule-hours {
    display: flex;
    gap: 2px;
}

.schedule-cell {
    width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.schedule-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.schedule-cell--off {
    background: #fee2e2;
    color: #dc2626;
}

.schedule-cell--low {
    background: #fef3c7;
    color: #d97706;
}

.schedule-cell--high {
    background: #d1fae5;
    color: #059669;
}

.schedule-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.schedule-presets__label {
    font-size: 13px;
    color: var(--text-secondary);
}

.schedule-options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

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

/* CPA Highlighting */
.cpa-good {
    color: #16a34a;
    font-weight: 600;
}

.cpa-bad {
    color: #dc2626;
    font-weight: 600;
}

/* Compare Tab Styles */
.compare-controls {
    margin-bottom: 24px;
}

.compare-campaigns-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.compare-campaign-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-body);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.compare-campaign-item:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.compare-campaign-item input[type="checkbox"]:checked + span {
    font-weight: 500;
    color: var(--accent);
}

.compare-campaign-state {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-panel);
    color: var(--text-muted);
}

.compare-actions {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.compare-results {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.compare-results h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
}

/* Metrics Row */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.metric-card {
    padding: 16px;
    background: var(--bg-page);
    border-radius: 10px;
    text-align: center;
}

.metric-card__label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.metric-card__value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Chart Container (schedule page) */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 24px;
}

/* Data Table improvements */
.data-table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: var(--bg-page);
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: var(--bg-page);
}

/* ==================== Bid Modifiers ==================== */

.modifiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.modifier-section {
    padding: 20px;
    background: var(--bg-page);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.modifier-section__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.modifier-section__desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 16px;
}

.modifier-control {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modifier-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modifier-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
}

.modifier-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.15s;
}

.modifier-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.modifier-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

.modifier-value {
    width: 80px;
    text-align: center;
}

.modifier-value-small {
    width: 70px;
    text-align: center;
    padding: 8px;
}

.modifier-percent {
    font-size: 14px;
    color: var(--text-muted);
}

.modifier-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.age-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.age-grid .field {
    text-align: center;
}

.age-grid .field__label {
    font-size: 12px;
    margin-bottom: 4px;
    display: block;
}

.modifiers-status {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 16px;
}

.modifiers-status--success {
    background: #dcfce7;
    color: #16a34a;
}

.modifiers-status--error {
    background: #fee2e2;
    color: #dc2626;
}

.modifiers-status--info {
    background: #e0f2fe;
    color: #0284c7;
}

/* Retargeting & Regional Modifier Rows */
.retargeting-modifier-row,
.regional-modifier-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.retargeting-modifier-row__name,
.regional-modifier-row__name {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.modifier-input-group--compact {
    display: flex;
    align-items: center;
    gap: 6px;
}

.regional-remove-btn {
    padding: 4px 8px;
    font-size: 16px;
    color: var(--text-muted);
}

.regional-remove-btn:hover {
    color: var(--danger);
}

/* ==================== Changes Log Page ==================== */

.changes-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filters-row .field {
    min-width: 150px;
}

/* Changes Table Rows */
.changes-row__time {
    white-space: nowrap;
}

.changes-row__time-relative {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
}

.changes-row__time-full {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

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

.changes-row__object-icon {
    font-size: 20px;
}

.changes-row__object-info {
    display: flex;
    flex-direction: column;
}

.changes-row__object-name {
    font-weight: 500;
    color: var(--text-primary);
}

.changes-row__object-type {
    font-size: 12px;
    color: var(--text-muted);
}

.changes-row__details {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Source Badges */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.source-badge--external {
    background: #e0f2fe;
    color: #0369a1;
}

.source-badge--ai_agent {
    background: #f3e8ff;
    color: #7c3aed;
}

.source-badge--user {
    background: #dcfce7;
    color: #16a34a;
}

/* Action Badges */
.badge--created {
    background: #dcfce7;
    color: #16a34a;
}

.badge--updated {
    background: #fef3c7;
    color: #b45309;
}

.badge--deleted {
    background: #fee2e2;
    color: #dc2626;
}

.badge--status_changed {
    background: #e0f2fe;
    color: #0369a1;
}

.badge--budget_changed {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Tool Badge */
.tool-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

/* Load More */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

/* Row highlight by source */
.changes-row--ai_agent {
    background: rgba(124, 58, 237, 0.03);
}

.changes-row--external:hover,
.changes-row--ai_agent:hover,
.changes-row--user:hover {
    background: var(--bg-hover);
}

@media (max-width: 1024px) {
    .changes-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .changes-summary-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .filters-row .field {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .modifiers-grid {
        grid-template-columns: 1fr;
    }
    
    .age-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .modifier-input-group {
        flex-wrap: wrap;
    }
    
    .modifier-slider {
        width: 100%;
        flex: none;
    }
}

/* ===== Assets / Библиотека расширений ===== */
.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.asset-card {
    background: var(--bg-panel);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.asset-card:hover {
    border-color: var(--accent);
}

.asset-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.asset-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.asset-card__meta {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

.asset-card__badge {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-page);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.asset-card__content {
    padding: 12px;
    background: var(--bg-page);
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.asset-card__actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.asset-card__actions .button {
    flex: 1;
    padding: 10px;
    font-size: 13px;
}

/* Sitelink items */
.sitelink-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.sitelink-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sitelink-item:first-child {
    padding-top: 0;
}

.sitelink-item__title {
    font-weight: 600;
    color: var(--accent);
    font-size: 14px;
}

.sitelink-item__href {
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
}

.sitelink-item__desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Callout tags */
.callout-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.callout-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-soft);
    border-radius: 8px;
    font-size: 13px;
    color: var(--accent);
    transition: background 0.2s;
}

.callout-tag:hover {
    background: #d4e2ff;
}

.callout-tag--linked {
    background: #dcfce7;
    color: #16a34a;
}

.callout-tag__delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.callout-tag__delete:hover {
    opacity: 1;
}

/* Create card */
.asset-create-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    min-height: 200px;
    background: var(--bg-page);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    padding: 24px;
}

.asset-create-card:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.asset-create-card__icon {
    font-size: 40px;
}

.asset-create-card__text {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* Sitelink Form */
.sitelink-form-item {
    background: var(--bg-page);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    border: 1px solid var(--border-light);
}

.sitelink-form-item__remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.sitelink-form-item__remove:hover {
    color: var(--danger);
}

.sitelink-form-item .field {
    margin-bottom: 12px;
}

.sitelink-form-item .field:last-of-type {
    margin-bottom: 0;
}

/* Char counter */
.char-counter {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
}

.char-counter--warning {
    color: var(--warning);
}

.char-counter--error {
    color: var(--danger);
}

/* Campaign link list */
.campaign-link-list {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 10px;
}

.campaign-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s;
}

.campaign-link-item:last-child {
    border-bottom: none;
}

.campaign-link-item:hover {
    background: var(--bg-page);
}

.campaign-link-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.campaign-link-item__info {
    flex: 1;
}

.campaign-link-item__name {
    font-weight: 500;
    color: var(--text-primary);
}

.campaign-link-item__id {
    font-size: 12px;
    color: var(--text-muted);
}

/* Info tip */
.info-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--accent-soft);
    border-radius: 10px;
    margin-bottom: 24px;
}

.info-tip__icon {
    font-size: 20px;
    flex-shrink: 0;
}

.info-tip__content {
    flex: 1;
}

.info-tip__title {
    font-weight: 600;
    margin: 0 0 4px;
    font-size: 14px;
}

.info-tip__text {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .assets-grid {
        grid-template-columns: 1fr;
    }
    
    .asset-card__actions {
        flex-direction: column;
    }
}

/* ==================== Серверное отслеживание ==================== */

.tracking-section {
    display: grid;
    gap: 1.5rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover,
.upload-area--dragover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.upload-area__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.upload-area__text {
    font-size: 14px;
    color: var(--text-primary);
}

.upload-area__text a {
    color: var(--primary-color);
    text-decoration: underline;
}

.upload-area__hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.preview-table {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.preview-table table {
    font-size: 13px;
}

.manual-input {
    margin-top: 1rem;
}

.manual-input summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 14px;
}

.manual-input summary:hover {
    text-decoration: underline;
}

.files-list {
    margin-top: 1rem;
}

.files-list h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
}

.files-list__items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.files-list__item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.files-list__item:last-child {
    border-bottom: none;
}

.files-list__name {
    font-size: 13px;
    font-family: monospace;
}

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

/* ==================== Token Health ==================== */

.token-health {
    padding: 20px;
}

.token-health__loading {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.token-health__summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.summary-item {
    flex: 1;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.summary-item--healthy {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.summary-item--warning {
    background: rgba(234, 179, 8, 0.1);
    color: #d97706;
}

.summary-item--expired {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.summary-item__count {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.summary-item__label {
    font-size: 0.85rem;
}

.token-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.token-list__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.token-status--healthy {
    background: rgba(34, 197, 94, 0.05);
}

.token-status--warning {
    background: rgba(234, 179, 8, 0.1);
}

.token-status--expired {
    background: rgba(239, 68, 68, 0.1);
}

.token-status--unknown {
    background: rgba(156, 163, 175, 0.1);
}

.token-list__icon {
    font-size: 16px;
    flex-shrink: 0;
}

.token-list__name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
}

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

@media (max-width: 640px) {
    .token-health__summary {
        flex-direction: column;
    }
    
    .token-list__item {
        flex-wrap: wrap;
    }
    
    .token-list__expiry {
        width: 100%;
        margin-top: 4px;
        margin-left: 32px;
    }
}

/* ===========================================
   Webmaster Page Styles
   =========================================== */

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card--health.metric-card--ok {
    border-left: 4px solid var(--success);
}

.metric-card--health.metric-card--warning {
    border-left: 4px solid var(--warning);
}

.metric-card--health.metric-card--critical {
    border-left: 4px solid var(--danger);
}

/* Diagnostics */
.diagnostics-section {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.diagnostics-section--fatal {
    border-left: 4px solid var(--danger);
}

.diagnostics-section--critical {
    border-left: 4px solid var(--warning);
}

.diagnostics-section--warning {
    border-left: 4px solid #f59e0b;
}

.diagnostics-section__title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.diagnostics-section__desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
}

.diagnostics-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.diagnostics-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-page);
    border-radius: 8px;
}

.diagnostics-item__code {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--border-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.diagnostics-item__message {
    flex: 1;
}

.diagnostics-item__count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Growth Cards */
.growth-cards {
    display: grid;
    gap: 1rem;
}

.growth-card {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border-light);
}

.growth-card__query {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.growth-card__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.growth-card__metric {
    display: flex;
    gap: 0.25rem;
}

.growth-card__label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.growth-card__value {
    font-weight: 500;
}

.growth-card__value--warning {
    color: var(--warning);
}

.growth-card__value--success {
    color: var(--success);
}

.growth-card__recommendation {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

/* Recrawl */
.recrawl-quota {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--accent-soft);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.recrawl-quota__label {
    color: var(--text-secondary);
}

.recrawl-quota__value {
    font-weight: 600;
    color: var(--accent);
}

.recrawl-results {
    margin-top: 1.5rem;
}

.recrawl-results__title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.recrawl-results__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recrawl-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
}

.recrawl-result--success {
    background: rgba(34, 197, 94, 0.1);
}

.recrawl-result--error {
    background: rgba(239, 68, 68, 0.1);
}

.recrawl-result__icon {
    flex-shrink: 0;
}

.recrawl-result__url {
    flex: 1;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.recrawl-result__error {
    color: var(--danger);
    font-size: 0.85rem;
}

/* Table Cell for Position */
.position--top3 {
    color: var(--success);
    font-weight: 600;
}

.position--top10 {
    color: var(--accent);
}

.table__cell--query {
    max-width: 300px;
    word-break: break-word;
}

/* Trend indicators */
.trend--up {
    color: var(--success);
}

.trend--down {
    color: var(--danger);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-header__title {
    margin: 0;
    font-size: 1.25rem;
}

.section-header__desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.25rem 0 0 0;
}

.section-header__controls {
    display: flex;
    gap: 0.5rem;
}

/* Chart Container */
.chart-container {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 1.5rem;
    height: 350px;
}

@media (max-width: 640px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .growth-card__metrics {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Active Dropdown Item */
.navbar__dropdown-item--active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
}

/* ==================== Этап 3: Управление состоянием ==================== */

/* Индикатор несохранённых изменений (глобальный) */
.dirty-indicator {
    display: inline-block;
    margin-left: 12px;
    padding: 4px 12px;
    background: var(--warning);
    color: white;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    vertical-align: middle;
    animation: pulse-warning 2s infinite;
}

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

/* Панель фильтров (глобальная) */
.filters-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding: 16px;
    background: var(--bg-panel);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.filters-panel .field {
    min-width: 180px;
    flex: 1;
}

.filters-panel .field__input {
    width: 100%;
}

@media (max-width: 768px) {
    .filters-panel {
        flex-direction: column;
    }
    
    .filters-panel .field {
        width: 100%;
    }
}

/* Скелетон загрузки (глобальный) */
.skeleton {
    padding: 20px;
    background: var(--bg-panel);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.skeleton__row {
    height: 60px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    margin-bottom: 12px;
    border-radius: 8px;
}

.skeleton__row:last-child {
    margin-bottom: 0;
}

.skeleton__row--short {
    width: 60%;
}

.skeleton__row--medium {
    width: 80%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Пагинация (глобальная) */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

.pagination__btn {
    padding: 8px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font-base);
    transition: all 0.2s;
}

.pagination__btn:hover:not(:disabled) {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.pagination__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination__info {
    font-size: 14px;
    color: var(--text-secondary);
}

.pagination__info span {
    font-weight: 600;
    color: var(--text-primary);
}

/* Быстрые числовые кнопки для страниц */
.pagination__pages {
    display: flex;
    gap: 4px;
}

.pagination__page {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-panel);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination__page:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination__page--active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.pagination__page--ellipsis {
    border: none;
    cursor: default;
}

@media (max-width: 640px) {
    .pagination {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .pagination__btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}
