/* Глобальные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --light: #f8fafc;
    --dark: #1e293b;
    --border: #e2e8f0;
    --text: #334155;
    --text-muted: #64748b;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: #ffffff;
}

/* Контейнеры */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Заголовки страниц */
.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

/* Навигация */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 24px;
    align-items: center;
    list-style: none;
}

.navbar-link {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.navbar-link:hover {
    color: var(--primary);
}

.navbar-link.admin {
    color: var(--danger);
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

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

.btn-secondary:hover {
    background: #475569;
}

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

.btn-success:hover {
    background: #16a34a;
}

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

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

.btn-outline {
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

.btn-full {
    width: 100%;
}

/* Карточки */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--dark);
}

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

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

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

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Сетка */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Алерты */
.alert {
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Таблицы */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--dark);
    background: var(--light);
}

.table tr:hover {
    background: var(--light);
}

/* Бейджи */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

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

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

.badge-light {
    background: var(--light);
    color: var(--text);
    border: 1px solid var(--border);
}

/* Утилиты */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.py-4 { padding-top: 32px; padding-bottom: 32px; }
.py-5 { padding-top: 40px; padding-bottom: 40px; }

/* Футер */
.footer {
    background: var(--light);
    padding: 32px 0;
    margin-top: 64px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* Адаптивность */
@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .navbar-menu {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .container,
    .container-narrow,
    .container-wide {
        padding: 0 16px;
    }
}