* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

h2 {
    color: #34495e;
    font-size: 1.5em;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

/* Основной контейнер для размещения блоков */
.main-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.left-column {
    flex: 1;
    min-width: 0;
}

.right-column {
    width: 585px;
    flex-shrink: 0;
}

section {
    background: white;
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Результаты - фиксированный размер */
.results-container {
    width: 100%;
    height: 70vh;
    overflow-y: auto;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    position: sticky;
    top: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Кнопки */
.btn {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin: 5px;
    transition: all 0.3s ease;
}

.btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.btn-primary { background: #3498db; }
.btn-primary:hover:not(:disabled) { background: #2980b9; }

.btn-secondary { background: #95a5a6; }
.btn-secondary:hover:not(:disabled) { background: #7f8c8d; }

.btn-info { background: #17a2b8; }
.btn-info:hover:not(:disabled) { background: #138496; }

.btn-warning { background: #f39c12; }
.btn-warning:hover:not(:disabled) { background: #e67e22; }

.btn-success { background: #28a745; }
.btn-success:hover:not(:disabled) { background: #218838; }

.btn-collections { background: #87ceeb; }
.btn-collections:hover:not(:disabled) { background: #6bbde8; }

.btn-withdrawals { background: #f08080; }
.btn-withdrawals:hover:not(:disabled) { background: #e76c6c; }

.btn-deposits { background: #90ee90; }
.btn-deposits:hover:not(:disabled) { background: #7dd97d; }

.btn-reports { background: #b0c4de; }
.btn-reports:hover:not(:disabled) { background: #9db1cf; }

/* Области загрузки и поиска */
.upload-area {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.upload-area.dragover {
    border-color: #3498db;
    background-color: #ecf0f1;
}

.file-info {
    margin-top: 15px;
    padding: 10px;
    background: #d5f4e6;
    border-radius: 5px;
    border-left: 4px solid #27ae60;
    display: none;
}

.search-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-controls input {
    flex: 1;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 14px;
}

.search-controls input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.ticket-search {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ticket-search input {
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 14px;
    min-width: 200px;
}

.ticket-search input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.result-item {
    background: white;
    margin: 10px 0;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #3498db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.result-header {
    font-weight: bold;
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 5px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-header.successful {
    background-color: #d4edda;
    color: #155724;
}

.result-header.failed {
    background-color: #f8d7da;
    color: #721c24;
}

.result-header.mixed {
    background-color: #fff3cd;
    color: #856404;
}

.result-header.withdrawal {
    background-color: #ffcccb;
    color: #8b0000;
}

.result-header.deposit {
    background-color: #c8e6c8;
    color: #006400;
}

.result-header.report {
    background-color: #cce5ff;
    color: #003d7a;
}

.payment-details {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.status-success {
    color: #28a745;
    font-weight: bold;
}

.status-error {
    color: #dc3545;
    font-weight: bold;
}

.coupon-info {
    background: #ffe4b5;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    border-left: 4px solid #ff8c00;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ack-warning {
    background: #ffa500;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-weight: bold;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.sql-entries {
    background: #e6f3ff;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.line-number {
    color: #666;
    font-size: 12px;
}

.timestamp {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

/* SSH Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: black;
}

.ssh-form {
    margin: 20px 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.ssh-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.ssh-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    animation: slideIn 0.3s ease;
}

.ssh-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.file-browser {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    background-color: #f8f9fa;
}

.file-list {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    max-height: 300px;
    overflow-y: auto;
    margin: 15px 0;
}

.file-item {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease;
}

.file-item:hover {
    background-color: #e9ecef;
}

.file-item input[type="radio"] {
    margin-right: 10px;
}

.file-item label {
    margin: 0;
    cursor: pointer;
}

.browser-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Улучшение переноса текста в результатах */
.results-container p,
.results-container div,
.results-container pre {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    .main-content {
        flex-direction: column;
    }
    .right-column {
        width: 100%;
    }
    .results-container {
        position: static;
        height: 400px;
    }
    .result-header {
        font-size: 11px;
        white-space: normal;
        text-overflow: initial;
    }
    .button-row {
        flex-direction: column;
    }
    .search-controls {
        flex-direction: column;
    }
    .ticket-search {
        flex-direction: column;
    }
    .ticket-search input {
        min-width: auto;
    }
    .modal-content {
        width: 90%;
        margin: 10% auto;
    }
}

/* Скроллбар для результатов */
.results-container::-webkit-scrollbar {
    width: 8px;
}

.results-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.results-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
}

.results-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.file-list::-webkit-scrollbar {
    width: 6px;
}

.file-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.file-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}