/* Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #1e293b;
    line-height: 1.6;
    font-weight: 400;
    scroll-behavior: smooth;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    color: white;
    padding: 1.25rem 0;
    box-shadow: 0 8px 32px rgba(30, 64, 175, 0.2);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: speedLine 4s infinite;
}

@keyframes speedLine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.logo img {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.025em;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s ease;
}

.nav-item:hover::before {
    left: 100%;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Main Content */
.main-content {
    padding: 2.5rem 0;
    min-height: calc(100vh - 120px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    transition: max-width 0.4s ease-in-out;
}

/* Controls Panel */
.controls-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.controls-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    opacity: 0.6;
}

.filters {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.filter-group label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.date-input,
.filter-select {
    padding: 0.875rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    height: auto;
    min-height: 48px;
    font-weight: 500;
}

.date-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.selected-count {
    font-weight: 600;
    color: #64748b;
    padding: 0.75rem 1rem;
    background: rgba(100, 116, 139, 0.1);
    border-radius: 12px;
    font-size: 0.875rem;
}

/* Кнопки */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.btn-secondary {
    background: rgba(248, 250, 252, 0.8);
    color: #64748b;
    border: 2px solid #e2e8f0;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(241, 245, 249, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

/* Table */
.table-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    overflow-x: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
}

.leads-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.25rem;
    text-align: left;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leads-table td {
    padding: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-weight: 500;
}

.leads-table tr {
    transition: all 0.3s ease;
}

.leads-table tr:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, rgba(147, 197, 253, 0.02) 100%);
    transform: scale(1.001);
}

