/* LeadHunter Dashboard — Styles */
/* Light/Dark theme (переключатель как в BOTIX) */

:root {
    /* Light theme (default) */
    --bg: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-hover: #F1F5F9;
    --bg-input: #FFFFFF;
    --border: #E2E8F0;
    --text: #1E293B;
    --text-dim: #475569;
    --text-muted: #94A3B8;
    --accent: #007AFF;
    --accent-hover: #0063D1;
    --green: #10B981;
    --green-bg: rgba(16, 185, 129, 0.1);
    --blue: #007AFF;
    --blue-bg: rgba(0, 122, 255, 0.1);
    --teal: #0AB4B0;
    --teal-bg: rgba(10, 180, 176, 0.1);
    --yellow: #F59E0B;
    --red: #EF4444;
    --sidebar-w: 220px;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-hover: #22263a;
    --bg-input: #141620;
    --border: #2a2e3f;
    --text: #e1e4ed;
    --text-dim: #8b8fa3;
    --text-muted: #5a5e72;
    --accent: #0A84FF;
    --accent-hover: #409CFF;
    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.1);
    --blue: #0A84FF;
    --blue-bg: rgba(10, 132, 255, 0.1);
    --teal: #0AB4B0;
    --teal-bg: rgba(10, 180, 176, 0.1);
    --yellow: #eab308;
    --red: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    width: 22px;
    height: 22px;
    color: var(--accent);
    flex-shrink: 0;
}

.brand-text { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }

.sidebar-nav {
    list-style: none;
    padding: 12px 8px;
    flex: 1;
}

.sidebar-nav li { margin-bottom: 2px; }

.nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #86868b;
    opacity: .8;
    flex-shrink: 0;
}
.nav-badge-green { color: #10B981; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s;
    font-size: 14px;
}

.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-nav li.active a svg { opacity: 1; }

.sidebar-nav a:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.sidebar-nav li.active a {
    background: var(--accent);
    color: #fff;
}

/* Sidebar group — фон-подложка */
.sidebar-group {
    list-style: none;
    margin: 8px 4px;
    padding: 4px;
    background: rgba(0,122,255,.06);
    border-radius: 10px;
}
.sidebar-group-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-group-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: background .15s;
}
.sidebar-group-list li a:hover {
    background: rgba(0,0,0,.04);
}
.sidebar-group-list li.active a {
    background: var(--accent);
    color: #fff;
}
.sidebar-group-list li a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Hosting — row status */
.hosting-row-ok {
    background: rgba(52,199,89,.04);
}
.hosting-row-expiring {
    background: rgba(255,59,48,.06);
}
.hosting-row-expiring td {
    color: #FF3B30;
}
.hosting-row-expiring td a,
.hosting-row-expiring td .text-dim {
    color: inherit;
}

/* Hosting — reference grid */
.hosting-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border);
    border-top: 1px solid var(--border);
}
.hosting-ref-item {
    padding: 12px 16px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.hosting-ref-name {
    font-weight: 600;
    font-size: 13px;
}
.hosting-ref-desc {
    font-size: 11px;
    line-height: 1.3;
    flex: 1;
}
.hosting-ref-item .btn {
    align-self: flex-start;
    margin-top: 6px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
}

.sidebar-footer a:hover { color: var(--text); }

/* Theme Switcher (3-кнопки: light/dark/system — как BOTIX) */
.theme-switcher {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: var(--border);
    border-radius: 10px;
    width: 100%;
}

.theme-switcher__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.theme-switcher__btn svg { width: 16px; height: 16px; }
.theme-switcher__btn:hover { color: var(--text); }

.theme-switcher__btn.active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Auth page — круглая кнопка переключения темы */
.auth-theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    z-index: 10;
}

.auth-theme-toggle:hover { background: var(--bg-hover); }

/* Content */
.content {
    margin-left: var(--sidebar-w);
    padding: 24px 32px;
    max-width: 1400px;
}

/* Сворачивание боковой панели (образец - админка COVERpress): кружок с уголком
   на правой кромке, свёрнуто - полоса с SVG-иконками. Подписи прячутся шириной и
   прозрачностью, строка сохраняет высоту - иконки не сдвигаются вверх-вниз.
   Класс на <html> ставит скрипт в <head>. На узком экране панель не сворачивается. */
