* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Навигация */
.navbar {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.2em;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-links a:hover {
    background: #f0f0f0;
}

.user-info {
    color: #666;
    font-size: 0.9em;
}

/* Форма входа */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}

.login-hint {
    margin-top: 20px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    transition: all 0.2s;
    font-weight: 500;
    color: #555;
}

.checkbox-label:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: #1976d2;
    font-weight: 600;
}

.checkbox-label:has(input[type="checkbox"]:checked) {
    background: #e3f2fd;
    border-color: #667eea;
}

.checkbox-label:has(input[type="checkbox"]:checked) span {
    color: #1976d2;
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #667eea;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Кнопки */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4190 100%);
    box-shadow: 0 6px 8px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Сообщения */
.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #c33;
}

.success-message {
    background: #efe;
    color: #3c3;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #3c3;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Главная страница */
.dashboard h1 {
    margin-bottom: 30px;
}

.create-order-section,
.orders-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.create-order-section h2,
.orders-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.order-form {
    max-width: 500px;
}

.order-result {
    margin-top: 20px;
}

/* Карточки заявок */
.orders-list {
    display: grid;
    gap: 15px;
}

.order-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.order-card:hover {
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
    border-color: #667eea;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-id {
    font-weight: bold;
    color: #667eea;
}

.order-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 500;
}

.retry-badge {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.85em;
    background: #e3f2fd;
    color: #1976d2;
    margin-left: 8px;
}

.retry-info {
    margin-top: 10px;
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    color: #856404;
}

.status-waiting {
    background: #fff3cd;
    color: #856404;
}

.status-pending {
    background: #d1ecf1;
    color: #0c5460;
}

.status-finished {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.order-info p {
    margin: 5px 0;
    color: #666;
}

/* Индикатор обновления */
.refresh-indicator {
    display: inline-block;
    animation: spin 1s linear infinite;
    font-size: 0.8em;
    margin-left: 5px;
}

.auto-update-indicator {
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
    font-size: 0.7em;
    margin-left: 10px;
    opacity: 0.6;
    cursor: help;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.order-details p {
    margin: 10px 0;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Админ-панель */
.admin-panel h1 {
    margin-bottom: 30px;
}

.admin-sections {
    display: grid;
    gap: 20px;
}

.admin-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.admin-form {
    max-width: 500px;
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filters select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Уведомления */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification {
    font-size: 0.95em;
    line-height: 1.5;
}

.notification strong {
    display: block;
    margin-bottom: 5px;
}

.notification small {
    display: block;
    opacity: 0.9;
    margin-top: 3px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filters {
        flex-direction: column;
    }
}

