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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    font-size: 14px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-height: auto;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.header h1 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.5em;
}

.header p {
    color: #7f8c8d;
    font-size: 0.9em;
}

.billing-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    height: 38px;
}

input[type="text"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.btn-primary, .btn-secondary {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.search-params {
    background: #e8f4fc;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 3px solid #3498db;
    font-size: 0.9em;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.param-item {
    padding: 8px;
    background: white;
    border-radius: 3px;
    font-size: 0.9em;
}

.results-section {
    margin-bottom: 20px;
}

.results-section h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: #2c3e50;
}

.table-container {
    overflow-x: auto;
    margin-top: 10px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
    font-size: 0.9em; /* Увеличили базовый размер шрифта */
}

.billing-table th {
    background: #34495e;
    color: white;
    padding: 12px 10px; /* Увеличили отступы */
    text-align: left;
    font-weight: 600;
    font-size: 0.95em; /* Увеличили шрифт заголовков */
    position: sticky;
    top: 0;
    z-index: 10;
}

.billing-table td {
    padding: 10px 12px; /* Увеличили отступы для лучшей читаемости */
    border-bottom: 1px solid #e1e8ed;
    font-size: 0.95em; /* Увеличили шрифт данных */
    text-align: left;
}

/* Специальные стили для числовых ячеек в результатах биллинга */
.number-cell {
    text-align: left !important; /* Выравнивание по левому краю */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Читаемый шрифт */
    font-weight: 600;
    font-size: 1em !important; /* Увеличили размер шрифта для чисел */
    color: #2c3e50; /* Темный цвет для лучшей читаемости */
    background-color: #f8f9fa; /* Легкий фон для выделения */
}

.billing-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.billing-table tbody tr:hover {
    background: #e3f2fd !important;
    transition: background-color 0.2s ease;
}

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

.no-data {
    text-align: center;
    padding: 30px 20px;
    color: #7f8c8d;
    font-size: 0.9em;
}

.no-data h3 {
    margin-bottom: 8px;
    color: #e74c3c;
    font-size: 1.1em;
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e1e8ed;
    color: #7f8c8d;
    font-size: 0.8em;
}

.uuid-display {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
}

.uuid-format {
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* Toast сообщения */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 400px;
    transition: opacity 0.3s ease;
}

.toast.error {
    background: #e74c3c;
}

.toast.success {
    background: #27ae60;
}

/* Спиннер загрузки */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.loading {
    opacity: 0.7;
    pointer-events: none;
}

@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 15px;
        margin: 0;
    }
    
    .billing-form {
        padding: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
    
    .params-grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 1.3em;
    }
    
    .billing-table {
        font-size: 0.85em;
    }
    
    .billing-table th,
    .billing-table td {
        padding: 8px 6px;
    }
    
    /* Увеличиваем цифры на мобильных */
    .number-cell {
        font-size: 1.1em !important;
        font-weight: 700;
    }
    
    /* Скрываем менее важные колонки на мобильных */
    .billing-table td:nth-child(3),
    .billing-table th:nth-child(3) {
        display: none;
    }
    
    .toast {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

.compact-mode .billing-table th,
.compact-mode .billing-table td {
    padding: 6px 4px;
    font-size: 0.8em;
}

.compact-mode .form-group {
    margin-bottom: 12px;
}
