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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: linear-gradient(135deg, #dee2e6 0%, #0d47a1 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== НАВИГАЦИЯ ========== */
nav {
    background: linear-gradient(135deg, #ced4da 0%, #0d47a1 100%);
    padding: 15px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 18px;
    font-weight: 500;
    border-radius: 30px;
    transition: all 0.2s;
}

nav a:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

nav span {
    background: rgba(255,255,255,0.15);
    padding: 6px 18px;
    border-radius: 30px;
}

/* ========== КОНТЕЙНЕР ========== */
.container {
    max-width: 1300px;
    margin: 0 auto 40px auto;
    background: white;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    width: 92%;
}

h1 {
    margin-bottom: 30px;
    color: #004d40;
    font-size: 2rem;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 3px solid #26a69a;
    display: inline-block;
    width: auto;
    margin-left: auto;
    margin-right: auto;
}

h2 {
    color: #004d40;
    margin: 25px 0 15px 0;
    font-size: 1.6rem;
}

/* ========== ФОРМЫ ========== */
form {
    max-width: 500px;
    margin: 0 auto;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

label {
    display: block;
    margin: 10px 0 5px 0;
    color: #004d40;
    font-weight: 600;
}

input, textarea, select {
    width: 100%;
    padding: 10px 14px;
    margin: 5px 0 15px 0;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: inherit;
    transition: all 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #26a69a;
    background: white;
}

/* ========== КНОПКИ ========== */
button, .btn, .btn-order {
    background: linear-gradient(135deg, #007bff, #00897b);
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button:hover, .btn:hover, .btn-order:hover {
    background: #00897b;
    transform: translateY(-2px);
}

/* ========== КАРТОЧКИ КУРСОВ ========== */
.products, .courses {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.product-card, .course-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.product-card:hover, .course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,77,64,0.15);
}

/* ГЛАВНОЕ ПРАВИЛО ДЛЯ КАРТИНОК - КАРТИНКА ВЛЕЗАЕТ ЦЕЛИКОМ */
.product-card img, 
.course-card img,
.course-image img {
    width: 100%;
    height: 200px;
    object-fit: contain;  /* КАРТИНКА УМЕНЬШАЕТСЯ, НЕ ОБРЕЗАЕТСЯ */
    background: #f5f5f5;  /* ФОН ДЛЯ ПУСТЫХ ПОЛЕЙ */
    display: block;
}

/* Альтернативный вариант - картинка покрывает область с обрезкой */
.product-card img.cover,
.course-card img.cover {
    object-fit: cover;  /* Обрезает, чтобы заполнить блок */
    background: transparent;
}

.product-card h3, .course-card h3 {
    padding: 15px 15px 5px 15px;
    font-size: 1.25rem;
    color: #004d40;
}

.price {
    font-size: 24px;
    color: #00897b;
    font-weight: bold;
    padding: 0 15px;
}

.product-card p, .course-card p {
    padding: 5px 15px 15px 15px;
    color: #666;
    line-height: 1.5;
}

.btn-order {
    display: inline-block;
    margin: 0 15px 15px 15px;
    padding: 8px 20px;
}

/* ========== КАРТОЧКИ ЗАЯВОК ========== */
.app-card, .admin-card {
    background: #f8f9fa;
    margin: 15px 0;
    padding: 20px;
    border-radius: 16px;
    border-left: 4px solid #26a69a;
    transition: all 0.2s;
}

.app-card:hover, .admin-card:hover {
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* ========== СТАТУСЫ ========== */
.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-new, .status-Новая {
    background: #fff3cd;
    color: #856404;
}

.status-learning, .status-Идетобучение {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed, .status-Обучениезавершено {
    background: #d4edda;
    color: #155724;
}

/* ========== АДМИН-ПАНЕЛЬ ========== */
.admin-filters {
    background: #e9ecef;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 25px;
}

.pagination {
    margin-top: 30px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 6px 14px;
    background: #26a69a;
    color: white;
    border-radius: 8px;
    text-decoration: none;
}

.pagination a:hover {
    background: #00897b;
}

.pagination .active {
    background: #004d40;
}

/* ========== ФУТЕР ========== */
footer {
    background: #007bff;
    color: #e0e0e0;
    padding: 40px 30px 20px 30px;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 25px;
}

.footer-section h3, .footer-section h4 {
    color: white;
    margin-bottom: 15px;
}

.footer-section p, .footer-section ul li a {
    color: #b0b0b0;
    line-height: 1.6;
    text-decoration: none;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a:hover {
    color: #80cbc4;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 1.2rem;
}

.social-links a:hover {
    color: #80cbc4;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}

/* ========== СООБЩЕНИЯ ========== */
.message {
    padding: 12px 20px;
    margin: 15px 0;
    border-radius: 12px;
    font-weight: 500;
}

.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* ========== УНИВЕРСАЛЬНЫЕ ПРАВИЛА ДЛЯ ВСЕХ КАРТИНОК ========== */
/* Картинки не растягиваются, сохраняют пропорции */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Для картинок в карточках - фиксированная высота, картинка влезает целиком */
.course-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;  /* Фон для пустых полей */
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;  /* КАРТИНКА ВЛЕЗАЕТ ЦЕЛИКОМ, НЕ ОБРЕЗАЕТСЯ */
}

/* Для аватарок и маленьких иконок - здесь оставляем cover, так как это кружки */
.avatar, .admin-icon {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
}

/* Если нужно, чтобы картинка вписалась полностью без обрезки (основной режим) */
.img-contain {
    object-fit: contain;
    background: #f5f5f5;
}

/* Если картинка должна покрыть всю область (с обрезкой) */
.img-cover {
    object-fit: cover;
}

/* ========== ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ ========== */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mt-30 { margin-top: 30px; }
.mb-30 { margin-bottom: 30px; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
}
.badge-admin {
    background: #ff6b6b;
    color: white;
}
.badge-user {
    background: #26a69a;
    color: white;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        padding: 12px 20px;
    }
    
    .container {
        padding: 20px;
        width: 95%;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .products, .courses {
        grid-template-columns: 1fr;
    }
    
    form {
        padding: 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #26a69a;
    border-radius: 10px;
}