/* Основные стили */
:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    padding: 1rem 2rem;
    box-shadow: var(--box-shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo i {
    font-size: 2rem;
    color: var(--primary);
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--dark);
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #e11574;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Формы */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.input-with-icon input {
    padding-left: 3rem;
}

/* Аутентификация */
.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--gray);
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Алерты */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.alert-danger {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #393;
    border: 1px solid #cfc;
}

/* Hero секция */
.hero {
    background: white;
    border-radius: var(--border-radius);
    padding: 4rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.hero p {
    font-size: 1.125rem;
    color: var(--gray);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature {
    padding: 2rem;
    background: var(--light);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.feature i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

/* Футер */
.footer {
    text-align: center;
    padding: 2rem;
    color: white;
    margin-top: 2rem;
}

/* Dashboard */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: #f5f7fb;
}

.sidebar {
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.sidebar-menu {
    padding: 1.5rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-menu a:hover {
    background: var(--light-gray);
    color: var(--primary);
}

.sidebar-menu a.active {
    background: var(--primary);
    color: white;
}

.dashboard-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--box-shadow);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--gray);
    font-size: 0.875rem;
}

/* Таблицы */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.data-table th {
    background: var(--light-gray);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
}

.data-table td {
    padding: 1rem;
    border-top: 1px solid var(--light-gray);
}

.data-table tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Формы сетка */
.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.form-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.form-card-header {
    margin-bottom: 1.5rem;
}

.form-card-header h3 {
    margin-bottom: 0.5rem;
}

.form-card-actions {
    display: flex;
    gap: 0.75rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        margin-bottom: 1rem;
    }
    
    .dashboard-content {
        margin-left: 0;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .forms-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h2 {
        font-size: 1.75rem;
    }
    
    .hero-features {
        grid-template-columns: 1fr;
    }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ ФОРМ ===== */

/* Улучшенные стили форм */
.form-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #eef2f7;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.form-card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f4f8;
}

.form-card-header h3 {
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-size: 20px;
}

.form-card-header p {
    color: #718096;
    margin: 0;
    font-size: 14px;
}

.form-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

/* Улучшенные таблицы */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.data-table thead {
    background: linear-gradient(135deg, #4361ee 0%, #3a56d4 100%);
}

.data-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:nth-child(even) {
    background: #fafcff;
}

.data-table tbody tr:hover {
    background: #f0f4ff;
}

.data-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #eef2f7;
    color: #4a5568;
    font-size: 14px;
}

.data-table td:first-child {
    font-weight: 600;
    color: #2c3e50;
}

/* Улучшенные бейджи */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-primary {
    background: rgba(67, 97, 238, 0.1);
    color: #4361ee;
}

.badge-success {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.badge-warning {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
}

.badge-danger {
    background: rgba(247, 37, 133, 0.1);
    color: #f72585;
}

.badge-info {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

/* Улучшенные алерты */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.alert-danger {
    border-left-color: #f72585;
    background: linear-gradient(135deg, #fff5f7 0%, #fed7d7 100%);
    color: #c53030;
}

.alert-success {
    border-left-color: #4CAF50;
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    color: #22543d;
}

.alert-warning {
    border-left-color: #FF9800;
    background: linear-gradient(135deg, #fffaf0 0%, #feebc8 100%);
    color: #744210;
}

.alert-info {
    border-left-color: #2196F3;
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    color: #2c5282;
}

/* Улучшенные инпуты */
.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    z-index: 2;
}

.input-with-icon input {
    padding-left: 45px;
}

.input-with-icon input:focus + i {
    color: #4361ee;
}

/* Анимации для интерфейса */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease;
}

.animate-slide-up {
    animation: slideInUp 0.5s ease;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Утилитарные классы для отступов */
.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.space-y-8 > * + * {
    margin-top: 2rem;
}

.space-x-4 > * + * {
    margin-left: 1rem;
}

.space-x-6 > * + * {
    margin-left: 1.5rem;
}

/* Адаптивные изображения */
.responsive-img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Загрузчик */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4361ee;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}