.sidebar-toggle { display: none; }
@media (min-width: 821px) {
    .sidebar { transition: width .25s ease; }
    .content { transition: margin-left .25s ease; }
    .sidebar-brand, .sidebar-nav a { white-space: nowrap; overflow: hidden; }
    .brand-text, .nav-label { transition: opacity .15s; }
    .sidebar-toggle {
        position: fixed;
        top: 20px;
        left: calc(var(--sidebar-w) - 14px);
        z-index: 100;
        width: 28px;
        height: 28px;
        padding: 0;
        border-radius: 50%;
        border: 1px solid var(--border);
        background: var(--bg-card);
        color: var(--text-dim);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: var(--shadow-sm);
        transition: left .25s ease, background .15s, color .15s;
    }
    .sidebar-toggle:hover { background: var(--bg-hover); color: var(--accent); }
    .sidebar-toggle svg { width: 16px; height: 16px; transition: transform .25s ease; }

    html.sidebar-collapsed { --sidebar-w: 56px; }
    html.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
    html.sidebar-collapsed .sidebar-brand { padding-left: 0; padding-right: 0; gap: 0; justify-content: center; }
    html.sidebar-collapsed .sidebar-nav a { padding-left: 0; padding-right: 0; gap: 0; justify-content: center; }
    html.sidebar-collapsed .brand-text,
    html.sidebar-collapsed .nav-label { width: 0; opacity: 0; overflow: hidden; }
    html.sidebar-collapsed .sidebar-footer { display: none; }
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-count {
    font-size: 16px;
    color: var(--text-dim);
    font-weight: 400;
    margin-left: 8px;
}

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

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

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

.kpi-pct {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
}

.kpi-green { border-color: var(--green); }
.kpi-green .kpi-value { color: var(--green); }
.kpi-green .kpi-pct { color: var(--green); }

.kpi-blue { border-color: var(--blue); }
.kpi-blue .kpi-value { color: var(--blue); }
.kpi-blue .kpi-pct { color: var(--blue); }

.kpi-teal { border-color: var(--teal); }
.kpi-teal .kpi-value { color: var(--teal); }
.kpi-teal .kpi-pct { color: var(--teal); }

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 14px 20px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.card-body { padding: 0; }
.card-header .header-count { color: var(--text-muted); font-weight: 400; }

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.table-hover tbody tr:hover {
    background: var(--bg-hover);
}

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

.text-right { text-align: right; }
.text-green { color: var(--green); font-weight: 600; }
.text-yellow { color: var(--yellow); font-weight: 600; }
.text-red { color: var(--red); font-weight: 600; }
.text-blue { color: var(--blue); }
.text-dim { color: var(--text-muted); font-size: 12px; }

.mono { font-family: 'SF Mono', 'Menlo', 'Consolas', monospace; font-size: 12px; }

.name-cell { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.error-cell { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--red); font-size: 12px; }

.link-ext { text-decoration: none; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-completed, .badge-new { background: var(--green-bg); color: var(--green); }
.badge-running, .badge-queued { background: var(--blue-bg); color: var(--blue); }
.badge-failed, .badge-bounced, .badge-spam { background: rgba(239, 68, 68, 0.1); color: var(--red); }
.badge-pending, .badge-none { background: rgba(139, 143, 163, 0.1); color: var(--text-muted); }
.badge-sent { background: var(--teal-bg); color: var(--teal); }
.badge-cat { background: rgba(59, 130, 246, 0.1); color: var(--accent); }

/* Warmup status badges */
.warmup-red { background: rgba(239, 68, 68, 0.1); color: var(--red); }
.warmup-orange { background: rgba(245, 158, 11, 0.15); color: #D97706; }
.warmup-yellow { background: rgba(245, 158, 11, 0.1); color: var(--yellow); }
.warmup-green { background: var(--green-bg); color: var(--green); }
.warmup-blue { background: var(--blue-bg); color: var(--blue); }
.warmup-gray { background: rgba(139, 143, 163, 0.1); color: var(--text-muted); }

/* Cooldown cell colors */
.cooldown-red { color: var(--red); font-weight: 600; }
.cooldown-orange { color: #D97706; font-weight: 600; }
.cooldown-yellow { color: var(--yellow); font-weight: 500; }
.cooldown-green { color: var(--green); font-weight: 500; }

.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 6px; }

/* Empty state */
.empty-state {
    padding: 48px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 4px;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 20px;
    height: 38px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

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

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
}

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

.btn-block { width: 100%; justify-content: center; }

/* Forms */
.filter-card .card-body,
.filter-card { padding: 0; }

.filter-form { padding: 16px 20px; }

.filter-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-row:last-child { margin-bottom: 0; }

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}

.filter-group label,
.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

select, input[type="text"], input[type="number"], input[type="password"], input[type="email"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0 12px;
    height: 38px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394A3B8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select:focus, input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Inline form (parsing page) */
.form-inline { padding: 16px 20px; }

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.form-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-field select,
.form-field input {
    width: 100%;
}

.form-field--sm { flex: 0 0 100px; }
.form-field--btn { flex: 0 0 auto; }
.form-field--btn .btn { height: 38px; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px 0;
}

.checkbox-label:hover { color: var(--text); }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

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

/* Status Bar (global parsing status) */
/* Status Bar — Dark Dock */
.status-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(29, 29, 31, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 16px 24px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 480px;
    max-width: 620px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: statusSlideUp 0.35s ease;
    overflow: hidden;
}

@keyframes statusSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.status-bar--running {}

.status-bar--done {
    background: rgba(29, 29, 31, 0.95);
}

.status-bar--error {
    background: rgba(29, 29, 31, 0.95);
}

/* Pulse dot */
.status-bar__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-bar--running .status-bar__dot {
    background: #30D158;
    animation: statusPulse 1.5s ease-in-out infinite;
}

.status-bar--done .status-bar__dot {
    background: #30D158;
}

.status-bar--error .status-bar__dot {
    background: #FF453A;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Info block */
.status-bar__info {
    flex: 1;
    min-width: 0;
}

.status-bar__main {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-bar__details {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.status-bar__details b {
    color: #fff;
    font-family: 'SF Mono', 'Menlo', monospace;
    font-weight: 700;
}

/* Timer */
.status-bar__time {
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 22px;
    font-weight: 700;
    color: #30D158;
    flex-shrink: 0;
}

.status-bar--done .status-bar__time {
    color: #30D158;
}

.status-bar--error .status-bar__time {
    color: #FF453A;
}

/* Count (done state) */
.status-bar__count {
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #30D158;
    flex-shrink: 0;
}

/* Progress bar */
.status-bar__progress {
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.status-bar__fill {
    height: 100%;
    background: #30D158;
    border-radius: 2px;
    transition: width 0.5s ease;
    min-width: 2%;
}

/* Flash Messages */
.flash-messages { margin-bottom: 16px; }

.flash {
    padding: 12px 16px;
    background: var(--blue-bg);
    border: 1px solid var(--blue);
    border-radius: 8px;
    color: var(--blue);
    font-size: 13px;
    margin-bottom: 8px;
}

.flash-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--red);
    color: var(--red);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.login-brand {
    text-align: center;
    margin-bottom: 24px;
}

.login-brand .brand-icon { font-size: 40px; }
.login-brand h1 { font-size: 24px; margin-top: 8px; }

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group input {
    height: 42px;
    padding: 0 14px;
}

.login-box .btn { margin-top: 8px; height: 42px; font-size: 14px; }

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
}

/* Small button */
.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* Code inline */
code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: var(--bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-dim);
}

/* Email templates page */
.subjects-cell {
    max-width: 400px;
}

.subject-variant {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-dim);
    padding: 2px 0;
    line-height: 1.4;
}

.badge-ab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    flex-shrink: 0;
}

/* System / Health page */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.health-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.health-card__status {
    margin-bottom: 8px;
}

.health-card__status svg {
    width: 20px;
    height: 20px;
}

.health-card__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.health-card__detail {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.health-card--ok {
    border-color: var(--green);
}
.health-card--ok .health-card__status svg { color: var(--green); }

.health-card--warning {
    border-color: var(--yellow);
}
.health-card--warning .health-card__status svg { color: var(--yellow); }

.health-card--critical, .health-card--error {
    border-color: var(--red);
}
.health-card--critical .health-card__status svg,
.health-card--error .health-card__status svg { color: var(--red); }

/* Log viewer */
.log-viewer {
    max-height: 400px;
    overflow-y: auto;
    padding: 12px 16px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 11px;
    line-height: 1.6;
    background: var(--bg-input);
}

.log-line {
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-dim);
    padding: 1px 0;
}

.log-line--error {
    color: var(--red);
    font-weight: 500;
}

.log-line--warn {
    color: var(--yellow);
}

/* Widget styles moved to modules/dashboard/css/widgets.css */

/* =============================================================
   Cooldown System
   ============================================================= */

/* Inline cooldown indicator (under form) */
.cooldown-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-top: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.cooldown-info .cooldown-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
}

.cooldown-info .cooldown-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease, background 0.4s ease;
}

.cooldown-info .cooldown-text {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 120px;
    text-align: right;
}

.cooldown-info.cooldown--red { border-color: var(--red); }
.cooldown-info.cooldown--red .cooldown-fill { background: var(--red); }
.cooldown-info.cooldown--red .cooldown-text { color: var(--red); }

.cooldown-info.cooldown--orange { border-color: var(--yellow); }
.cooldown-info.cooldown--orange .cooldown-fill { background: var(--yellow); }
.cooldown-info.cooldown--orange .cooldown-text { color: var(--yellow); }

.cooldown-info.cooldown--green { border-color: var(--green); }
.cooldown-info.cooldown--green .cooldown-fill { background: var(--green); }
.cooldown-info.cooldown--green .cooldown-text { color: var(--green); }

