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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #34495e;
    --light-color: #ecf0f1;
    --sidebar-width: 250px;
    --topbar-height: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
}

/* Страницы */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* Страница логина */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

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

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

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

/* Кнопки */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 500;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

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

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline:hover {
    background: var(--secondary-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Боковая панель */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    font-size: 1.3rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.user-info i {
    font-size: 1.5rem;
}

/* Основной контент */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar h2 {
    font-size: 1.5rem;
    color: var(--dark-color);
}

.topbar-actions {
    display: flex;
    gap: 10px;
}

.content-area {
    padding: 30px;
}

/* Секции */
.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
}

.filters {
    display: flex;
    gap: 10px;
}

.filters select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.blue { background: var(--secondary-color); }
.stat-icon.green { background: var(--success-color); }
.stat-icon.orange { background: var(--warning-color); }
.stat-icon.purple { background: #9b59b6; }

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
}

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

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

.data-table thead {
    background: var(--light-color);
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

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

.text-center {
    text-align: center;
}

/* Модальные окна */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
}

.modal-overlay.active {
    display: block;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    z-index: 2001;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.active {
    display: block;
}

.modal-content {
    padding: 30px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
}

.close {
    font-size: 2rem;
    cursor: pointer;
    color: #7f8c8d;
    line-height: 1;
}

.close:hover {
    color: var(--dark-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 3000;
    animation: slideInRight 0.3s;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

/* Анимации */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Загрузка */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.spinner {
    border: 4px solid #e0e0e0;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Статусы */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

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

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

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

.status-verifying {
    background: #cfe2ff;
    color: #084298;
}

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

/* Отчёты */
.report-filters-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.report-filters-card h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
    font-size: 0.9rem;
}

.filter-input {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.filter-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.reports-loading {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.reports-loading p {
    margin-top: 15px;
    color: #7f8c8d;
}

.report-header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.report-header h3 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-period {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    opacity: 0.9;
}

.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.report-stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid;
}

.report-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.report-stat-card.revenue {
    border-left-color: #27ae60;
}

.report-stat-card.orders {
    border-left-color: #3498db;
}

.report-stat-card.completed {
    border-left-color: #27ae60;
}

.report-stat-card.cancelled {
    border-left-color: #e74c3c;
}

.report-stat-card.commission {
    border-left-color: #f39c12;
}

.report-stat-card.driver-earnings {
    border-left-color: #9b59b6;
}

.report-stat-card.avg-order {
    border-left-color: #1abc9c;
}

.report-stat-card.success-rate {
    border-left-color: #3498db;
}

.report-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
}

.report-stat-card.revenue .report-stat-icon {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.report-stat-card.orders .report-stat-icon {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.report-stat-card.completed .report-stat-icon {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.report-stat-card.cancelled .report-stat-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.report-stat-card.commission .report-stat-icon {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.report-stat-card.driver-earnings .report-stat-icon {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.report-stat-card.avg-order .report-stat-icon {
    background: linear-gradient(135deg, #1abc9c, #16a085);
}

.report-stat-card.success-rate .report-stat-icon {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.report-stat-content {
    flex: 1;
}

.report-stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 8px;
    font-weight: 500;
}

.report-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-color);
    line-height: 1;
    margin-bottom: 5px;
}

.report-stat-currency,
.report-stat-sublabel {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.report-details-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.report-details-card h4 {
    margin-bottom: 20px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
}

.detail-label {
    font-weight: 500;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.detail-value {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 1rem;
}

.detail-value.highlight {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.report-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.report-empty i {
    font-size: 3rem;
    color: #bdc3c7;
    margin-bottom: 15px;
}

.report-empty p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.report-error {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.report-error i {
    font-size: 3rem;
    color: var(--danger-color);
    margin-bottom: 15px;
}

.report-error h4 {
    color: var(--dark-color);
    margin-bottom: 10px;
}

.report-error p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
    }

    .report-stats-grid {
        grid-template-columns: 1fr;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .report-details-grid {
        grid-template-columns: 1fr;
    }

    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

