/**
 * Базовые стили админ-панели
 * Подключать на всех страницах
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #0b1622;
    min-height: 100vh;
    color: white;
}

/* Layout */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: #1e2b3a; flex-shrink: 0; }
.admin-main { flex: 1; padding: 20px; overflow-x: auto; }
.admin-content { max-width: 1400px; margin: 0 auto; }

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

/* Карточки */
.card {
    background: #1e2b3a;
    border-radius: 12px;
    padding: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.card h2 { margin-bottom: 20px; font-size: 18px; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s;
}
.card-link:hover { transform: translateY(-4px); }
.card-icon { font-size: 40px; margin-bottom: 12px; display: block; }
.card-link h3 { margin-bottom: 8px; }
.card-link p { color: #8e9fb1; font-size: 14px; }

/* Формы */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    color: #8e9fb1;
    font-size: 14px;
    margin-bottom: 8px;
}
.form-control {
    width: 100%;
    padding: 12px;
    background: #2b3b4c;
    border: 1px solid #3e4f62;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    transition: all 0.3s;
}
.form-control:focus {
    outline: none;
    border-color: #2a6fd6;
    background: #3e4f62;
}
.form-control::placeholder { color: #6b7f94; }

/* Кнопки */
.btn {
    background: #2a6fd6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}
.btn:hover { background: #1d5bbf; }
.btn:disabled { background: #3e4f62; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-success { background: #28a745; }
.btn-success:hover { background: #218838; }
.btn-danger { background: #dc3545; }
.btn-danger:hover { background: #c82333; }
.btn-block { width: 100%; text-align: center; }

/* Уведомления */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.alert-danger { background: #dc354520; color: #ff6b6b; border: 1px solid #dc3545; }

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-box {
    width: 100%;
    max-width: 400px;
    background: #1e2b3a;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.login-box h1 { margin-bottom: 24px; font-size: 24px; text-align: center; }

/* Скроллбар */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #1e2b3a; }
::-webkit-scrollbar-thumb { background: #3e4f62; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4f637a; }

/* Sidebar nav */
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    padding: 10px 12px;
    color: #8e9fb1;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}
.nav-item:hover { background: #2b3b4c; color: white; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

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

.stat-card .card-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-card h3 {
    margin: 0.5rem 0;
    font-size: 1rem;
    opacity: 0.9;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.stat-card small {
    opacity: 0.8;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-link {
    color: inherit;
    text-decoration: none;
}

.card .card-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.card h3 {
    margin: 0.5rem 0;
    color: #333;
}

.card p {
    color: #666;
    margin: 0;
}

.recent-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.recent-section h2 {
    margin-top: 0;
    color: #333;
}

.recent-models {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.recent-model {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.2s;
}

.recent-model:hover {
    background: #e9ecef;
}

.model-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.model-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ddd;
    font-size: 1.2rem;
}

.model-info h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
}

.model-info small {
    color: #666;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .recent-models {
        grid-template-columns: 1fr;
    }
}
