/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Навигация */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.navbar h1 {
    font-size: 1.5rem;
    margin: 0;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: #34495e;
}

/* Заголовок страницы */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    margin: 0;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Кнопки */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover:not(:disabled) {
    background-color: #2980b9;
}

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

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Алерты */
#alertContainer {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Контейнер водителей */
.drivers-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
    margin-left: -10px;
}

/* Свободные авто в несколько столбцов */
.free-cars-grid {
    padding: 10px;
}

.free-cars-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.free-cars-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.free-car-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    font-size: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.free-car-number {
    font-weight: 600;
    min-width: 20px;
    color: #666;
}

.free-car-info {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.free-car-plate {
    font-weight: 500;
    color: #2c3e50;
}

.drivers-column h3,
.drivers-column-full h3 {
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 14px;
}

/* Таблицы */
.table-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.drivers-table {
    width: 100%;
    border-collapse: collapse;
}

.drivers-table thead {
    background-color: #34495e;
    color: white;
}

.drivers-table th {
    padding: 6px 4px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
    position: relative;
}

.drivers-table th .car-filter {
    margin-top: 2px;
    padding: 3px 4px;
    font-size: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    width: 100%;
    max-width: 150px;
}

.drivers-table td {
    padding: 5px 4px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 11px;
    white-space: nowrap;
}

.drivers-table tbody tr:hover {
    background-color: #f8f9fa;
}

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

.drivers-table .loading,
.drivers-table .empty,
.drivers-table .error {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px;
}

.drivers-table .error {
    color: #e74c3c;
}

/* Цветовая заливка для статусов */
.drivers-table td.status-success {
    background-color: #d4edda !important; /* Бледно-зеленый */
    color: #155724 !important;
    font-weight: 600;
    text-align: center;
}

.drivers-table td.status-error {
    background-color: #f8d7da !important; /* Бледно-красный */
    color: #721c24 !important;
    font-weight: 600;
    text-align: center;
}

/* Заливка для ячеек с "Да" и "Нет" применяется через классы в JavaScript */

/* Календарь для выбора периода */
.date-range-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.date-range-selector label {
    font-weight: 600;
    color: #2c3e50;
}

.date-range-selector input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

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

/* Последнее обновление */
.last-update {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin-top: 20px;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .drivers-container {
        grid-template-columns: 1fr;
    }

/* Модальное окно для результатов сверки */
.modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
    text-decoration: none;
}

.comparison-results h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.comparison-section {
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.comparison-section h4 {
    margin-top: 0;
    color: #34495e;
}

.section-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
}

.discrepancy-group {
    margin: 15px 0;
    padding: 10px;
    background-color: white;
    border-left: 4px solid #e74c3c;
    border-radius: 4px;
}

.discrepancy-group strong {
    color: #e74c3c;
    display: block;
    margin-bottom: 10px;
}

.discrepancy-group ul {
    margin: 10px 0;
    padding-left: 20px;
}

.discrepancy-group li {
    margin: 5px 0;
    line-height: 1.6;
}

.discrepancy-group ul ul {
    margin-top: 5px;
    margin-bottom: 5px;
}

.discrepancy-group ul ul li {
    color: #7f8c8d;
    font-size: 0.9em;
}

.no-discrepancies {
    padding: 15px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    text-align: center;
    font-weight: bold;
}

/* Стили для страницы сверки */
.comparison-results-container {
    margin-top: 20px;
}

.comparison-results {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comparison-description {
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

.comparison-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    flex-wrap: wrap;
}

.stat-item {
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.comparison-table th,
.comparison-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.comparison-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

.comparison-table tr:hover {
    background-color: #f5f5f5;
}

.driver-difference {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.driver-difference h5 {
    margin-top: 0;
    color: #856404;
}

.difference-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.difference-table th,
.difference-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.difference-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.diff-value {
    background-color: #ffe6e6;
    font-weight: bold;
}

/* Стили для сравнения слева-справа */
.driver-comparison-card {
    margin: 20px 0;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comparison-table-wrapper {
    overflow-x: auto;
}

.side-by-side-comparison {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.side-by-side-comparison th {
    padding: 12px;
    text-align: center;
    background-color: #2c3e50;
    color: white;
    font-weight: bold;
    border: 1px solid #34495e;
}

.side-by-side-comparison th.fleet-column {
    background-color: #3498db;
}

.side-by-side-comparison th.taxicrm-column {
    background-color: #9b59b6;
}

.side-by-side-comparison td {
    padding: 12px;
    vertical-align: top;
    border: 1px solid #ddd;
    width: 50%;
}

.side-by-side-comparison td.fleet-cell {
    background-color: #ecf0f1;
}

.side-by-side-comparison td.taxicrm-cell {
    background-color: #f8f9fa;
}

/* Совпадающие значения - бледно-зеленый */
.side-by-side-comparison td.match {
    background-color: #d4edda !important;
}

.side-by-side-comparison td.fleet-cell.match {
    background-color: #d1ecf1 !important;
}

.side-by-side-comparison td.taxicrm-cell.match {
    background-color: #d1ecf1 !important;
}

/* Несовпадающие значения - бледно-красный */
.side-by-side-comparison td.mismatch {
    background-color: #f8d7da !important;
}

.side-by-side-comparison td.fleet-cell.mismatch {
    background-color: #f5c6cb !important;
}

.side-by-side-comparison td.taxicrm-cell.mismatch {
    background-color: #f5c6cb !important;
}

/* Отсутствующие данные */
.side-by-side-comparison td.missing-cell {
    background-color: #fff3cd !important;
    color: #856404;
    font-style: italic;
}

.field-label {
    font-size: 0.85em;
    color: #666;
    font-weight: bold;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.field-value {
    font-size: 1em;
    color: #333;
    word-break: break-word;
}
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .drivers-table {
        font-size: 12px;
    }
    
    .drivers-table th,
    .drivers-table td {
        padding: 8px;
    }
}