.checkbox-col, .flag-col, .actions-col { width: 60px; text-align: center; }
.flag-icon { width: 28px; height: 20px; border-radius: 4px; display: inline-block; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
.phone-number { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.9rem; font-weight: 500; color: #374151; }

/* Status badges */
.status-badge { padding: 0.5rem 1rem; border-radius: 12px; font-size: 0.75rem; font-weight: 700; text-align: center; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.05em; position: relative; overflow: hidden; }
.status-badge::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent); transition: left 2s ease; }
.status-badge:hover::before { left: 100%; }
.status-new { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); color: #78350f; box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3); }
.status-sent { background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%); color: #1e3a8a; box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3); }
.status-sent.cryp-im { background: linear-gradient(135deg, #34d399 0%, #10b981 100%); color: #064e3b; box-shadow: 0 4px 15px rgba(52, 211, 153, 0.3); }
.status-sent.traffic-titans { background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%); color: #4c1d95; box-shadow: 0 4px 15px rgba(167, 139, 250, 0.3); }
.status-sent.moonstar { background: linear-gradient(135deg, #fb923c 0%, #f97316 100%); color: #9a3412; box-shadow: 0 4px 15px rgba(251, 146, 60, 0.3); }
.action-btn { padding: 0.75rem; background: rgba(248, 250, 252, 0.8); border: 1px solid #e2e8f0; cursor: pointer; border-radius: 12px; color: #64748b; transition: all 0.3s ease; backdrop-filter: blur(10px); }
.action-btn:hover { background: rgba(241, 245, 249, 0.9); color: #3b82f6; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: 2rem 0; }
.page-info { font-weight: 600; color: #64748b; background: rgba(248, 250, 252, 0.8); padding: 0.75rem 1.5rem; border-radius: 12px; backdrop-filter: blur(10px); }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; align-items: center; justify-content: center; }
.modal.show { display: flex; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px); z-index: 999; display: none; }
.modal-overlay.show { display: block; }
.modal-content { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); border-radius: 24px; width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25); animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid rgba(255, 255, 255, 0.2); }
.modal-content.modal-lg { max-width: 800px; }
@keyframes modalSlideIn { from { opacity: 0; transform: scale(0.9) translateY(-40px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { padding: 2rem; border-bottom: 1px solid rgba(226, 232, 240, 0.5); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; color: #1e293b; font-weight: 700; font-size: 1.5rem; }
.close-btn { background: rgba(248, 250, 252, 0.8); border: 1px solid #e2e8f0; cursor: pointer; padding: 0.75rem; color: #64748b; border-radius: 12px; transition: all 0.3s ease; backdrop-filter: blur(10px); }
.close-btn:hover { background: rgba(241, 245, 249, 0.9); color: #ef4444; transform: scale(1.05); }
.modal-body { padding: 2rem; }
.modal-footer { padding: 2rem; border-top: 1px solid rgba(226, 232, 240, 0.5); display: flex; justify-content: flex-end; gap: 1rem; }

/* Partner Selection */
.partner-selection label { display: block; margin-bottom: 1.5rem; font-weight: 700; color: #1e293b; font-size: 1.1rem; }
.partner-options { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.partner-option { display: block; margin: 0; }
.partner-option input[type="radio"] { display: none; }
.partner-card { display: flex; align-items: center; gap: 1rem; padding: 1.5rem; border: 2px solid #e2e8f0; border-radius: 16px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); background: rgba(248, 250, 252, 0.5); backdrop-filter: blur(10px); }
.partner-option input[type="radio"]:checked + .partner-card { border-color: #3b82f6; background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 197, 253, 0.05) 100%); box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15); transform: scale(1.02); }
.partner-card:hover { border-color: #60a5fa; background: linear-gradient(135deg, rgba(96, 165, 250, 0.05) 0%, rgba(191, 219, 254, 0.05) 100%); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08); }
.partner-card i { font-size: 1.5rem; color: #3b82f6; }
.partner-card span { font-weight: 600; color: #1e293b; }
.selected-leads-info { margin-top: 2rem; padding: 1.5rem; background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 197, 253, 0.05) 100%); border-radius: 16px; border: 1px solid rgba(59, 130, 246, 0.2); }
.selected-leads-info p { margin: 0; color: #1e293b; font-weight: 500; }

/* Columns Control Panel */
.columns-control-panel { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(20px); padding: 1.5rem 2rem; border-radius: 20px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08); margin-bottom: 2rem; display: flex; align-items: center; flex-wrap: wrap; gap: 2rem; font-size: 0.875rem; border: 1px solid rgba(255, 255, 255, 0.2); }
.columns-control-panel span { font-weight: 700; color: #1e293b; font-size: 1rem; }
.checkbox-group { display: flex; align-items: center; gap: 0.75rem; transition: transform 0.2s ease; }
.checkbox-group:hover { transform: scale(1.05); }
.checkbox-group label { cursor: pointer; color: #64748b; font-weight: 500; }
.checkbox-group input[type="checkbox"] { cursor: pointer; transform: scale(1.2); }

.custom-param-col,
.user-agent-col {
    display: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}
.leads-table.show-user-agent-col .user-agent-col,
.leads-table.show-subid-col .subid-col,
.leads-table.show-custom1-col .custom1-col,
.leads-table.show-custom2-col .custom2-col,
.leads-table.show-custom3-col .custom3-col,
.leads-table.show-custom4-col .custom4-col,
.leads-table.show-custom5-col .custom5-col {
    display: table-cell;
}

/* Forms */
.form-group-modal { margin-bottom: 1.5rem; }
.form-group-modal label { display: block; margin-bottom: 0.75rem; font-weight: 600; color: #1e293b; }
.form-input { width: 100%; padding: 1rem; border: 2px solid #e2e8f0; border-radius: 16px; font-size: 1rem; transition: all 0.3s ease; background: rgba(248, 250, 252, 0.5); backdrop-filter: blur(10px); }
.form-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); background: rgba(255, 255, 255, 1); }
.form-textarea { width: 100%; padding: 1rem; border: 2px solid #e2e8f0; border-radius: 16px; font-size: 0.9rem; font-family: 'Inter', sans-serif; resize: vertical; min-height: 80px; transition: all 0.3s ease; background: rgba(248, 250, 252, 0.5); backdrop-filter: blur(10px); }
.form-textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); background: rgba(255, 255, 255, 1); }

/* intl-tel-input */
.iti { width: 100%; }
.iti__flag-container { z-index: 1001; }

/* === СТИЛИ ДЛЯ СТРАНИЦЫ НАСТРОЕК (БЫВШИЙ FUNNELS.CSS) === */
.page-header { text-align: center; margin-bottom: 3rem; }
.page-header h2 { color: #1e293b; margin-bottom: 0.75rem; font-size: 2.5rem; font-weight: 800; background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.page-description { color: #64748b; font-size: 1.2rem; font-weight: 500; }
.settings-card, .add-rule-card, .rules-card { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(20px); border-radius: 24px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08); margin-bottom: 2rem; border: 1px solid rgba(255, 255, 255, 0.2); }
.card-header { padding: 2rem; border-bottom: 1px solid rgba(226, 232, 240, 0.5); display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { margin: 0; color: #1e293b; display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.25rem; }
.rules-stats { display: flex; gap: 1.5rem; }
.stat-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: #64748b; font-weight: 500; }
.card-body { padding: 2rem; }
.auto-send-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; align-items: end; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.form-group label { font-weight: 600; color: #1e293b; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }
.form-select { padding: 1rem; border: 2px solid #e2e8f0; border-radius: 16px; font-size: 0.875rem; transition: all 0.3s ease; background: rgba(248, 250, 252, 0.8); backdrop-filter: blur(10px); font-weight: 500; }
.form-select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); background: rgba(255, 255, 255, 1); }
.form-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; }
.rules-container { display: flex; flex-direction: column; gap: 1.5rem; }
.rule-item { border: 2px solid #e2e8f0; border-radius: 20px; padding: 1.5rem; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; justify-content: space-between; align-items: center; background: rgba(248, 250, 252, 0.5); backdrop-filter: blur(10px); }
.rule-item.active { border-color: #10b981; background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(52, 211, 153, 0.05) 100%); box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15); }
.rule-item.paused { border-color: #f59e0b; background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(251, 191, 36, 0.05) 100%); box-shadow: 0 8px 25px rgba(245, 158, 11, 0.15); }
.rule-main, .rule-info { flex: 1; }
.rule-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.country-badge, .partner-badge { padding: 0.5rem 1rem; border-radius: 12px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.country-badge { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #1e40af; }
.partner-badge { background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%); color: #7c3aed; }
.partner-badge.partner-cryp-im { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); color: #065f46; }
.partner-badge.partner-traffic-titans { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #1e40af; }
.partner-badge.partner-moonstar { background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%); color: #9a3412; }
.arrow-icon { color: #64748b; }
.rule-meta { display: flex; gap: 1.5rem; margin-top: 0.75rem; }
.meta-item { font-size: 0.75rem; color: #94a3b8; display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.rule-status { margin-left: 1.5rem; }
.status-badge.status-active { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); color: #065f46; }
.status-badge.status-paused { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; }
.rule-actions { display: flex; gap: 0.75rem; margin-left: 1.5rem; }
.action-btn.pause-btn:hover, .action-btn.play-btn:hover { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.action-btn.delete-btn:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.empty-state { text-align: center; padding: 4rem; color: #94a3b8; }
.empty-state i { font-size: 4rem; margin-bottom: 1.5rem; opacity: 0.5; color: #cbd5e1; }
.empty-state h3 { margin-bottom: 0.75rem; color: #64748b; font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.stat-card { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(20px); border-radius: 20px; padding: 2rem; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08); display: flex; align-items: center; gap: 1.5rem; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid rgba(255, 255, 255, 0.2); }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15); }
.stat-icon { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.5rem; box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3); }
.stat-card.failures .stat-icon { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3); }
.stat-info h4 { margin: 0 0 0.5rem; color: #64748b; font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-number { margin: 0; font-size: 2rem; font-weight: 800; color: #1e293b; }
.failures-list { list-style: none; padding: 0; margin: 0; max-height: 50vh; overflow-y: auto; }
.failure-item { padding: 1.5rem; border-bottom: 1px solid rgba(226, 232, 240, 0.5); transition: background 0.2s ease; }
.failure-item:hover { background: rgba(248, 250, 252, 0.5); }
.failure-item:last-child { border-bottom: none; }
.failure-header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 0.75rem; }
.failure-lead-info { color: #1e293b; }
.failure-timestamp { font-size: 0.8rem; color: #94a3b8; }
.failure-reason { background: rgba(248, 250, 252, 0.8); border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem; font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.85rem; color: #ef4444; white-space: pre-wrap; word-break: break-all; backdrop-filter: blur(10px); }

/* Responsive Design */
@media (max-width: 1200px) { .container { max-width: 100%; padding: 0 1.5rem; } .stats-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); } }
@media (max-width: 768px) { .header-content { flex-direction: column; gap: 1.5rem; padding: 0 1rem; } .logo h1 { font-size: 1.5rem; } .nav { flex-wrap: wrap; justify-content: center; } .nav-item { padding: 0.75rem 1.25rem; font-size: 0.875rem; } .controls-panel { flex-direction: column; align-items: stretch; padding: 1.5rem; gap: 1.5rem; } .filters { justify-content: center; flex-wrap: wrap; } .bulk-actions { justify-content: center; flex-wrap: wrap; } .leads-table { min-width: 800px; font-size: 0.875rem; } .leads-table th, .leads-table td { padding: 1rem 0.75rem; } .modal-content { margin: 1rem; width: calc(100% - 2rem); border-radius: 20px; } .modal-header, .modal-body, .modal-footer { padding: 1.5rem; } .form-row { grid-template-columns: 1fr; gap: 1rem; } .rule-item { flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1.25rem; } .rule-actions { margin-left: 0; align-self: flex-end; } .stats-grid { grid-template-columns: 1fr; gap: 1rem; } .stat-card { padding: 1.5rem; } .page-header h2 { font-size: 2rem; } .columns-control-panel { flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1.5rem; } }
@media (max-width: 480px) { .container { padding: 0 1rem; } .header { padding: 1rem 0; } .logo img { height: 50px; } .logo h1 { font-size: 1.25rem; } .nav-item { padding: 0.625rem 1rem; font-size: 0.8rem; } .controls-panel, .card-body { padding: 1.25rem; } .btn { padding: 0.75rem 1.25rem; font-size: 0.8rem; } .page-header h2 { font-size: 1.75rem; } .stat-icon { width: 50px; height: 50px; font-size: 1.25rem; } .stat-number { font-size: 1.5rem; } }
@media (min-width: 1400px) { .container { max-width: 1600px; } .header-content { max-width: 1600px; } }

/* Дополнительные анимации */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.status-badge.status-sent { animation: pulse 2s infinite; }
@keyframes shimmer { 0% { background-position: -100% 0; } 100% { background-position: 100% 0; } }
.loading-shimmer { background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }

/* Улучшенные скроллбары */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(241, 245, 249, 0.5); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); }

/* --- Стили для иконки ошибки --- */
.status-cell { display: flex; align-items: center; gap: 0.75rem; }
.error-icon { color: #ef4444; cursor: pointer; font-size: 1.2rem; transition: all 0.2s ease; filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.3)); }
.error-icon:hover { color: #dc2626; transform: scale(1.25); }

/* --- Стили для модального окна ошибки --- */
#error-modal .modal-content { max-width: 700px; }
#error-modal-body { background: #1e293b; color: #e2e8f0; border-radius: 16px; padding: 1.5rem; font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.875rem; white-space: pre-wrap; word-break: break-all; max-height: 60vh; overflow-y: auto; border: 1px solid #334155; box-shadow: inset 0 2px 10px rgba(0,0,0,0.3); }

/* --- Стили для textarea в модальных окнах --- */
.template-hint { display: block; margin-top: 0.5rem; color: #64748b; font-size: 0.8rem; }
.template-hint code { background: #e2e8f0; padding: 2px 4px; border-radius: 4px; color: #475569; }
.toggle-switch { display: flex; align-items: center; gap: 0.75rem; font-weight: 500; color: #475569; }
.toggle-input { display: none; }
.toggle-label { display: inline-block; width: 48px; height: 24px; background-color: #cbd5e1; border-radius: 12px; position: relative; cursor: pointer; transition: background-color 0.2s; }
.toggle-label::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; background-color: white; top: 2px; left: 2px; transition: transform 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.toggle-input:checked + .toggle-label { background-color: #2563eb; }
.toggle-input:checked + .toggle-label::after { transform: translateX(24px); }

/* === НОВЫЕ СТИЛИ ДЛЯ ОТОБРАЖЕНИЯ СТАТУСОВ === */

/* Контейнер для бейджей и иконки ошибки */
.status-cell {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Позволяет бейджам переноситься, если их много */
    gap: 0.5rem;     /* Отступ между бейджами и иконкой */
}

/* Дополнительный стиль, чтобы бейджи не "прилипали" друг к другу */
.status-cell .status-badge {
    margin: 2px;
}