body {
    font-family: 'Manrope', sans-serif;
}

.hidden {
    display: none !important;
}

/* Хеадер */
.header {
    background-color: white;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    flex-shrink: 0;
    min-height: 10vh;
    display: flex;
    align-items: center;
}

.dark .header {
    background-color: #1e293b;
    border-bottom-color: #334155;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-pill {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.user-pill-icon {
    font-size: 0.875rem;
    opacity: 0.8;
}

.user-pill-arrow {
    font-size: 0.625rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.user-dropdown:hover .user-pill-arrow {
    transform: rotate(180deg);
}

.user-pill:hover {
    background-color: #e2e8f0;
}

.dark .user-pill {
    border-color: #475569;
    background-color: #1e293b;
    color: #e2e8f0;
}

.dark .user-pill:hover {
    background-color: #334155;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 50;
}

.dark .user-dropdown-menu {
    background: #1e293b;
    border-color: #475569;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.user-dropdown:hover .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-dropdown-item:hover {
    background-color: #f3f4f6;
}

.user-dropdown-item:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.user-dropdown-item:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

.dark .user-dropdown-item {
    color: #d1d5db;
}

.dark .user-dropdown-item:hover {
    background-color: #374151;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.currency-rates {
    display: none;
}

@media (min-width: 500px) {
    .currency-rates {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
    }
}

.currency-rate-box {
    background-color: #f9fafb;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.dark .currency-rate-box {
    background-color: #374151;
}

.currency-rate-title {
    font-size: 0.75rem;
    font-weight: bold;
    color: #475569;
    margin-bottom: 0.375rem;
    text-align: center;
}

.dark .currency-rate-title {
    color: #f1f5f9;
}

.currency-rate-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.currency-rate-item {
    text-align: left;
}

.currency-type {
    font-size: 0.625rem;
    color: #64748b;
}

.currency-value {
    font-size: 0.75rem;
}

.currency-change {
    font-size: 0.625rem;
    color: green;
}

.currency-change-red {
    font-size: 0.625rem;
    color: red;
}

.currency-refresh {
    cursor: pointer;
    margin-left: 0.5rem;
    padding: 0.125rem;
    border-radius: 0.25rem;
    background-color: #1173d4;
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
}

.currency-refresh:hover {
    background-color: #0d5fa8;
    transform: scale(1.1);
}

.dark .currency-refresh {
    background-color: #374151;
}

.dark .currency-refresh:hover {
    background-color: #4b5563;
}

.header-center {
    flex-grow: 1;
}

.ad-banner {
    height: 7rem;
    background-color: #e5efff;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 0.5rem;
    overflow: hidden;
}

.ad-banner-left {
    flex-shrink: 0;
    height: 100%;
    margin-left: 0.5rem;
    object-fit: contain;
}

.ad-banner-center {
    flex: 1;
    min-width: 0;
    height: calc(100% + 1rem);
    max-width: 100%;
    object-fit: contain;
}

.ad-banner-center:nth-of-type(3) {
    display: none;
}

.dark .ad-banner {
    background-color: #374151;
    color: #d1d5db;
}

.dark .ad-banner-center:nth-of-type(2) {
    display: none;
}

.dark .ad-banner-center:nth-of-type(3) {
    display: block;
}



.header-button {
    background: linear-gradient(135deg, #1173d4 0%, #0d5fa8 100%);
    color: white;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(17, 115, 212, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    transform: scale(1);
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
}

.header-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.header-button:hover::before {
    left: 100%;
}

.header-button:hover {
    background: linear-gradient(135deg, #0d5fa8 0%, #1173d4 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(17, 115, 212, 0.4), 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.header-button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(17, 115, 212, 0.3);
}

.header-button-secondary {
    background: #e2e8f0;
    color: #1e293b;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.header-button-secondary:hover {
    background: #cbd5f5;
}

.dark .header-button-secondary {
    background: #334155;
    color: #f8fafc;
}

.dark .header-button-secondary:hover {
    background: #475569;
}

.dark .header-button {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    box-shadow: 0 4px 12px rgba(55, 65, 81, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark .header-button:hover {
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
    box-shadow: 0 6px 20px rgba(55, 65, 81, 0.5), 0 4px 8px rgba(0, 0, 0, 0.25);
}

/* Основа */

/* Кнопки Секция 1*/
.service-button {
    background-color: #b8d3ef;
    border-radius: 0.75rem;
    box-shadow: 0 2px 6px rgba(29,53,87,0.25);
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    text-decoration: none;
    min-height: 0;
}

.service-button img {
    width: 70%;
    height: 70;
    object-fit: contain;
}

/* Скрытие картинок для темной темы в светлой теме */
.service-button img[src*="-dark"] {
    display: none;
}

/* Показ картинок для темной темы и скрытие светлых в темной теме */
.dark .service-button img[src*="-light"] {
    display: none;
}

.dark .service-button img[src*="-dark"] {
    display: block;
}

.service-button:hover {
    transform: scale(1.02);
    box-shadow: 0 3px 12px rgba(29,53,87,0.35);
    background-color: #a5c7e4;
}

.dark .service-button {
    background-color: #4b5563;
    color: #d1d5db;
}

.dark .service-button:hover {
    background-color: #6b7280;
}

/* Кнопки Секция 2*/
.service-button-primary {
    background-color: #d6e9fb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(120,170,220,0.13);
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    text-decoration: none;
    min-height: 0;
}

.service-button-primary img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.service-button-primary img[src*="-dark"] {
    display: none;
}

.dark .service-button-primary img[src*="-light"] {
    display: none;
}

.dark .service-button-primary img[src*="-dark"] {
    display: block;
}

.service-button-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 6px rgba(120,170,220,0.2);
    
    background-color: #c2daf0;
}

.dark .service-button-primary {
    background-color: #374151;
    color: #d1d5db;
}

.dark .service-button-primary:hover {
    background-color: #4b5563;
}

/* Кнопки Секция 3*/
.service-button-secondary {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 6px rgba(29,53,87,0.25);
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    text-decoration: none;
    min-height: 0;
}

.service-button-secondary img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.service-button-secondary img[src*="-dark"] {
    display: none;
}

.dark .service-button-secondary img[src*="-light"] {
    display: none;
}

.dark .service-button-secondary img[src*="-dark"] {
    display: block;
}

.service-button-secondary:hover {
    transform: scale(1.02);
    box-shadow: 0 3px 12px rgba(29,53,87,0.35);
    background-color: #f8fafc;
}

.dark .service-button-secondary {
    background-color: #4b5563;
    color: #d1d5db;
}

.dark .service-button-secondary:hover {
    background-color: #6b7280;
}

/* Банки */
.service-button-tertiary {
    width: 100%;
    height: 4.125rem;
    background-color: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 2px 6px rgba(29,53,87,0.25);
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0.25rem;
}

.service-button-tertiary img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.service-button-tertiary img[src*="-dark"] {
    display: none;
}

.dark .service-button-tertiary img[src*="-light"] {
    display: none;
}

.dark .service-button-tertiary img[src*="-dark"] {
    display: block;
}

.service-button-tertiary:hover {
    transform: scale(1.02);
    box-shadow: 0 3px 12px rgba(29,53,87,0.35);
}

.dark .service-button-tertiary {
    background-color: #4b5563;
    color: #d1d5db;
}

.dark .service-button-tertiary:hover {
    background-color: #6b7280;
}

.portal-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.portal-icon-wrapper span {
    font-weight: 600;
    color: #0f172a;
}

.dark .portal-icon-wrapper span {
    color: #f8fafc;
}

.portal-empty {
    text-align: center;
    font-size: 0.9rem;
    color: #94a3b8;
    padding: 1rem 0;
}

.admin-section {
    margin-top: 1.5rem;
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.dark .admin-section {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.admin-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.dark .admin-section h2 {
    color: #f8fafc;
    border-bottom-color: #475569;
}

.admin-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

.admin-card {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.dark .admin-card {
    background: #0f172a;
    border-color: #334155;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.admin-table thead {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.dark .admin-table thead {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
}

.admin-table th {
    padding: 0.75rem;
    font-weight: 600;
    text-align: left;
    color: #374151;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark .admin-table th {
    color: #f3f4f6;
}

.admin-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
}

.dark .admin-table td {
    border-bottom-color: #334155;
}

.admin-table tbody tr {
    transition: background-color 0.2s ease;
}

.admin-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
    cursor: pointer;
}

.dark .admin-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.admin-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

.dark .admin-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.3);
}

.badge {
    display: inline-flex;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.badge-muted {
    background: rgba(148, 163, 184, 0.25);
    color: #475569;
}

.badge-danger {
    background: rgba(248, 113, 113, 0.2);
    color: #b91c1c;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-form label span {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.dark .admin-form label span {
    color: #d1d5db;
}

.admin-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.admin-controls .flex-1 {
    flex: 1;
    min-width: 120px;
}

.admin-status {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    min-height: 1.25rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.admin-status.error {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.admin-status.success {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

/* Футер */
.footer {
    background-color: white;
    border-top: 1px solid #e2e8f0;
    padding: 0;
    flex-shrink: 0;
}

.dark .footer {
    background-color: #1e293b;
    border-top-color: #334155;
}



.brand {
    font-size: 1rem;
    color: green;
}

.dark .brand {
    color: #4ade80;
}

.news {
    font-size: 1.6rem;
    color: green;
    text-align: center;
}

.dark .news {
    color: #4ade80;
}

/* Кнопка переключения темы */
.theme-toggle {
    background-color: #f3f4f6;
    border: none;
    border-radius: 0.5rem;
    padding: 0.125rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
}

.theme-toggle:hover {
    background-color: #e5e7eb;
}

.dark .theme-toggle {
    background-color: #374151;
}

.dark .theme-toggle:hover {
    background-color: #4b5563;
}

.theme-toggle img {
    width: 95%;
    height: 95%;
    object-fit: contain;
}

@media (max-width: 640px) {
    .service-button-tertiary {
        height: 3.75rem;
    }
}

.banks-section {
    padding-top: 0.25rem;
    padding-bottom: 0;
}

.banks-grid {
    display: grid;
    grid-template-rows: repeat(2, auto);
    grid-template-columns: repeat(8, 1fr);
    gap: 0.4rem;
    width: 90%;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .banks-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, auto);
    }
}

.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
}

.settings-overlay.hidden {
    display: none;
}

.settings-panel {
    width: min(720px, 100%);
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.dark .settings-panel {
    background: #1f2937;
}

.settings-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.dark .settings-panel__header {
    border-bottom-color: #374151;
}

.settings-panel__close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #475569;
}

.dark .settings-panel__close {
    color: #e2e8f0;
}

.settings-panel__body {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.settings-panel__list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    max-height: 60vh;
    min-height: 200px;
    padding-right: 0.5rem;
}

.settings-panel__list::-webkit-scrollbar {
    width: 6px;
}

.settings-panel__list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.dark .settings-panel__list::-webkit-scrollbar-track {
    background: #334155;
}

.settings-panel__list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dark .settings-panel__list::-webkit-scrollbar-thumb {
    background: #64748b;
}

.settings-panel__list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark .settings-panel__list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.settings-category {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.75rem;
}

.dark .settings-category {
    border-color: #374151;
}

.settings-category__title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.dark .settings-category__title {
    color: #e2e8f0;
}

.settings-category__items {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.settings-portal-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #475569;
}

.dark .settings-portal-item {
    color: #cbd5f5;
}

.settings-panel__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.settings-panel__status {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #059669;
    min-height: 1.25rem;
}

.settings-panel__status.error {
    color: #dc2626;
}

.portal-input {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-input:focus {
    border-color: #1173d4;
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 115, 212, 0.2);
}

.dark .portal-input {
    background: #1e293b;
    border-color: #475569;
    color: #f8fafc;
}

/* блок курсов валют в строчку */
.currency-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    background-color: #f8fafc;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    font-size: 0.75rem;
    min-height: 2rem;
}

.currency-rates-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.currency-buttons {
    margin-left: auto;
}

.dark .currency-bar {
    background-color: #1e293b;
    border-color: #334155;
}

.currency-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.currency-section:last-child {
    gap: 0.375rem;
}

.currency-rates-left .currency-section:not(:last-child)::after {
    content: '|';
    color: #cbd5e1;
    margin-left: 1rem;
    font-weight: 300;
}

.dark .currency-section:not(:last-of-type)::after {
    color: #64748b;
}

.currency-label {
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    font-size: 0.8rem;
}

.dark .currency-label {
    color: #cbd5e1;
}

.currency-inline-rates {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.currency-inline-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    color: #64748b;
    font-size: 0.8rem;
}

.dark .currency-inline-item {
    color: #94a3b8;
}

.currency-inline-value {
    font-weight: 600;
    color: #1e293b;
}

.dark .currency-inline-value {
    color: #f1f5f9;
}

.currency-refresh-inline {
    display: none;
}

.header-button-highlight {
    position: relative;
    animation: gentle-glow 1.2s ease-in-out infinite alternate;
}

.header-button-highlight::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 0.5rem;
    z-index: -1;
    pointer-events: none;
    animation: gentle-glow 1.2s ease-in-out infinite alternate;
}

@keyframes gentle-glow {
    from { 
        box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.7), 0 0 8px 8px rgba(22, 163, 74, 0.3);
    }
    to { 
        box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.9), 0 0 8px 8px rgba(22, 163, 74, 0.5);
    }
}

.dark .header-button-highlight::after {
    animation: gentle-glow-dark 1.2s ease-in-out infinite alternate;
}

@keyframes gentle-glow-dark {
    from { 
        box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.7), 0 0 8px 8px rgba(74, 222, 128, 0.3);
    }
    to { 
        box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.9), 0 0 8px 8px rgba(74, 222, 128, 0.5);
    }
}

