:root {
    --primary-color: #324f76;
    --primary-hover: #0d8ae6;
    --secondary-color: #EA7521;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #333;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
}

/* ===== ÎÁÙÈÅ ÑÒÈËÈ ===== */
body {
    font-size: 0.875rem;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--dark-color);
    background-color: #f5f7fa;
}

.container {
    max-width: 1400px;
}

/* ===== ÊÀÐÒÎ×ÊÈ ===== */
.card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    animation: fadeIn 0.3s ease-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    background-color: rgba(50, 79, 118, 0.03);
}

.app-header-bg {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.card-body {
    padding: 0.75rem !important;
}

/* ===== ÅÄÈÍÛÅ ÑÒÈËÈ ØÀÏÊÈ ===== */
.app-header {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--light-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.app-title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.3rem;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
}

.app-icon {
    color: var(--primary-color);
    font-size: 1.4rem;
}

/* Ñòèëè äëÿ ññûëîê-êíîïîê */
.mode-link {
    color: white !important;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mode-link i {
    font-size: 0.9rem;
}

.mode-link:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 138, 230, 0.2);
    text-decoration: none;
}

.mode-link:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.mode-link::after {
    display: none;
}

.mode-separator {
    color: var(--text-muted);
    margin: 0 0.25rem;
    font-weight: 500;
}

/* ===== ÊÍÎÏÊÈ ===== */
.btn {
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.app-btn {
    color: white !important;
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.app-btn:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 138, 230, 0.2);
}

.app-btn:active,
.app-btn.active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: white !important;
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.btn-xs {
    padding: 0.4rem 0.5rem !important;
    font-size: 0.85rem !important;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* ===== DROPDOWN ÌÅÍÞ ===== */
.dropdown-menu {
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 6px;
    padding: 0.5rem 0;
    margin-top: 0.25rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    color: var(--dark-color);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
}

.dropdown-item i {
    color: var(--primary-color);
    width: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: rgba(50, 79, 118, 0.08);
    color: var(--primary-color);
}

.dropdown-divider {
    margin: 0.4rem 0;
    border-top: 1px solid var(--border-color);
}

.dropdown-toggle::after {
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ===== ÒÎÃÃËÅÐ ===== */
.toggle-container {
    display: flex;
    align-items: center;
}

.toggle-switch {
    display: flex;
    background: #e9ecef;
    border-radius: 50px;
    padding: 2px;
    width: 120px;
    position: relative;
    cursor: pointer;
    border: 1px solid #ced4da;
    user-select: none;
}

.toggle-option {
    flex: 1;
    text-align: center;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.toggle-option:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.toggle-option.active {
    color: white;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    background: var(--primary-color);
    border-radius: 50px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    z-index: 1;
}

.toggle-switch[data-active="tts"] .toggle-slider {
    transform: translateX(calc(100% + 2px));
}

.toggle-switch[data-active="tts"] .toggle-option[data-value="tts"],
.toggle-switch[data-active="1x2"] .toggle-option[data-value="1x2"] {
    color: white;
}

/* ===== ÔÎÐÌÛ ===== */
.form-control {
    font-size: 0.85rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(50, 79, 118, 0.25);
}

.form-control-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.375rem;
    height: 32px;
}

/* ===== ÊÓÏÎÍÛ ===== */
.coupon-input-container {
    position: relative;
    width: 100%;
}

.coupon-textarea {
    font-size: 0.85rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    resize: none !important;
    overflow-x: auto;
    overflow-y: auto;
    white-space: pre;
    line-height: 1.2;
    padding: 0.5rem;
    min-height: 80px;
    height: 100%;
    width: 100%;
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.coupon-textarea:focus {
    background-color: white;
    border-color: var(--primary-color);
}

.results-textarea {
    font-size: 0.85rem;
    font-family: monospace;
    min-height: 80px;
    width: 100%;
}

.coupon-code {
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
    border: 0.5px #dee2e6;
    white-space: pre-wrap;
    word-break: break-all;
    transition: all 0.2s ease;
}

.coupon-code:hover {
    background-color: #e9ecef;
    border-color: var(--primary-color);
    cursor: pointer;
}

/* ===== ÑÒÀÒÈÑÒÈÊÀ ===== */
.stats-table {
    font-size: 0.8rem;
    margin-bottom: 0;
}

.stats-th {
    font-weight: 600;
    padding: 0.25rem 0.375rem !important;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    height: 32px;
}

.stats-td {
    padding: 0.2rem 0.375rem !important;
    vertical-align: middle;
    border: 1px solid var(--border-color);
    height: 32px;
}

.stats-td-index {
    font-weight: 600;
    background-color: var(--light-color);
    width: 20%;
}

.percentage {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: 1px;
}

/* ===== ÔÈËÜÒÐÛ ===== */
.filter-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-section-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--primary-color);
}

.filter-section-header i {
    color: var(--primary-color);
    font-size: 1rem;
    margin-right: 0.5rem;
}

.filter-section-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.filter-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.filter-description-container {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    max-height: 100px;
    overflow-y: auto;
    padding-right: 5px;
}

/* ß÷åéêè ìèíóñîâ */
.minus-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    justify-content: space-between;
}

