/* ====================================
   Общие стили
   ==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

/* ====================================
   Страница авторизации
   ==================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group select[multiple] {
    padding: 8px;
}

.form-group select[multiple] option {
    padding: 8px 12px;
    border-radius: 4px;
    margin: 2px 0;
}

.form-group select[multiple] option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* ====================================
   Кнопки
   ==================================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: #f56565;
    color: white;
}

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

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ====================================
   Алерты
   ==================================== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #fc8181;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #68d391;
}

.alert-info {
    background: #bee3f8;
    color: #2c5282;
    border: 1px solid #63b3ed;
}

/* ====================================
   Основной layout
   ==================================== */
.dashboard {
    min-height: 100vh;
}

/* Сайдбар */
.sidebar {
    width: 260px;
    background: #2d3748;
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.3s ease;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
    transition: padding 0.3s ease;
}

.sidebar.collapsed .sidebar-header {
    padding: 0 10px 20px;
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-header h2 {
    font-size: 24px;
    text-align: center;
}

.sidebar-header .user-info {
    font-size: 13px;
    color: #a0aec0;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-header .user-info {
    opacity: 0;
    height: 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-menu li a {
    padding: 12px;
    justify-content: center;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(102, 126, 234, 0.2);
    border-left: 3px solid #667eea;
    padding-left: 17px;
}

.sidebar.collapsed .sidebar-menu li a:hover,
.sidebar.collapsed .sidebar-menu li a.active {
    padding-left: 12px;
}

.sidebar-menu li a .icon {
    font-size: 20px;
    min-width: 20px;
    text-align: center;
}

.sidebar-menu li a .menu-text {
    margin-left: 10px;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-menu li a .menu-text {
    opacity: 0;
    width: 0;
    margin: 0;
    overflow: hidden;
}

/* Бургер кнопка */
.burger-btn {
    position: fixed !important;
    top: 20px !important;
    left: 270px !important;
    z-index: 9999 !important;
    width: 45px !important;
    height: 45px !important;
    background: #667eea !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5) !important;
}

.burger-btn:hover {
    background: #5568d3 !important;
    transform: scale(1.1) !important;
}

.sidebar.collapsed ~ .burger-btn {
    left: 80px !important;
}

.burger-btn span {
    display: block !important;
    width: 22px !important;
    height: 3px !important;
    background: white !important;
    transition: all 0.3s ease !important;
    border-radius: 2px !important;
}

.sidebar.collapsed ~ .burger-btn span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px) !important;
}

.sidebar.collapsed ~ .burger-btn span:nth-child(2) {
    opacity: 0 !important;
}

.sidebar.collapsed ~ .burger-btn span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px) !important;
}

/* Основной контент */
.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: #2d3748;
}

.page-header .breadcrumb {
    color: #718096;
    font-size: 14px;
}

/* ====================================
   Карточки
   ==================================== */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h2 {
    font-size: 18px;
    color: #2d3748;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
}

/* ====================================
   Статистика
   ==================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.stat-card.success {
    border-left-color: #48bb78;
}

.stat-card.warning {
    border-left-color: #ed8936;
}

.stat-card.danger {
    border-left-color: #f56565;
}

.stat-card.info {
    border-left-color: #4299e1;
}

.stat-label {
    font-size: 13px;
    color: #718096;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #2d3748;
}

.stat-change {
    font-size: 12px;
    margin-top: 8px;
    color: #48bb78;
}

/* ====================================
   Таблицы
   ==================================== */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table thead {
    background: #f7fafc;
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    font-size: 13px;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.table tbody tr:hover {
    background: #f7fafc;
}

.table tbody tr.editable {
    cursor: pointer;
}

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

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-warning {
    background: #feebc8;
    color: #7c2d12;
}

.badge-danger {
    background: #fed7d7;
    color: #c53030;
}

.badge-info {
    background: #bee3f8;
    color: #2c5282;
}

.badge-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

/* ====================================
   Фильтры
   ==================================== */
.filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filters-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ====================================
   Чекбоксы
   ==================================== */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

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

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.flex {
    display: flex;
}

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

.gap-10 {
    gap: 10px;
}

.text-muted {
    color: #718096;
}

.text-success {
    color: #48bb78;
}

.text-danger {
    color: #f56565;
}

.text-warning {
    color: #ed8936;
}

/* ====================================
   Responsive
   ==================================== */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
}

