/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Layout структура */
.layout {
    display: flex;
    min-height: 100vh;
}

.layout-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 280px;
}

/* Simplified sidebar structure with guaranteed scroll */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 24px;
    flex-shrink: 0;
    flex-grow: 0;
}

.logo-icon {
    font-size: 32px;
}

.logo-text h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 2px;
}

.logo-text span {
    font-size: 13px;
    opacity: 0.8;
}

/* Super simple scroll solution - always works */
.sidebar-nav {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    margin-right: -8px;
    display: block;
    -webkit-overflow-scrolling: touch;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 15px;
    margin-bottom: 8px;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.sidebar-icon {
    font-size: 20px;
}

.sidebar-text {
    flex: 1;
}

.sidebar-footer {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.sidebar-user-info {
    flex: 1;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.sidebar-user-year {
    font-size: 12px;
    opacity: 0.8;
}

.sidebar-logout {
    display: block;
    padding: 8px 16px;
    text-align: center;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    font-size: 14px;
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Шапка */
.header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
}

.header-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.header-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Контент */
.content {
    flex: 1;
    padding: 32px;
}

.page-content {
    max-width: 1200px;
}

/* Секция приветствия */
.welcome-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 32px;
    border-radius: 12px;
    color: white;
    margin-bottom: 32px;
}

.welcome-section h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.welcome-text {
    font-size: 16px;
    opacity: 0.9;
}

/* Сетка карточек */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

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

.card-icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #1f2937;
}

.card-info {
    margin-bottom: 16px;
}

.card-info p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 6px;
}

.card-info strong {
    color: #374151;
}

.card-btn {
    width: 100%;
    padding: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.card-btn:hover {
    background: #5568d3;
}

/* Секция новостей */
.news-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.news-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #1f2937;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-item {
    display: flex;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-date {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    min-width: 80px;
}

.news-content h4 {
    font-size: 15px;
    margin-bottom: 6px;
    color: #1f2937;
}

.news-content p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* Форма настроек */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.settings-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.settings-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #1f2937;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.form-input {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.settings-actions {
    display: flex;
    gap: 12px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn {
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

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

/* Футер */
.footer {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 20px 32px;
    text-align: center;
}

.footer p {
    font-size: 14px;
    color: #6b7280;
}

/* Added mobile sidebar styles to ensure scroll works on mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .layout-main {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .sidebar-close {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        font-size: 24px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        cursor: pointer;
        transition: all 0.2s;
    }

    .sidebar-close:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .mobile-menu-toggle {
        display: flex;
    }
}

/* Уведомления */
.notification-btn {
    position: relative;
}

.notification-badge,
.notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

.notification-dropdown,
.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.notification-dropdown.show,
.notifications-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.notification-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.notification-mark-all,
.mark-all-read-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.notification-mark-all:hover,
.mark-all-read-btn:hover {
    background: #f3f4f6;
}

.notification-list,
.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
    position: relative;
}

.notification-item:hover {
    background: #f9fafb;
}

.notification-item.unread {
    background: #eff6ff;
}

.notification-item.unread::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #667eea;
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-text {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-time {
    font-size: 12px;
    color: #9ca3af;
}

.mark-read-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mark-read-btn:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.notification-empty,
.no-notifications {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* Scrollbar для списка уведомлений */
.notification-list::-webkit-scrollbar,
.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track,
.notifications-list::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.notification-list::-webkit-scrollbar-thumb,
.notifications-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover,
.notifications-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