@media (max-width: 768px) {
    .currency-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .currency-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .currency-section:not(:last-of-type)::after {
        display: none;
    }
    
    .currency-inline-rates {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Cookie Notice */
.cookie-notice {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 70%;
    min-width: 320px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1rem;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cookie-notice-buttons {
    display: flex;
    gap: 0.5rem;
}

.cookie-notice-btn {
    background: #1173d4;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.cookie-notice-btn:hover {
    background: #0d5fa8;
}

.cookie-notice-btn-secondary {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-notice-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cookie-notice.hidden {
    transform: translateX(-50%) translateY(100%);
}

.cookie-notice:not(.hidden) {
    transform: translateX(-50%) translateY(0);
}

.cookie-notice-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-notice-text {
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
    flex: 1;
    min-width: 250px;
}

.cookie-notice-link {
    color: #60a5fa;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cookie-notice-link:hover {
    color: #93c5fd;
}

/* Cookie Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.cookie-modal-content {
    background: white;
    border-radius: 0.75rem;
    width: 70%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-modal:not(.hidden) .cookie-modal-content {
    transform: scale(1);
}

.dark .cookie-modal-content {
    background: #1e293b;
    color: #e2e8f0;
}

.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.dark .cookie-modal-header {
    border-bottom-color: #475569;
}

.cookie-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.cookie-modal-close:hover {
    background: #f1f5f9;
}

.dark .cookie-modal-close:hover {
    background: #334155;
}

.cookie-modal-body {
    padding: 0 1.5rem 1rem;
}

.cookie-modal-body h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.cookie-modal-body ul {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

.cookie-modal-body li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.cookie-modal-body p {
    margin: 1rem 0 0 0;
    line-height: 1.5;
    color: #64748b;
}

.dark .cookie-modal-body p {
    color: #94a3b8;
}

.cookie-modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    text-align: right;
}

@media (max-width: 640px) {
    .cookie-notice {
        width: 90%;
        min-width: 280px;
        bottom: 0.5rem;
    }
    
    .cookie-notice-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .cookie-notice-text {
        min-width: auto;
    }
}

/* Cookie Category Styles */
.cookie-category {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background-color: #f8fafc;
}

.dark .cookie-category {
    border-color: #475569;
    background-color: #1e293b;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cookie-category-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.cookie-category-checkbox {
    margin-right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
}

.cookie-category-name {
    color: #1e293b;
    font-weight: 600;
}

.dark .cookie-category-name {
    color: #f1f5f9;
}

.cookie-category-description {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
}

.dark .cookie-category-description {
    color: #94a3b8;
}

/* заметки */
.sticky-note {
    position: fixed;
    min-width: 150px;
    min-height: 120px;
    max-width: 400px;
    max-height: 300px;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: move;
    z-index: 1000;
    font-family: 'Manrope', sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
    animation: sticky-note-appear 0.3s ease-out;
    overflow: hidden;
}

.sticky-note:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.sticky-note-yellow {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.sticky-note-blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
}

.sticky-note-green {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
}

.sticky-note-pink {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border-color: #ec4899;
}

.sticky-note-purple {
    background: linear-gradient(135deg, #e9d5ff 0%, #ddd6fe 100%);
    border-color: #8b5cf6;
}

.dark .sticky-note {
    border-color: rgba(255, 255, 255, 0.2);
}

.dark .sticky-note-yellow {
    background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
    border-color: #f59e0b;
}

.dark .sticky-note-blue {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    border-color: #3b82f6;
}

.dark .sticky-note-green {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-color: #10b981;
}

.dark .sticky-note-pink {
    background: linear-gradient(135deg, #831843 0%, #be185d 100%);
    border-color: #ec4899;
}

.dark .sticky-note-purple {
    background: linear-gradient(135deg, #581c87 0%, #6b21a8 100%);
    border-color: #8b5cf6;
}

.sticky-note-header {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0.5rem 0;
}

.sticky-note-resize {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    cursor: nw-resize;
    background: linear-gradient(-45deg, transparent 40%, rgba(0,0,0,0.2) 40%, rgba(0,0,0,0.2) 60%, transparent 60%);
    border-radius: 0 0 0.5rem 0;
    z-index: 10;
}

.dark .sticky-note-resize {
    background: linear-gradient(-45deg, transparent 40%, rgba(255,255,255,0.3) 40%, rgba(255,255,255,0.3) 60%, transparent 60%);
}

.sticky-note-close {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
}

.sticky-note-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.sticky-note.resizing {
    cursor: nw-resize;
}

.sticky-note.resizing .sticky-note-content {
    pointer-events: none;
}

.dark .sticky-note-close {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.dark .sticky-note-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.sticky-note-content {
    width: 100%;
    height: calc(100% - 35px);
    padding: 0.5rem;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.4;
    color: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
}

.sticky-note-content::-webkit-scrollbar {
    width: 6px;
}

.sticky-note-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.sticky-note-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.sticky-note-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.dark .sticky-note-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.dark .sticky-note-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.dark .sticky-note-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dark .sticky-note-content {
    color: rgba(255, 255, 255, 0.9);
}

.sticky-note-content::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-style: italic;
}

.dark .sticky-note-content::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Кнопка добавления заметки */
.add-note-btn {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

.add-note-btn svg {
    flex-shrink: 0;
}

.add-note-btn:hover {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    color: #1e293b;
}

.add-note-btn:active {
    transform: translateY(1px);
}

.dark .add-note-btn {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    color: #e2e8f0;
    border-color: #4b5563;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .add-note-btn:hover {
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    color: #f8fafc;
}

/* SVG иконка заметки */
.note-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.calendar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.calc-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Анимация появления стикера */
@keyframes sticky-note-appear {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Калькулятор */
.calculator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1001;
    font-family: 'Manrope', sans-serif;
    animation: calculator-appear 0.3s ease-out;
    overflow: hidden;
}

.dark .calculator {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    cursor: grab;
}

.dark .calculator-header {
    background: rgba(15, 23, 42, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.calculator-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
}

.dark .calculator-title {
    color: #f8fafc;
}

.calculator-controls {
    display: flex;
    gap: 0.5rem;
}

.calculator-history-btn,
.calculator-close {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 0.25rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s ease;
}

.calculator-close {
    font-size: 16px;
    font-weight: bold;
}

.calculator-history-btn:hover,
.calculator-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.dark .calculator-history-btn,
.dark .calculator-close {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.dark .calculator-history-btn:hover,
.dark .calculator-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.calculator-display {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dark .calculator-display {
    background: rgba(15, 23, 42, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.calculator-expression {
    font-size: 0.75rem;
    color: #64748b;
    min-height: 1rem;
    text-align: right;
    word-break: break-all;
}

.dark .calculator-expression {
    color: #94a3b8;
}

.calculator-result {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    text-align: right;
    margin-top: 0.25rem;
    word-break: break-all;
}

.dark .calculator-result {
    color: #f8fafc;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: rgba(0, 0, 0, 0.1);
    padding: 1px;
}

.calc-btn {
    background: #ffffff;
    border: none;
    padding: 1rem 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1e293b;
    font-family: inherit;
}

.dark .calc-btn {
    background: #334155;
    color: #f8fafc;
}

.calc-btn:hover {
    background: #f1f5f9;
    transform: scale(1.05);
}

.dark .calc-btn:hover {
    background: #475569;
}

.calc-btn:active {
    transform: scale(0.95);
}

.calc-operator {
    background: #e2e8f0 !important;
    color: #1173d4 !important;
    font-weight: 600;
}

.dark .calc-operator {
    background: #475569 !important;
    color: #60a5fa !important;
}

.calc-equals {
    background: #1173d4 !important;
    color: white !important;
    font-weight: 600;
}

.dark .calc-equals {
    background: #3b82f6 !important;
}

.calc-clear,
.calc-clear-entry {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    font-weight: 600;
}

.dark .calc-clear,
.dark .calc-clear-entry {
    background: #7f1d1d !important;
    color: #fca5a5 !important;
}

.calc-decimal {
    grid-column: span 3;
}



@keyframes calculator-appear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes history-appear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Модальное окно запроса регистрации */
.registration-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.registration-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.registration-modal-content {
    background: white;
    border-radius: 0.75rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.registration-modal:not(.hidden) .registration-modal-content {
    transform: scale(1);
}

.dark .registration-modal-content {
    background: #1e293b;
    color: #e2e8f0;
}

.registration-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.dark .registration-modal-header {
    border-bottom-color: #475569;
}

.registration-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.registration-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.registration-modal-close:hover {
    background: #f1f5f9;
}

.dark .registration-modal-close:hover {
    background: #334155;
}

.registration-modal-body {
    padding: 0 1.5rem 1rem;
}

.registration-modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.dark .form-group label {
    color: #d1d5db;
}

/* Emoji капча */
.captcha-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.5rem;
}

.dark .captcha-container {
    background: #334155;
    border-color: #475569;
}

.captcha-question {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: #475569;
    text-align: center;
}

.dark .captcha-question {
    color: #cbd5e1;
}

.target-emoji {
    font-size: 2rem;
    margin: 0 0.5rem;
    display: inline-block;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.emoji-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.emoji-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
}

.dark .emoji-option {
    background: #1e293b;
    border-color: #475569;
}

.emoji-option:hover {
    border-color: #1173d4;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(17, 115, 212, 0.2);
}

.emoji-option.selected {
    border-color: #1173d4;
    background: #ebf8ff;
    transform: scale(1.05);
}

.dark .emoji-option.selected {
    background: #1e40af;
    border-color: #3b82f6;
}

.registration-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    text-align: center;
    font-weight: 500;
}

.registration-status.success {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.registration-status.error {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.registration-status.info {
    color: #1173d4;
    background: rgba(17, 115, 212, 0.1);
    border: 1px solid rgba(17, 115, 212, 0.2);
}

@media (max-width: 640px) {
    .registration-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .emoji-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .registration-modal-footer {
        flex-direction: column;
    }
}

/* Окно истории калькулятора */
.history-window {
    position: fixed;
    width: 320px;
    height: 400px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1002;
    font-family: 'Manrope', sans-serif;
    animation: history-appear 0.3s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dark .history-window {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.history-window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    cursor: grab;
    flex-shrink: 0;
}

.dark .history-window-header {
    background: rgba(15, 23, 42, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.history-window-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
}

.dark .history-window-title {
    color: #f8fafc;
}

.history-window-controls {
    display: flex;
    gap: 0.5rem;
}

.history-clear-btn,
.history-window-close {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 0.25rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s ease;
}

.history-window-close {
    font-size: 16px;
    font-weight: bold;
}

.history-clear-btn:hover,
.history-window-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.dark .history-clear-btn,
.dark .history-window-close {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.dark .history-clear-btn:hover,
.dark .history-window-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-window-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-window .history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.history-window .history-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-family: 'Courier New', monospace;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
    background: rgba(255, 255, 255, 0.5);
}

.dark .history-window .history-item {
    color: #94a3b8;
    border-bottom-color: rgba(255, 255, 255, 0.05);
    background: rgba(15, 23, 42, 0.5);
}

.history-window .history-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.dark .history-window .history-item:hover {
    background: rgba(59, 130, 246, 0.2);
}

.history-empty {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 2rem 1rem;
    font-size: 0.875rem;
}

.dark .history-empty {
    color: #64748b;
}

.history-window .history-list::-webkit-scrollbar {
    width: 6px;
}

.history-window .history-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.dark .history-window .history-list::-webkit-scrollbar-track {
    background: #334155;
}

.history-window .history-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dark .history-window .history-list::-webkit-scrollbar-thumb {
    background: #64748b;
}

.history-window .history-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* Плавающее окно календаря */
.calendar-floating-window {
    position: fixed;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 999;
    min-width: 300px;
    min-height: 300px;
}

.dark .calendar-floating-window {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.calendar-window-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    cursor: move;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0.75rem 0.75rem 0 0;
    flex-shrink: 0;
    min-height: 2rem;
}

.dark .calendar-window-header {
    border-bottom-color: #334155;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.calendar-window-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.dark .calendar-window-title {
    color: #f8fafc;
}

.calendar-window-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.calendar-window-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.dark .calendar-window-close:hover {
    background: #334155;
    color: #f8fafc;
}

.calendar-window-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-window-resize {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 0%, #cbd5e1 100%);
    border-radius: 0 0 0.75rem 0;
}

.dark .calendar-window-resize {
    background: linear-gradient(135deg, transparent 0%, #475569 100%);
}

.calendar-window-resize:hover {
    background: linear-gradient(135deg, transparent 0%, #94a3b8 100%);
}

.calendar-floating-window.resizing {
    opacity: 0.9;
}

/* Календарь внутри плавающего окна */
.calendar-floating-window #calendar-container {
    flex-shrink: 0;
}

.calendar-floating-window #day-notes-container {
    flex: 1;
    overflow-y: auto;
    min-height: 150px;
}

.calendar-floating-window .day-notes-list {
    max-height: 100%;
    overflow-y: auto;
}
