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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
}

/* Боковое меню */
.sidebar {
    width: 280px;
    background: #2a2a2a;
    border-right: 1px solid #3a3a3a;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar.closed {
    transform: translateX(-100%);
}

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

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.sidebar-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.sidebar-user {
    padding: 15px;
    background: #1a1a1a;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-logout {
    color: #f87171;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.btn-logout:hover {
    text-decoration: underline;
}

.menu-section {
    margin-bottom: 30px;
}

.menu-section h3 {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding: 0 10px;
}

.menu-item {
    width: 100%;
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 12px 15px;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.menu-item:hover {
    background: #323232;
}

.menu-item.active {
    background: #0066ff;
    color: #ffffff;
}

.menu-item span {
    font-size: 18px;
}

.menu-item.add-category {
    color: #0066ff;
    border: 1px dashed #0066ff;
}

.menu-item.add-category:hover {
    background: rgba(0, 102, 255, 0.1);
}

/* Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Основной контент */
.main-content {
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar.closed ~ .main-content {
    margin-left: 0;
}

.top-bar {
    background: #2a2a2a;
    border-bottom: 1px solid #3a3a3a;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.top-bar h1 {
    font-size: 24px;
    font-weight: 600;
    flex: 1;
}

.top-bar-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: #3a3a3a;
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #4a4a4a;
}

/* Фильтры категорий */
.category-filters {
    background: #2a2a2a;
    border-bottom: 1px solid #3a3a3a;
    padding: 12px 20px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.filter-btn {
    background: transparent;
    border: 1px solid #3a3a3a;
    color: #aaaaaa;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #323232;
    color: #ffffff;
}

.filter-btn.active {
    background: #0066ff;
    border-color: #0066ff;
    color: #ffffff;
}

/* Контент */
.content-area {
    flex: 1;
    padding: 30px 20px;
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.card {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    padding: 24px;
}

.card h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

/* Сетка курсов */
.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.rate-card {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.rate-card:hover {
    background: #323232;
    border-color: #4a4a4a;
}

.rate-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rate-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rate-card .flag {
    font-size: 24px;
    line-height: 1;
}

.rate-card .name {
    font-size: 14px;
    color: #ffffff;
    font-weight: 500;
}

.rate-card-code {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.rate-card-source {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.rate-card-body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.rate-card-value {
    flex: 1;
}

.rate-card .value {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 8px;
}

.rate-card-change {
    font-size: 13px;
    font-weight: 500;
}

.rate-card-change.positive {
    color: #4ade80;
}

.rate-card-change.negative {
    color: #f87171;
}

.rate-card-graph {
    width: 80px;
    height: 40px;
}

.rate-card-graph svg {
    width: 100%;
    height: 100%;
}

/* Поиск */
.search-input {
    width: 100%;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    margin-bottom: 20px;
}

.search-input:focus {
    outline: none;
    border-color: #0066ff;
}

.search-results {
    display: grid;
    gap: 12px;
}

.loading {
    text-align: center;
    color: #aaaaaa;
    padding: 40px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #2a2a2a;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    border: 1px solid #3a3a3a;
}

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

.modal-header h2 {
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    margin-bottom: 15px;
}

.form-input:focus {
    outline: none;
    border-color: #0066ff;
}

.btn-primary {
    background: #0066ff;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #0052cc;
}

/* Адаптивность */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .rates-grid {
        grid-template-columns: 1fr;
    }
}