.minus-cell {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: normal;
    background: white;
    text-align: center;
}

.minus-cell:hover {
    border-color: var(--primary-color);
    background-color: var(--light-color);
    transform: translateY(-1px);
}

.minus-cell.selected-1 {
    background-color: rgba(25, 135, 84, 0.15);
    border-color: var(--success-color);
    color: var(--success-color);
    font-weight: 600;
}

.minus-cell.selected-X {
    background-color: rgba(255, 193, 7, 0.2);
    border-color: var(--warning-color);
    color: #856404;
    font-weight: 600;
}

.minus-cell.selected-2 {
    background-color: rgba(220, 53, 69, 0.15);
    border-color: var(--danger-color);
    color: var(--danger-color);
    font-weight: 600;
}

/* Ñåãìåíòû */
.segment-filter {
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.segment-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Ðåéíäæ ñëàéäåð */
.range-slider-container {
    width: 100%;
    margin: 0.75rem 0;
    position: relative;
    height: 40px;
}

.range-slider {
    position: relative;
    width: 100%;
    height: 30px;
    margin-top: 5px;
}

.range-slider-track {
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    transform: translateY(-50%);
}

.range-slider-fill {
    position: absolute;
    top: 50%;
    height: 6px;
    background: var(--primary-color);
    border-radius: 3px;
    transform: translateY(-50%);
}

.range-slider-handle {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.range-slider-handle:hover {
    background: var(--light-color);
    transform: translate(-50%, -50%) scale(1.1);
}

.range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

.range-values span {
    background: rgba(50, 79, 118, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    min-width: 20px;
    text-align: center;
}

/* Àêòèâíûå ôèëüòðû */
.active-filter {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.active-filter:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transform: translateX(2px);
}

.active-filter .remove-filter {
    color: var(--danger-color);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.125rem 0.25rem;
    line-height: 1;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.active-filter .remove-filter:hover {
    background-color: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

/* Ñòàòèñòèêà ôèëüòðîâ */
.filter-stats,
.filter-stats-total {
    font-size: 0.75rem;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    min-width: 24px;
    text-align: center;
}

.filter-stats {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.filter-stats.negative {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.filter-stats.neutral {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.filter-stats-total {
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.filter-stats-total.negative {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.filter-stats-total.neutral {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

/* Áåéäæè èñõîäîâ */
.outcome-badge,
.total-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    min-width: 28px;
    text-align: center;
}

.outcome-p1 { background-color: rgba(25,135,84,0.1); color: #198754; }
.outcome-draw { background-color: rgba(255,193,7,0.1); color: #856404; }
.outcome-p2 { background-color: rgba(220,53,69,0.1); color: #dc3545; }
.outcome-ld { background-color: rgba(111,66,193,0.1); color: #6f42c1; }
.total-under { background-color: rgba(13,110,253,0.1); color: #0d6efd; }
.total-over { background-color: rgba(25,135,84,0.1); color: #198754; }

/* Áåéäæè òèïîâ ôèëüòðîâ */
.filter-type-badge {
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 1px;
}

.range-badge {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.minus-badge {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.segment-badge {
    background-color: rgba(0, 123, 255, 0.15);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.row-badge {
    background-color: rgba(13, 110, 253, 0.15);
    color: #0d6efd;
    border: 1px solid rgba(13, 110, 253, 0.3);
}

.pattern-badge {
    background-color: rgba(111, 66, 193, 0.15);
    color: #6f42c1;
    border: 1px solid rgba(111, 66, 193, 0.3);
}

.anomaly-badge {
    background-color: rgba(253, 126, 20, 0.15);
    color: #fd7e14;
    border: 1px solid rgba(253, 126, 20, 0.3);
}

.conditional-badge {
    background-color: rgba(25, 135, 84, 0.15);
    color: #198754;
    border: 1px solid rgba(25, 135, 84, 0.3);
}

/* Ýëåìåíòû ôèëüòðîâ */
.filter-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 2px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.filter-item:last-child {
    border-bottom: none;
}

.filter-details {
    font-size: 0.7rem;
    color: #6c757d;
    line-height: 1.3;
    word-break: break-word;
    flex-grow: 1;
}

.impact-container {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.impact-current,
.impact-total {
    display: flex;
    align-items: center;
    gap: 4px;
}

.impact-label {
    font-size: 0.7rem;
    color: #6c757d;
    cursor: help;
}

/* ===== ÒÀÁËÈÖÛ ===== */
.unified-table {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.unified-table-header {
    background-color: #e9ecef !important;
}

.unified-th {
    font-weight: 600;
    padding: 0.5rem 0.375rem !important;
    border-bottom: 2px solid #dee2e6 !important;
    text-align: center;
    vertical-align: middle;
    background-color: #e9ecef !important;
    color: var(--primary-color);
    border-top: none !important;
}

.unified-table td {
    padding: 0.375rem !important;
    vertical-align: middle;
    border: 1px solid #dee2e6 !important;
}

.unified-table-min-row td,
.unified-table-max-row td {
    background-color: #f8f9fa !important;
    border-top: 1px solid #dee2e6 !important;
}

.unified-td-label {
    background-color: #f1f3f4 !important;
    font-weight: 600;
    color: var(--primary-color);
    text-align: left;
    padding-left: 0.75rem !important;
}

.unified-td-input {
    padding: 0.375rem !important;
}

/* ===== ÏÐÅÂÜÞ ===== */
.preview-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    height: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.preview-title {
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.preview-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px dashed #e9ecef;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}

.preview-removed {
    color: var(--danger-color) !important;
}

.preview-examples {
    max-height: 150px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.3;
}

.preview-example-item {
    padding: 0.25rem 0;
    border-bottom: 1px solid #f8f9fa;
    color: #dc3545;
}

.preview-example-item:last-child {
    border-bottom: none;
}

/* ===== ÓÂÅÄÎÌËÅÍÈß ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    max-width: 350px;
    padding: 0.75rem 1rem;
    margin-bottom: 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
    font-size: 0.875rem;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-success {
    background-color: #d4edda !important;
    border-left: 4px solid var(--success-color);
    color: #155724;
}

.notification-error {
    background-color: #f8d7da !important;
    border-left: 4px solid var(--danger-color);
    color: #721c24;
}

.notification-info {
    background-color: #d1ecf1 !important;
    border-left: 4px solid var(--primary-color);
    color: #0c5460;
}

.notification-warning {
    background-color: #fff3cd !important;
    border-left: 4px solid var(--warning-color);
    color: #856404;
}

/* ===== ÌÎÄÀËÜÍÛÅ ÎÊÍÀ ===== */
.modal-content {
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.app-modal-header {
    background-color: var(--primary-color);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px 8px 0 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ===== ÏÐÅÑÅÒÛ ===== */
#presetsGrid .card {
    height: 100%;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

#presetsGrid .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

#presetsGrid .card-footer {
    background-color: rgba(50, 79, 118, 0.05);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem;
    margin-top: auto;
}

.preset-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--primary-color);
}

.preset-card-description {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    min-height: auto;
}

.preset-card-body {
    padding-bottom: 0.5rem;
    flex-grow: 1;
}

.preset-badge {
    background-color: var(--primary-color);
    font-size: 0.7rem;
}

.preset-date {
    font-size: 0.75rem;
}

.preset-filters-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preset-action-btn {
    min-width: 100px;
}

.preset-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white !important;
}

.preset-icon-btn:hover {
    background-color: #f8f9fa !important;
}

.export-preset-btn {
    background-color: rgba(0, 123, 255, 0.1) !important;
    border-color: #007bff !important;
    color: #007bff !important;
}

.export-preset-btn:hover {
    background-color: rgba(0, 123, 255, 0.2) !important;
    border-color: #0056b3 !important;
    color: #0056b3 !important;
}

.delete-preset-btn {
    background-color: rgba(220, 53, 69, 0.1) !important;
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

.delete-preset-btn:hover {
    background-color: rgba(220, 53, 69, 0.2) !important;
    border-color: #a71d2a !important;
    color: #a71d2a !important;
}

/* ===== ÍÀÂÈÃÀÖÈß ===== */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
}

.nav-tabs .nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #6c757d;
    border: 1px solid transparent;
    border-radius: 0.375rem 0.375rem 0 0;
    padding: 0.5rem 1rem;
    margin-bottom: -2px;
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: white;
    border-color: #dee2e6 #dee2e6 #fff;
    font-weight: 600;
    border-top: 3px solid var(--primary-color);
}

/* ===== ÔÓÒÅÐ ===== */
footer {
    background: var(--light-color);
    border-top: 2px solid var(--primary-color);
    margin-top: 2rem;
}

footer h5 {
    color: var(--primary-color);
    border-bottom: 2px solid rgba(50, 79, 118, 0.2);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

footer h6 {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== ÑÊÐÎËËÁÀÐÛ ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.coupon-textarea::-webkit-scrollbar,
.filter-description-container::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

/* ===== ÓÒÈËÈÒÛ ===== */
.flex-1 {
    flex: 1;
}

.cursor-pointer {
    cursor: pointer;
}

.vertical-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
}

.vertical-buttons .btn-xs {
    flex: 1;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-filters-text,
.no-data-text {
    font-size: 0.85rem;
}

.remaining-badge {
    font-size: 0.75rem;
}

/* ===== ÀÍÈÌÀÖÈÈ ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes highlightPreview {
    0% { background-color: rgba(50, 79, 118, 0.1); }
    50% { background-color: rgba(50, 79, 118, 0.3); }
    100% { background-color: rgba(50, 79, 118, 0.1); }
}

.preview-highlight {
    animation: highlightPreview 2s ease-in-out;
}

/* ===== ÀÄÀÏÒÈÂÍÎÑÒÜ ===== */

/* Äåñêòîïû è ïëàíøåòû (ãîðèçîíòàëüíî) */
@media (min-width: 992px) {
    .col-lg-4 {
        width: 30%;
    }
    
    .col-lg-8 {
        width: 70%;
    }
    
    #couponInput {
        height: 100%;
        min-height: 80px;
    }
    
    .card-body .row > .col-lg-8 {
        display: flex;
        flex-direction: column;
    }
    
    .card-body .row > .col-lg-4 {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
}

/* Ïëàíøåòû */
@media (max-width: 991px) {
    .col-lg-4,
    .col-lg-8 {
        width: 100%;
    }
    
    .card-body .row > .col-lg-4 .d-flex {
        flex-direction: row;
        margin-top: 0.5rem;
    }
    
    .card-body .row > .col-lg-4 .btn-xs {
        flex: 1;
    }
    
    .app-title {
        font-size: 1.2rem;
        white-space: normal;
        word-break: break-word;
    }
    
    .app-icon {
        font-size: 1.3rem;
    }
}

/* Ìîáèëüíûå óñòðîéñòâà */
@media (max-width: 767px) {
    .container {
        padding: 0.5rem;
    }
    
    .app-header {
        padding: 1rem;
        text-align: center;
    }
    
    .app-title {
        font-size: 1.1rem;
        white-space: normal;
        text-align: left;
    }
    
    .app-icon {
        font-size: 1.2rem;
    }
    
    .mode-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
        flex: 0 1 auto;
        min-width: 120px;
    }
    
    .mode-link span {
        display: inline;
    }
    
    .app-btn.dropdown-toggle {
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 0.5rem !important;
    }
    
    .minus-cell {
        height: 35px;
        font-size: 1rem;
    }
    
    .btn-xs {
        padding: 0.3rem 0.4rem !important;
        font-size: 0.8rem !important;
        height: 34px;
    }
    
    .btn-xs i {
        margin-right: 0.4rem !important;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 0.2rem !important;
        font-size: 0.75rem;
    }
    
    .coupon-textarea {
        height: 70px;
        min-height: 70px;
    }
    
    .toggle-switch {
        width: 100px;
    }
    
    .unified-table {
        font-size: 0.8rem;
    }
    
    .unified-table-header th,
    .unified-table td {
        padding: 0.375rem 0.25rem !important;
    }
    
    .unified-table .form-control-sm {
        font-size: 0.8rem;
        height: 30px;
        padding: 0.2rem 0.25rem;
    }
    
    .unified-td-label {
        padding-left: 0.5rem !important;
        font-size: 0.75rem;
    }
    
    .nav-tabs .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .preview-card {
        margin-bottom: 1rem;
    }
    
    .filter-description-container {
        max-height: 80px;
    }
    
    .filter-item {
        flex-wrap: wrap;
    }
    
    .filter-type-badge {
        font-size: 0.6rem;
        padding: 1px 4px;
    }
    
    .filter-details {
        font-size: 0.65rem;
    }
    
    #presetsGrid .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.4rem;
    }
    
    .preset-action-btn {
        min-width: 90px;
    }
    
    .preset-icon-btn {
        width: 32px;
        height: 32px;
    }
    
    .dropdown-menu {
        font-size: 0.9rem;
    }
}

/* Ìàëåíüêèå ìîáèëüíûå */
@media (max-width: 575px) {
    .app-header > div {
        gap: 0.75rem;
    }
    
    .app-title {
        font-size: 1rem;
    }
    
    .app-icon {
        font-size: 1.1rem;
    }
    
    .mode-link {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
        min-width: 100px;
    }
    
    .mode-link i {
        margin-right: 0.35rem;
    }
    
    .app-btn.dropdown-toggle {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
        width: 100%;
    }
    
    .d-flex.flex-column.flex-sm-row {
        width: 100%;
    }
    
    .dropdown {
        width: 100%;
    }
    
    .dropdown-menu {
        width: 100%;
        min-width: auto;
    }
    
    .toggle-switch {
        width: 90px;
    }
    
    .toggle-option {
        font-size: 0.85rem;
        padding: 0.25rem 0;
    }
    
    .unified-table {
        font-size: 0.75rem;
    }
    
    .unified-table-header th {
        padding: 0.3rem 0.2rem !important;
        font-size: 0.75rem;
    }
    
    .unified-table td {
        padding: 0.3rem 0.2rem !important;
    }
    
    .unified-table .form-control-sm {
        font-size: 0.75rem;
        height: 28px;
        padding: 0.15rem 0.2rem;
    }
    
    .unified-td-label {
        font-size: 0.7rem;
        padding-left: 0.375rem !important;
    }
}

/* Î÷åíü ìàëåíüêèå ýêðàíû */
@media (max-width: 400px) {
    .app-header {
        padding: 0.75rem;
    }
    
    .app-title {
        font-size: 0.9rem;
    }
    
    .mode-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
        min-width: 90px;
    }
    
    .mode-link i {
        margin-right: 0.25rem;
        font-size: 0.8rem;
    }
    
    .app-btn.dropdown-toggle {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }
    
    .app-title {
        font-size: 0.95rem;
    }
}

/* Ëàíäøàôòíàÿ îðèåíòàöèÿ */
@media (max-width: 767px) and (orientation: landscape) {
    .app-header > div {
        flex-direction: row !important;
        flex-wrap: wrap;
    }
    
    .mode-link {
        min-width: 100px;
    }
}

/* Touch-óñòðîéñòâà */
@media (hover: none) and (pointer: coarse) {
    .mode-link:hover,
    .app-btn.dropdown-toggle:hover,
    .app-btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .mode-link:active,
    .app-btn.dropdown-toggle:active,
    .app-btn:active {
        transform: translateY(1px);
    }
    
    .dropdown-item {
        padding: 0.6rem 1rem;
    }
    
    .minus-cell:hover {
        transform: none;
    }
}