/* Стили для страницы дашборда */

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

.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.dashboard-header p {
    color: #7f8c8d;
    font-size: 16px;
}

/* Сетка дашборда */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Виджеты сводки */
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-widget {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    border-left: 4px solid #3498db;
}

.summary-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.summary-widget.online {
    border-left-color: #27ae60;
}

.summary-widget.offline {
    border-left-color: #e74c3c;
}

.summary-widget.moving {
    border-left-color: #f39c12;
}

.summary-widget.alerts {
    border-left-color: #e67e22;
}

.widget-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
}

.widget-content {
    flex: 1;
}

.widget-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 5px;
}

.widget-label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.widget-subtext {
    font-size: 12px;
    color: #7f8c8d;
}

/* Основные виджеты */
.dashboard-widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.widget-header {
    padding: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.widget-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.widget-badge {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.widget-badge.alert {
    background: #e74c3c;
}

/* Списки */
.vehicles-list,
.alerts-list {
    padding: 0 20px;
}

.vehicle-item,
.alert-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.vehicle-item:last-child,
.alert-item:last-child {
    border-bottom: none;
}

.vehicle-item:hover,
.alert-item:hover {
    background-color: #f8f9fa;
}

.vehicle-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.status-online {
    background: #27ae60;
}

.status-offline {
    background: #e74c3c;
}

.vehicle-info {
    flex: 1;
}

.vehicle-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.vehicle-details {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #7f8c8d;
}

.vehicle-status-text {
    font-weight: 500;
}

.vehicle-speed {
    color: #3498db;
}

.vehicle-time {
    font-size: 11px;
    color: #95a5a6;
    text-align: right;
}

/* Алерты */
.alert-item {
    padding: 12px 0;
}

.alert-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-message {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
}

.alert-details {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #7f8c8d;
}

.alert-vehicle {
    font-weight: 500;
}

.alert-action {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.alert-action:hover {
    background: #f8f9fa;
}

/* Стили для алертов по важности */
.alert-item.high {
    border-left: 3px solid #e74c3c;
}

.alert-item.medium {
    border-left: 3px solid #f39c12;
}

.alert-item.low {
    border-left: 3px solid #3498db;
}

.alert-item.acknowledged {
    opacity: 0.6;
}

/* Нет алертов */
.no-alerts {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.no-alerts-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.no-alerts-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.no-alerts-subtext {
    font-size: 14px;
}

/* Графики */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 0 20px 20px;
}

.chart-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.simple-chart {
    height: 120px;
    display: flex;
    align-items: end;
    gap: 10px;
    margin-bottom: 15px;
    padding: 0 20px;
}

.chart-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    min-height: 10px;
}

.chart-bar.online {
    background: #27ae60;
}

.chart-bar.offline {
    background: #e74c3c;
}

.chart-bar.moving {
    background: #f39c12;
}

.chart-bar.parked {
    background: #3498db;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #2c3e50;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.online {
    background: #27ae60;
}

.legend-color.offline {
    background: #e74c3c;
}

.legend-color.moving {
    background: #f39c12;
}

.legend-color.parked {
    background: #3498db;
}

/* Футер виджетов */
.widget-footer {
    padding: 15px 20px;
    border-top: 1px solid #ecf0f1;
    text-align: center;
}

.btn-link {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.btn-link:hover {
    background: #f8f9fa;
}

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

@media (max-width: 768px) {
    .dashboard-container {
        padding: 15px;
    }
    
    .dashboard-summary {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-widget {
        padding: 15px;
    }
    
    .widget-value {
        font-size: 28px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-widget {
    animation: fadeIn 0.5s ease;
}

.summary-widget {
    animation: fadeIn 0.5s ease;
}

/* Загрузка */
.dashboard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 16px;
}

.dashboard-loading::before {
    content: "⏳";
    margin-right: 10px;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Стили для ТО и ремонтов */
.maintenance-card,
.repairs-card {
    min-height: 400px;
}

.maintenance-stats,
.repairs-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.maintenance-stat,
.repair-stat {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e1e8ed;
}

.maintenance-stat .stat-value,
.repair-stat .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.maintenance-stat .stat-label,
.repair-stat .stat-label {
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
}

.maintenance-list,
.repairs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.maintenance-item,
.repair-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    transition: all 0.3s ease;
}

.maintenance-item:hover,
.repair-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.maintenance-header,
.repair-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.maintenance-vehicle,
.repair-vehicle {
    font-weight: 600;
    color: #2c3e50;
}

.maintenance-type,
.repair-type {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    background: #f8f9fa;
    color: #7f8c8d;
}

.maintenance-details,
.repair-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #7f8c8d;
}

.maintenance-date,
.repair-date {
    font-weight: 600;
}

.maintenance-cost,
.repair-cost {
    color: #27ae60;
    font-weight: 600;
}

.maintenance-status,
.repair-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-upcoming {
    background: #fff3cd;
    color: #856404;
}

.status-overdue {
    background: #f8d7da;
    color: #721c24;
}

.status-planned {
    background: #d1ecf1;
    color: #0c5460;
}

.status-in-progress {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-waiting {
    background: #e2e3e5;
    color: #383d41;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
}

.close {
    color: #7f8c8d;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e1e8ed;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Кнопки */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

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

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

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

/* Адаптивность */
@media (max-width: 768px) {
    .maintenance-stats,
    .repairs-stats {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .maintenance-details,
    .repair-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .maintenance-status,
    .repair-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Анимации */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    animation: slideIn 0.3s ease-out;
}

.maintenance-item,
.repair-item {
    animation: slideIn 0.5s ease-out;
}