.cooldown-info.cooldown--gray { border-color: var(--border); }
.cooldown-info.cooldown--gray .cooldown-fill { background: var(--text-muted); }
.cooldown-info.cooldown--gray .cooldown-text { color: var(--text-muted); }

/* Button disabled */
.btn-primary:disabled,
.btn-primary[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Global cooldown banner */
.global-cd {
    padding: 10px 16px; border-radius: 8px; margin-bottom: 16px;
    font-size: 13px; font-weight: 600; text-align: center;
}
.global-cd--red {
    background: rgba(229,57,53,0.12); color: #E53935;
    border: 1px solid rgba(229,57,53,0.3);
}
.global-cd--orange {
    background: rgba(255,152,0,0.10); color: #FF9800;
    border: 1px solid rgba(255,152,0,0.25);
}

/* Recommended tiles (5 optimal pairs) */
.cd-rec-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.cd-rec-tile {
    display: flex; flex-direction: column;
    padding: 12px 16px; border-radius: 10px;
    cursor: pointer; transition: all 0.15s;
    min-width: 150px; flex: 1; max-width: 220px;
    border: 1px solid var(--border); background: var(--bg-card);
}
.cd-rec-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.cd-rec-tile--green { border-left: 3px solid #43A047; }
.cd-rec-tile--gray { border-left: 3px solid #9E9E9E; }
.cd-rec-tile__pair { font-size: 13px; font-weight: 600; color: var(--text); }
.cd-rec-tile__cat { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.cd-rec-tile__date { font-size: 10px; color: var(--text-muted); margin-top: 6px; opacity: 0.7; }

/* Confirm modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: var(--bg-card); border-radius: 12px;
    padding: 24px; min-width: 320px; max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.modal-text { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* =============================================================
   Domain Registration Pipeline
   ============================================================= */

/* Pipeline checkbox — custom styled */
.pipeline-check {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
    cursor: pointer;
}

/* Pipeline done icon (confirmed rows) */
.pipeline-done {
    color: var(--green);
    font-size: 14px;
    font-weight: 700;
}

/* Confirmed row — green left border + tinted bg */
.row-confirmed {
    background: var(--green-bg);
}
.row-confirmed td { border-bottom-color: rgba(16, 185, 129, 0.15); }

/* Progress bar (pipeline completion) */
.progress-bar-wrap {
    width: 80px;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-green { background: var(--green); }
.progress-blue { background: var(--accent); }
.progress-gray { background: var(--text-muted); }

/* Hosting badges */
.hosting-beget { background: rgba(255, 152, 0, 0.12); color: #E65100; }
.hosting-timeweb { background: rgba(33, 150, 243, 0.12); color: #1565C0; }
.hosting-regru { background: rgba(76, 175, 80, 0.12); color: #2E7D32; }
.hosting-other { background: rgba(139, 143, 163, 0.1); color: var(--text-muted); }

[data-theme="dark"] .hosting-beget { background: rgba(255, 152, 0, 0.15); color: #FFB74D; }
[data-theme="dark"] .hosting-timeweb { background: rgba(33, 150, 243, 0.15); color: #64B5F6; }
[data-theme="dark"] .hosting-regru { background: rgba(76, 175, 80, 0.15); color: #81C784; }

/* Domain candidate chips */
.candidate-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    transition: all 0.15s;
}
.candidate-chip.candidate-available { border-color: var(--green); background: var(--green-bg); }
.candidate-chip.candidate-taken { border-color: var(--red); background: rgba(239,68,68,0.06); opacity: 0.5; text-decoration: line-through; }
.candidate-chip.candidate-registered { border-color: var(--accent); background: var(--blue-bg); }

.candidate-badge { font-size: 10px; font-weight: 600; }
.badge-available { color: var(--green); }
.badge-taken { color: var(--red); }
.badge-registered { color: var(--accent); }

.candidate-del {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 14px; line-height: 1; padding: 0 2px; opacity: 0;
    transition: opacity 0.15s;
}
.candidate-chip:hover .candidate-del { opacity: 1; }
.candidate-del:hover { color: var(--red); }

/* Hosting group header */
.hosting-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.hosting-group-name {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
}

.hosting-group-count {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.hosting-group-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 11px;
}

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

.hosting-group-smtp {
    color: var(--text-muted);
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 11px;
    margin-left: auto;
}

/* Domain link */
.domain-link {
    color: var(--text);
    text-decoration: none;
}
.domain-link:hover {
    color: var(--accent);
}

/* Warmup — gray registration row */
.row-registration {
    opacity: 0.5;
}
.row-registration td { font-style: italic; }

/* =============================================================
   Warmup Page — Apple Style
   ============================================================= */

/* KPI 4-column grid */
.kpi-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Warmup KPI — compact BOTIX stat-cards */
.warmup-kpi {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}
.warmup-kpi-5 {
    grid-template-columns: repeat(5, 1fr);
}
.warmup-kpi-6 {
    grid-template-columns: repeat(6, 1fr);
}
.gc-src-active {
    box-shadow: 0 0 0 2px var(--accent, #007AFF);
}

.warmup-kpi .stat-card {
    border-radius: 12px;
    padding: 8px 6px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-width: 0;
}

.warmup-kpi .stat-value {
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.warmup-kpi .stat-sub {
    font-size: 11px;
    font-weight: 600;
    min-height: 16px;
}
.warmup-kpi .stat-label {
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    opacity: .6;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* KPI drag-and-drop */
.warmup-kpi .stat-card { cursor: grab; }
.warmup-kpi .stat-card:active { cursor: grabbing; }
.kpi-ghost { opacity: 0.3; }
.kpi-chosen { box-shadow: 0 4px 16px rgba(0,0,0,.15); transform: scale(1.03); z-index: 10; }
.kpi-drag { opacity: 0.7; }

/* База — stat tiles */
.biz-stats-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #86868b;
    margin-bottom: 8px;
}
.biz-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 6px;
}
.biz-tile-grid-10 {
    grid-template-columns: repeat(10, 1fr);
}
.biz-tile {
    border-radius: 10px;
    padding: 8px 5px 9px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}
.biz-tile-val {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.biz-tile-lbl {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    opacity: .65;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.biz-tile-cat     { background: rgba(16,185,129,.08); color: #059669; }
.biz-tile-capital { background: rgba(0,122,255,.10);  color: #007AFF; }
.biz-tile-million { background: rgba(16,185,129,.10); color: #10B981; }
.biz-tile-other   { background: rgba(60,60,67,.07);   color: #555; }
.biz-tile-total   { background: rgba(229,57,53,.08);  color: #E53935; }
.biz-tile-active  { box-shadow: 0 0 0 2px currentColor; }

.biz-summary-tiles {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}
.biz-summary-tiles .biz-tile { min-width: 86px; }
.filter-row-with-tiles {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 900px) {
    .warmup-kpi-5 { grid-template-columns: repeat(3, 1fr); }
    .warmup-kpi-6 { grid-template-columns: repeat(3, 1fr); }
    .biz-tile-grid-10 { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 480px) {
    .warmup-kpi-5 { grid-template-columns: repeat(2, 1fr); }
    .warmup-kpi-6 { grid-template-columns: repeat(2, 1fr); }
    .warmup-kpi .stat-value { font-size: 18px; }
}

/* Status dots (Apple-style) */
.warmup-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
}

.warmup-dot-green { background: var(--green); box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
.warmup-dot-blue { background: var(--accent); }
.warmup-dot-yellow { background: var(--yellow); }
.warmup-dot-orange { background: #D97706; }
.warmup-dot-red { background: var(--red); box-shadow: 0 0 6px rgba(239, 68, 68, 0.3); }
.warmup-dot-gray { background: var(--text-muted); }

/* Status text */
.warmup-status-text {
    font-size: 11px;
    color: var(--text-dim);
    vertical-align: middle;
}

/* Ready row — subtle green tint */
.warmup-row-ready {
    background: rgba(16, 185, 129, 0.04);
}

/* Progress bar (daily send progress) */
.warmup-progress-wrap {
    width: 64px;
    height: 4px;
    background: var(--bg-hover);
    border-radius: 2px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.warmup-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    min-width: 2%;
}

.warmup-fill-green { background: var(--green); }
.warmup-fill-blue { background: var(--accent); }
.warmup-fill-yellow { background: var(--yellow); }
.warmup-fill-orange { background: #D97706; }
.warmup-fill-red { background: var(--red); }
.warmup-fill-gray { background: var(--text-muted); }

/* Provider badge (in sends table) */
.warmup-provider {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-hover);
    color: var(--text-muted);
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Subject cell in sends table */
.sends-subject {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-dim);
}

/* Schedule phases grid */
.warmup-schedule-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    border-bottom: 1px solid var(--border);
}

.warmup-phase {
    padding: 16px 12px;
    text-align: center;
    border-right: 1px solid var(--border);
}

.warmup-phase:last-child { border-right: none; }

.warmup-phase-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.warmup-phase-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.warmup-phase-unit {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.warmup-schedule-footer {
    padding: 10px 20px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Help circle + popup */
.help-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--text-muted);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: all .2s;
    flex-shrink: 0;
}
.help-circle:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.help-popup {
    display: none;
    position: absolute;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 12px 16px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
    max-width: 320px;
    margin-top: 4px;
}
.help-popup.visible {
    display: block;
}

/* Recipient stats — 3 cards grid */
.recipient-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 900px) {
    .recipient-stats-grid { grid-template-columns: 1fr; }
}
.recipient-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}
.recipient-email {
    width: 90px;
    font-size: 11px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}
.recipient-bar-wrap {
    flex: 1;
    height: 14px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
}
.recipient-bar-bg {
    height: 100%;
    background: rgba(255,59,48,.25);
    border-radius: 3px;
    min-width: 4px;
    position: relative;
}
.recipient-bar-fill {
    height: 100%;
    background: rgba(52,199,89,.6);
    border-radius: 3px;
    transition: width .3s ease;
}
.recipient-nums {
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 42px;
    text-align: right;
    flex-shrink: 0;
}

/* Phase badge (in table) */
.warmup-phase-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
/* Фазы: от жёлтого (сырой) к красному (созрел) */
.warmup-phase-badge.phase-1 { background: rgba(250, 204, 21, 0.15); color: #CA8A04; }
.warmup-phase-badge.phase-2 { background: rgba(251, 146, 60, 0.15); color: #D97706; }
.warmup-phase-badge.phase-3 { background: rgba(249, 115, 22, 0.15); color: #C2410C; }
.warmup-phase-badge.phase-4 { background: rgba(239, 68, 68, 0.15); color: #DC2626; }
.warmup-phase-badge.phase-5 { background: rgba(220, 38, 38, 0.18); color: #B91C1C; }

/* Phase emails label */
.warmup-phase-emails {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Active phase highlight */
.warmup-phase-active {
    background: rgba(0, 122, 255, 0.06);
    border-color: var(--accent) !important;
}

/* Warmup table — compact Apple style */
.warmup-table th { padding: 6px 12px; }
.warmup-table td { padding: 6px 12px; font-size: 13px; }

/* Активен — нежно зелёный */
.warmup-phase-row-1,
.warmup-phase-row-2,
.warmup-phase-row-3,
.warmup-phase-row-4,
.warmup-phase-row-5 { background: rgba(52,199,89,0.07); }
/* Стоп (не запускался) — нежно серый */
.warmup-phase-row-0 { background: rgba(60,60,67,0.04); }
/* Warmup active pulse indicator */
.warmup-pulse {
    width: 7px; height: 7px; border-radius: 50%;
    background: #34C759; flex-shrink: 0;
    animation: warmup-pulse-anim 2s ease-in-out infinite;
}
@keyframes warmup-pulse-anim {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52,199,89,0.4); }
    50% { opacity: .6; box-shadow: 0 0 0 4px rgba(52,199,89,0); }
}

/* Пауза — нежно розовый */
.warmup-row-paused { background: rgba(255,59,48,0.05); }
.warmup-row-paused td { opacity: .7; }

/* Warmup table — fixed row height */
.warmup-table tbody tr { height: 44px; }

/* ALL warmup buttons — ONE size */
.warmup-btn {
    height: 28px; min-width: 72px; padding: 0 14px;
    border-radius: 6px; font-size: 12px; font-weight: 500;
    font-family: inherit; line-height: 1; white-space: nowrap;
    display: inline-flex; align-items: center; justify-content: center;
    box-sizing: border-box; cursor: pointer; transition: all 0.15s;
    border: 1px solid var(--border); background: transparent; color: var(--text-dim);
}
.warmup-btn:hover { border-color: var(--text-secondary); color: var(--text-secondary); }
.warmup-btn-start { border-color: var(--accent); color: var(--accent); }
.warmup-btn-start:hover { background: rgba(0,122,255,0.06); }
.warmup-btn-pause { border-color: #34C759; color: #34C759; }
.warmup-btn-pause:hover { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.04); }
.warmup-btn-pause:hover .pause-label-active { display: none; }
.warmup-btn-pause:hover .pause-label-stop { display: inline; }
.warmup-btn-pause .pause-label-stop { display: none; }
.warmup-btn-work { border-color: var(--green); color: var(--green); }
.warmup-btn-work:hover { background: rgba(52,199,89,0.06); }

/* Green button (move to work) */
.btn-green {
    background: var(--green);
    color: #fff;
    border: none;
}
.btn-green:hover {
    background: #059669;
}

/* Card header with button */
.card-header {
    display: flex;
    align-items: center;
}

@media (max-width: 800px) {
    .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .warmup-schedule-grid { grid-template-columns: repeat(3, 1fr); }
    .warmup-phase:nth-child(4),
    .warmup-phase:nth-child(5) { border-top: 1px solid var(--border); }
}

@media (max-width: 480px) {
    .warmup-schedule-grid { grid-template-columns: repeat(2, 1fr); }
    .warmup-phase-value { font-size: 16px; }
}

/* Warmup Templates Page */
.warmup-tpl-table th,
.warmup-tpl-table td { padding: 8px 14px; }

.tpl-row { cursor: pointer; transition: background 0.15s; }
.tpl-row:hover { filter: brightness(0.97); }
.tpl-row-open { font-weight: 500; }

.tpl-subject-cell { font-size: 13px; }

.tpl-detail td {
    padding: 0 !important;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.tpl-detail-inner {
    padding: 14px 20px 16px;
    margin-left: 130px;
    max-width: 600px;
}

.tpl-body-view {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
}

.tpl-body-edit textarea {
    width: 100%;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
}

@media (max-width: 700px) {
    .tpl-detail-inner { margin-left: 0; }
}

/* Warmup Mailboxes */
.mailbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px;
}

.mailbox-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(52, 199, 89, 0.08);
    border: 1px solid rgba(52, 199, 89, 0.3);
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s;
    user-select: none;
}
.mailbox-chip:hover { border-color: #34C759; }

.mailbox-chip.mailbox-off {
    background: var(--bg);
    border-color: var(--border);
    opacity: 0.5;
}

.mailbox-email { color: var(--text); font-weight: 500; }
.mailbox-provider { color: var(--text-muted); font-size: 11px; }

.mailbox-toggle {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #34C759;
    cursor: pointer;
    padding: 1px 5px;
    border: 1px solid rgba(52,199,89,.4);
    border-radius: 4px;
}
.mailbox-off .mailbox-toggle { color: var(--text-muted); border-color: var(--border); }
.mailbox-toggle:hover { opacity: 0.7; }

.mailbox-delete {
    font-size: 15px;
    font-weight: 300;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    margin-left: 2px;
}
.mailbox-delete:hover { color: #FF3B30; }

/* =============================================================
   Phase Slider
   ============================================================= */
.phase-slider {
    display: flex;
    gap: 3px;
    justify-content: center;
    align-items: center;
}
.phase-cell {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.phase-cell:hover { border-color: #007AFF; color: #007AFF; }
.phase-cell.active {
    background: #007AFF;
    border-color: #007AFF;
    color: #fff;
}
.phase-cell.paused { opacity: 0.6; }

/* =============================================================
   Health row colors
   ============================================================= */
tr.health-green { background: rgba(52,199,89,.04); }
tr.health-yellow { background: rgba(255,204,0,.08); }
tr.health-orange { background: rgba(255,149,0,.10); }
tr.health-red    { background: rgba(255,59,48,.08); }

.health-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    margin: 1px 2px 1px 0;
}
.health-badge.health-yellow { background: rgba(255,204,0,.2);  color: #b8860b; }
.health-badge.health-orange { background: rgba(255,149,0,.2);  color: #cc6600; }
.health-badge.health-red    { background: rgba(255,59,48,.15); color: #FF3B30; }

/* =============================================================
   Cron Status Bar (warmup health)
   ============================================================= */
.cron-status-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.cron-status-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cron-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-muted);
}
.cron-dot-green { background: #34C759; box-shadow: 0 0 6px rgba(52,199,89,.4); }
.cron-dot-yellow { background: #FF9500; box-shadow: 0 0 6px rgba(255,149,0,.3); }
.cron-dot-red { background: #FF3B30; box-shadow: 0 0 6px rgba(255,59,48,.3); }
.cron-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}
.cron-details {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

/* Warmup test buttons (SMTP/IMAP) */
.warmup-btn-test {
    height: 26px;
    min-width: 52px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
}
.warmup-btn-test:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.warmup-btn-test:disabled {
    opacity: .5;
    cursor: wait;
}

/* Text helpers */
.text-green { color: #34C759 !important; }
.text-yellow { color: #FF9500 !important; }
.text-red { color: #FF3B30 !important; }
.text-dim { color: var(--text-muted); }
.text-right { text-align: right; }
.mono { font-family: 'SF Mono', 'Menlo', monospace; font-variant-numeric: tabular-nums; }

/* =============================================================
   Warmup Log Page
   ============================================================= */

/* Summary counters */
.log-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.log-summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
}
.log-summary-num {
    font-weight: 700;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}
.log-summary-label {
    color: var(--text-muted);
    font-size: 12px;
}
.log-summary-ok .log-summary-num { color: var(--green); }
.log-summary-fail .log-summary-num { color: var(--red); }
.log-summary-reply .log-summary-num { color: var(--accent); }
.log-summary-bounce .log-summary-num { color: var(--orange, #FF9500); }

/* Filters bar */
.log-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.log-filters select,
.log-filters input[type="date"] {
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    background: var(--bg-input);
    color: var(--text);
}
.log-filters .btn-sm {
    height: 32px;
    padding: 0 14px;
    font-size: 12px;
}

/* Log table */
.log-table th { padding: 6px 10px; font-size: 11px; }
.log-table td { padding: 6px 10px; font-size: 12px; }
.log-table .log-time { white-space: nowrap; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.log-table .log-email { font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row-fail { background: rgba(255,59,48,.04); }
.log-row-bounce { background: rgba(255,149,0,.04); }

/* Provider badges */
.log-provider {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.log-provider-gmail { background: rgba(234,67,53,.1); color: #EA4335; }
.log-provider-yandex { background: rgba(255,204,0,.15); color: #CC9900; }
.log-provider-mail.ru, .log-provider-mail { background: rgba(0,122,255,.1); color: #007AFF; }
.log-provider-outlook, .log-provider-hotmail { background: rgba(0,120,212,.1); color: #0078D4; }
.log-provider-other { background: var(--bg-hover); color: var(--text-muted); }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
}
.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    transition: all .15s;
}
.pagination a {
    color: var(--text);
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pagination .active {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
}
.pagination .disabled {
    opacity: .4;
    pointer-events: none;
}

/* Event feed */
.event-feed {
    max-height: 400px;
    overflow-y: auto;
}
.event-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}
.event-row:last-child { border-bottom: none; }
.event-time {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    min-width: 90px;
}
.event-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}
.event-badge-smtp { background: rgba(0,122,255,.1); color: #007AFF; }
.event-badge-imap { background: rgba(52,199,89,.1); color: #34C759; }
.event-badge-cron { background: rgba(255,149,0,.1); color: #FF9500; }
.event-domain { font-weight: 600; white-space: nowrap; }
.event-detail { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-smtp_fail, .event-imap_fail, .event-imap_bounce { background: rgba(255,59,48,.03); }
.event-smtp_fail .event-badge-smtp { background: rgba(255,59,48,.1); color: #FF3B30; }
.event-imap_fail .event-badge-imap { background: rgba(255,59,48,.1); color: #FF3B30; }
.event-imap_bounce .event-badge-imap { background: rgba(255,149,0,.15); color: #FF9500; }

/* ===== Global Collection ===== */

/* Help button (?) */
.gc-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 6px;
    vertical-align: middle;
    transition: all .2s;
    line-height: 1;
}
.gc-help:hover {
    background: var(--accent);
    color: #fff;
}

/* Info panel (algorithm description) */
.gc-info-panel {
    position: relative;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.gc-info-panel__close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}
.gc-info-panel__close:hover { color: var(--text); }
.gc-info-panel__title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}
.gc-info-panel__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.gc-info-panel__block {
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.gc-info-panel__subtitle {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: .3px;
    margin-bottom: 6px;
}
.gc-info-panel__text {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-dim);
}

/* Controls row */
.gc-controls {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}
.gc-target { display: flex; flex-direction: column; gap: 6px; }
.gc-target label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.gc-target input { width: 160px; }
.gc-buttons { display: flex; gap: 8px; }

/* Source card: two columns (found | new) */
.gc-src-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    gap: 8px;
}
.gc-src-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}
.gc-src-col .stat-value { font-size: 22px; }
.gc-src-col .stat-label { margin-top: 2px; }
.gc-src-val.gc-src-new { color: #34C759; }
.gc-src-card .stat-label { font-size: 13px; font-weight: 600; }
/* Cooldown — dim the tile */
.gc-src-card.gc-src-cooldown {
    opacity: .35;
    filter: grayscale(.6);
}

.btn-stop {
    border-color: var(--red);
    color: var(--red);
}
.btn-stop:hover:not(:disabled) {
    background: var(--red);
    color: #fff;
}

/* Progress bar */
.gc-progress {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.gc-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.gc-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0;
}
.gc-progress-text {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-dim);
    white-space: nowrap;
    text-align: right;
}

/* Current task chip */
.gc-task-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    margin-bottom: 0;
    background: var(--bg-hover);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.gc-task-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #ccc;
}
.gc-task-dot--running {
    background: #34C759;
    animation: gc-pulse 2s ease-in-out infinite;
}
.gc-task-dot--paused {
    background: #FF9500;
}
.gc-task-dot--stopping {
    background: #FF3B30;
}
@keyframes gc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}
.gc-task-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gc-task-main {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.gc-task-sub {
    font-size: 12px;
    color: var(--text-dim);
}
/* Split progress text */
.gc-pct {
    font-size: 16px;
    font-weight: 700;
    color: #10B981;
}
.gc-detail {
    font-size: 13px;
    color: var(--text-primary);
}
.gc-time {
    font-size: 13px;
    color: var(--text-dim);
}

/* Category pills */
.gc-cat-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.gc-cat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.gc-cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.gc-cat-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .2px;
    border: 1px solid rgba(0,0,0,.06);
    transition: all .3s;
    cursor: default;
}
/* 10 levels: white → burgundy */
.gc-cat-pill.lvl-0  { background: #ffffff; color: #94A3B8; border-color: #E2E8F0; }
.gc-cat-pill.lvl-1  { background: #FFF5F5; color: #9B2C2C; border-color: #FED7D7; }
.gc-cat-pill.lvl-2  { background: #FED7D7; color: #9B2C2C; border-color: #FEB2B2; }
.gc-cat-pill.lvl-3  { background: #FEB2B2; color: #822727; border-color: #FC8181; }
.gc-cat-pill.lvl-4  { background: #FC8181; color: #fff; }
.gc-cat-pill.lvl-5  { background: #F56565; color: #fff; }
.gc-cat-pill.lvl-6  { background: #E53E3E; color: #fff; }
.gc-cat-pill.lvl-7  { background: #C53030; color: #fff; }
.gc-cat-pill.lvl-8  { background: #9B2C2C; color: #fff; }
.gc-cat-pill.lvl-9  { background: #742A2A; color: #fff; }
/* Active (currently parsing) */
.gc-cat-pill.gc-cat-active {
    box-shadow: 0 0 0 2px var(--accent);
}

/* GC Log panel */
.gc-log-section { margin-top: 16px; }
.gc-log-last { min-height: 22px; }
.gc-log-details {
    margin-top: 4px;
}
.gc-log-summary {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted, #86868b);
    cursor: pointer;
    padding: 6px 0;
    user-select: none;
}
.gc-log-summary:hover {
    color: var(--accent, #007AFF);
}
.gc-log-panel {
    max-height: 260px;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 8px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 11px;
    line-height: 1.6;
}
.gc-log-line {
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gc-log-time {
    color: var(--text-dim);
    opacity: 0.6;
    margin-right: 6px;
}
.gc-log-info { color: var(--text-dim); }
.gc-log-ok { color: #34C759; }
.gc-log-warn { color: #FF9500; }
.gc-log-error { color: #FF3B30; }
.gc-log-empty {
    color: var(--text-dim);
    text-align: center;
    padding: 20px;
}

/* Source problems */
.gc-src-problems {
    margin-top: 16px;
    border: 1px solid #FF3B30;
    border-radius: 10px;
    padding: 12px 14px;
    background: rgba(255,59,48,.03);
}
.gc-src-problems__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.gc-src-problems__title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #FF3B30;
}
.gc-src-problems__badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,149,0,.12);
    color: #FF9500;
}
.gc-src-problems__badge--critical {
    background: rgba(255,59,48,.12);
    color: #FF3B30;
    animation: prob-pulse 2s infinite;
}
@keyframes prob-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}
.gc-prob-src {
    margin-bottom: 4px;
}
.gc-prob-src > summary {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary, #1d1d1f);
    cursor: pointer;
    padding: 4px 0;
    list-style: none;
}
.gc-prob-src > summary::before {
    content: '▸ ';
    color: var(--text-muted);
}
.gc-prob-src[open] > summary::before {
    content: '▾ ';
}
.gc-prob-cnt {
    display: inline-block;
    min-width: 18px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 8px;
    background: rgba(255,149,0,.12);
    color: #FF9500;
    margin-left: 4px;
}
.gc-prob-src--critical .gc-prob-cnt {
    background: rgba(255,59,48,.12);
    color: #FF3B30;
}
.gc-prob-fix {
    font-size: 10px;
    font-weight: 600;
    color: #FF3B30;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-left: 6px;
}
.gc-prob-items {
    padding: 4px 0 4px 16px;
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 10px;
    line-height: 1.5;
}
.gc-prob-item {
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gc-prob-time {
    color: var(--text-muted);
    opacity: .6;
    margin-right: 4px;
}
.gc-prob-more {
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
}

@media (max-width: 900px) {
    .gc-info-panel__grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .gc-controls { flex-direction: column; align-items: stretch; }
}

/* ── Parser form (Apple Max) ──────────────────────────────────────────── */
.parser-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.parser-target-input {
    width: 80px;
    height: 40px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    background: var(--bg);
    color: var(--text);
    -moz-appearance: textfield;
}
.parser-target-input::-webkit-inner-spin-button,
.parser-target-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.gc-btn-start, .gc-btn-pause, .gc-btn-stop {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: all .15s;
    background: var(--bg);
    color: var(--text);
}
.gc-btn-start { background: var(--accent); color: #fff; border-color: var(--accent); }
.gc-btn-start:hover { filter: brightness(1.08); }
.gc-btn-pause:hover { background: var(--bg-hover); }
.gc-btn-stop { color: #EF4444; border-color: rgba(239,68,68,.3); }
.gc-btn-stop:hover { background: rgba(239,68,68,.06); }
.gc-btn-start:disabled, .gc-btn-pause:disabled, .gc-btn-stop:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.parser-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    margin: 0 4px;
}
.parser-sel select {
    height: 40px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}
.parser-sel select:hover { border-color: var(--accent); }

.btn-show-more {
    display: inline-block;
    padding: 6px 24px;
    font-size: 13px;
    color: var(--text-muted);
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all .15s;
}
.btn-show-more:hover { border-color: var(--accent); color: var(--accent); }

/* ── Блок восстановления ──────────────────────────────────────────────── */
.recovery-block {
    background: #fff1f0;
    border: 1px solid #ffccc7;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.recovery-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.recovery-icon { font-size: 18px; }
.recovery-hint { color: #888; font-size: 12px; }
.recovery-group {
    background: #fff;
    border: 1px solid #ffa39e;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}
.recovery-group-header {
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
}
.recovery-email {
    font-family: monospace;
    background: #fff2f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}
.recovery-letter-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}
.recovery-letter-body {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 12px;
    font-family: inherit;
    font-size: 13px;
    white-space: pre-wrap;
    margin: 0 0 10px 0;
    max-height: 200px;
    overflow-y: auto;
    color: #333;
}
.recovery-copy-btn { font-size: 12px; }

/* ── Мониторинг пар ───────────────────────────────────────────────────── */
.pairs-block {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.pairs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.pairs-table th {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 2px solid var(--border, #e5e5e5);
    color: var(--text-muted, #888);
    font-weight: 600;
    font-size: 12px;
}
.pairs-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border, #f0f0f0);
    font-family: monospace;
    font-size: 12px;
}
.pair-row:last-child td { border-bottom: none; }
.pair-spam td { background: #fff1f0; }
.pair-no_reply td { background: #fffbe6; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
}
.badge-green  { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.badge-red    { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.badge-orange { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.badge-gray   { background: #fafafa; color: #8c8c8c; border: 1px solid #d9d9d9; }
.pair-type { font-family: inherit; }

/* === Мониторинг цепочек (фазы) === */
.chains-block {
    margin-bottom: 20px;
}
.chains-phase-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--text-muted);
    margin-bottom: 6px; margin-top: 20px;
    display: flex; align-items: center; gap: 10px;
}
.chains-phase-title:first-child { margin-top: 0; }
.chains-phase-title::after { content:''; flex:1; height:1px; background:var(--border); }
.chains-toggle-ok {
    font-size: 11px; color: var(--text-muted); white-space: nowrap;
    padding: 2px 8px; height: auto; border-radius: 6px;
    background: var(--bg-hover); border: 1px solid var(--border);
    cursor: pointer;
}
.chains-table {
    width: 100%; border-collapse: collapse;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; overflow: hidden;
}
.chains-table td { border: none; vertical-align: middle; white-space: nowrap; }
.chains-dom {
    font-size: 13px; font-weight: 600;
    width: 200px; min-width: 200px;
    padding: 3px 14px;
}
.chains-score {
    width: 60px; min-width: 60px;
    padding: 3px 14px; text-align: right;
}
.chains-score-val {
    font-size: 12px; font-weight: 700;
    font-family: 'SF Mono','Menlo',monospace;
}
.chains-sqs { padding: 3px 14px; width: 100%; }
.sqs-wrap { display: flex; gap: 4px; align-items: center; }

.score-ok    { color: var(--green); }
.score-error { color: var(--red); }
.score-pending, .score-idle { color: var(--text-muted); }

/* ошибка — красная полоска слева */
.chains-row-error td { background: rgba(239,68,68,.04); }
.chains-row-error .chains-dom {
    border-left: 3px solid rgba(239,68,68,.4);
    padding-left: 11px;
}

/* ok-строки скрыты по умолчанию */
.chains-row-ok-hidden { display: none; }

/* кнопка сброса ошибки */
.btn-reset-err {
    padding: 0 8px; height: 22px; border-radius: 5px;
    font-size: 11px; font-weight: 700; font-family: 'SF Mono','Menlo',monospace;
    background: rgba(239,68,68,.12); color: #EF4444;
    border: 1px solid rgba(239,68,68,.35);
    cursor: pointer; white-space: nowrap; flex-shrink: 0; margin-left: 4px;
}
.btn-reset-err:hover { background: rgba(239,68,68,.22); }

/* квадраты (фаза 1-2) */
.sq { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; }
.sq-g { background: rgba(16,185,129,.35); border: 1px solid rgba(16,185,129,.5); }
.sq-b { background: rgba(0,122,255,.22);  border: 1px solid rgba(0,122,255,.35); }
.sq-r { background: rgba(239,68,68,.25);  border: 1px solid rgba(239,68,68,.4); }
.sq-f { background: #F1F5F9; border: 1px dashed #C8D3DF; }

/* полоски (фаза 3-5) */
.sl { width: 9px; height: 18px; border-radius: 3px; flex-shrink: 0; }
.sl-g { background: rgba(16,185,129,.45); border: 1px solid rgba(16,185,129,.5); }
.sl-b { background: rgba(0,122,255,.30);  border: 1px solid rgba(0,122,255,.4); }
.sl-r { background: rgba(239,68,68,.35);  border: 1px solid rgba(239,68,68,.4); }
.sl-f { background: #EEF2F7; border: 1px solid #D8E0EA; }

/* следующая отправка */
.sn {
    padding: 0 7px; height: 22px; border-radius: 5px;
    display: flex; align-items: center;
    font-size: 11px; font-weight: 700;
    font-family: 'SF Mono','Menlo',monospace;
    background: rgba(0,122,255,.10); color: var(--accent);
    border: 1px solid rgba(0,122,255,.3);
    white-space: nowrap; flex-shrink: 0;
}

/* === Settings panel === */
.gc-settings-panel {
    margin-bottom: 20px;
}
.gc-settings-card {
    padding: 20px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.gc-settings-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
}
.gc-servers-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}
.gc-servers-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--text-dim);
}
.gc-servers-btn.active {
    background: var(--bg-card);
    color: var(--accent);
    border-color: var(--accent);
}
.gc-servers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.gc-servers-table th {
    text-align: left;
    padding: 6px 10px;
    font-weight: 600;
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
}
.gc-servers-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}
.gc-servers-table tr:last-child td { border-bottom: none; }
.gc-srv-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
}
.gc-srv-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8c8c8c;
}
.gc-srv-dot--active { background: #34C759; }
.gc-srv-dot--offline { background: #8c8c8c; }
.gc-servers-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}
.gc-servers-howto {
    margin-top: 12px;
    font-size: 13px;
}
.gc-servers-howto summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 500;
}
.gc-servers-howto-body {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
}
.gc-servers-howto-body ol { margin: 0; padding-left: 20px; }
.gc-servers-howto-body pre {
    margin: 8px 0 0;
    padding: 8px 12px;
    background: var(--bg-hover);
    border-radius: 6px;
    font-size: 11px;
    overflow-x: auto;
}

/* ── Гибридная таблица прогрева по фазам ─────────────────────────── */
.hybrid-block { margin-bottom: 24px; }

.hybrid-phase-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: #94A3B8;
  margin-bottom: 6px; margin-top: 24px;
  display: flex; align-items: center; gap: 8px;
}
.hybrid-phase-title:first-of-type { margin-top: 0; }
.hybrid-phase-title::after { content:''; flex:1; height:1px; background:#E2E8F0; }

.hybrid-t {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid #E2E8F0; border-radius: 10px; overflow: hidden;
  table-layout: auto; margin-bottom: 0;
}
.hybrid-t thead th {
  font-size: 11px; font-weight: 600; color: #94A3B8;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 7px 14px; border-bottom: 1px solid #E2E8F0;
  text-align: center; white-space: nowrap;
}
.hybrid-t thead th.h-dom { text-align: left; }
.hybrid-t thead th.h-sqs { text-align: left; }

.hybrid-t td { border: none; vertical-align: middle; white-space: nowrap;
  padding: 3px 14px; font-size: 13px; font-weight: 700; color: #1E293B;
  text-align: center; }

/* ширины колонок */
.h-dom { text-align: left !important; width: 190px; }
.h-sqs { text-align: left !important; width: 180px; }
.h-num { width: 80px; }
.h-pct { width: 150px; text-align: right !important; }
.h-act { width: 120px; text-align: right !important; }

/* компактные квадратики */
.h-sqs-wrap { display: flex; gap: 5px; align-items: center; }
.csq {
  width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; font-family: 'SF Mono','Menlo',monospace;
}
.csq-g { background: rgba(16,185,129,.25); border: 1px solid rgba(16,185,129,.45); color: #059669; }
.csq-r { background: rgba(239,68,68,.18);  border: 1px solid rgba(239,68,68,.38);  color: #DC2626; }
.csq-f { background: #F1F5F9; border: 1px dashed #C8D3DF; color: #94A3B8; }
.csq-b { background: rgba(59,130,246,.18); border: 1px solid rgba(59,130,246,.4);  color: #2563EB; }
.csq-o { background: rgba(251,146,60,.22); border: 1px solid rgba(251,146,60,.5);  color: #C2410C; }

/* tooltip для квадратиков */
.csq { position: relative; }
.csq-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1E293B;
    color: #F1F5F9;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    font-family: 'SF Mono','Menlo',monospace;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    pointer-events: none;
    min-width: 140px;
    text-align: left;
}
.csq-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1E293B;
}
.csq:hover .csq-tip { display: block; }

/* время следующей отправки */
.csn {
  padding: 0 7px; height: 22px; border-radius: 5px;
  display: flex; align-items: center;
  font-size: 11px; font-weight: 700; font-family: 'SF Mono','Menlo',monospace;
  background: rgba(0,122,255,.10); color: #007AFF; border: 1px solid rgba(0,122,255,.3);
  white-space: nowrap; flex-shrink: 0;
}

/* прогресс */
.h-pbar-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.h-pbar { width: 96px; height: 5px; border-radius: 3px; background: #E2E8F0; overflow: hidden; }
.h-pbar-fill { height: 100%; border-radius: 3px; }
.h-fill-ok { background: #10B981; }
.h-fill-lo { background: #CBD5E1; }
.h-pct-val { font-size: 12px; font-weight: 700; font-family: 'SF Mono','Menlo',monospace; }
.h-pct-ok { color: #10B981; }
.h-pct-lo { color: #94A3B8; }
.h-pct-err { color: #EF4444; }

/* кнопки */
.h-btn-active { }
.h-btn-reset {
  padding: 0 12px; height: 26px; border-radius: 6px;
  font-size: 11px; font-weight: 700;
  background: rgba(239,68,68,.08); color: #EF4444;
  border: 1.5px solid rgba(239,68,68,.35);
  cursor: pointer; white-space: nowrap;
}
.h-btn-reset:hover { background: rgba(239,68,68,.18); }

/* строка с ошибкой */
.hybrid-row-error td { background: rgba(239,68,68,.03); }
.hybrid-row-error .h-dom { border-left: 3px solid rgba(239,68,68,.4); padding-left: 11px; }

/* ok-строки скрыты */
.hybrid-row-ok-hidden { display: none; }

/* bounce notify block над таблицей */
.bounce-notify-block {
    background: rgba(251,146,60,.08);
    border: 1px solid rgba(251,146,60,.35);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.bounce-notify-title {
    display: flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 700; color: #C2410C;
    margin-bottom: 8px;
}
.bounce-notify-list { display: flex; flex-direction: column; gap: 4px; }
.bounce-notify-row { font-size: 12px; font-family: 'SF Mono','Menlo',monospace; }
.bounce-notify-from { font-weight: 700; color: #9A3412; }
.bounce-notify-targets { color: #1E293B; margin-left: 4px; }

/* inline bounce hint */
.h-hint { text-align: left !important; white-space: nowrap; overflow: visible; }
.bounce-hints-wrap { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.bounce-hint {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(251,146,60,.10); border: 1px solid rgba(251,146,60,.35);
    border-radius: 6px; padding: 3px 9px 3px 6px;
    font-size: 11px; font-weight: 600;
    font-family: 'SF Mono', 'Menlo', monospace;
    color: #C2410C; white-space: nowrap;
}
.bounce-hint svg { flex-shrink: 0; opacity: 0.75; }
.bounce-hint-arrow { color: #9A3412; opacity: 0.5; font-size: 10px; margin: 0 1px; }

/* ── /start — Block 1: Mailbox table ── */
.start-table { border-collapse: collapse; }
.start-table thead th { padding: 8px 16px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.start-table tbody td { padding: 3px 16px; font-size: 13px; vertical-align: middle; }
.start-table tbody tr:hover td { background: var(--bg-hover); }
.start-table .done-row td { background: rgba(16,185,129,.03); }
/* hosting separator row */
.start-table .hosting-sep td { padding: 0; }
.start-table .hosting-sep .hg { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--bg-hover); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 12px; }
.start-table .hosting-sep:first-child .hg { border-top: none; }
.start-table .hosting-sep .hg strong { font-weight: 700; font-size: 12px; color: var(--text); }
.start-table .hosting-sep .hg .smtp { color: var(--text-muted); font-size: 11px; }
.start-table .hosting-sep .hg .cnt { margin-left: auto; font-size: 11px; color: var(--text-muted); }
/* domain + name on one line */
.domain-cell { display: flex; align-items: baseline; gap: 8px; }
.domain-cell .dname { font-size: 13px; font-weight: 500; white-space: nowrap; }
.domain-cell .fname { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
/* field + copy button */
.fc { display: flex; align-items: center; gap: 5px; }
.fc input[type=text] { height: 30px; width: 148px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; font-size: 12px; font-family: inherit; background: var(--bg-input); color: var(--text); outline: none; }
.fc input[type=text]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,122,255,.1); }
.fc input.mono { font-family: 'SF Mono','Menlo','Consolas',monospace; font-size: 11px; }
.fc .saved-val { font-size: 13px; font-weight: 500; color: var(--green); }
.fc .saved-pwd { font-size: 12px; color: var(--text-muted); }
/* icon button */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 0; }
.btn-icon:hover { background: var(--bg-hover); color: var(--text-dim); }
/* badges for start */
.badge-done { background: rgba(16,185,129,.1); color: var(--green); }
