:root {
    --primary: #1E4DD8;
    --primary-hover: #163BA8;
    --bg-body: #F7F7F9;
    --bg-sidebar: #F8F9FA;
    --bg-white: #FFFFFF;
    --text-main: #1A1A1A;
    --text-muted: #6B6B6B;
    --border-color: #E5E7EB;
    --success: #4BB543;
    --warning: #CA8A04; /* Yellow-600 */
    --danger: #DC2626;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.04);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow: hidden; /* Prevent full body scroll, scroll main instead */
}

/**/
/* FROM Styles CSS Begin*/

/**/

/* TOP NAVBAR */
.top-navbar {
    height: 64px;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
    text-decoration: none;
}

.nav-center {
    display: flex;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link.active, .nav-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

.profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

.mobile-menu-btn {
    display: none;
}

.mobile-menu-accordion {
    display: none;
}

/* LAYOUT */
.app-wrapper {
    display: flex;
    margin-top: 64px; /* Offset for fixed navbar */
    height: calc(100vh - 64px);
}

/* SIDEBAR */
.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    flex-shrink: 0;
    position: fixed;
    height: 100%;
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu li.separator {
    height: 1px;
    background: var(--border-color);
    margin: 16px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.2s;
}

.sidebar-menu a:hover {
    background: #EBEBEB;
    color: var(--text-main);
}

.sidebar-menu a.active {
    background: #E0E7FF; /* Very light blue */
    color: var(--primary);
}


/* MAIN CONTENT */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    margin-left: 240px;
}
/* Home Page BEGIN*/
/* Dashboard Main Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 24px;
    height: calc(100vh - 160px);
    min-height: 700px;
}

/* Right column - flex container */
.widget-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100%;
}

/* Wise - fixed height */
.wise-card {
    flex: 0 0 410px;
    overflow: hidden;
}

/* News Card */
.news-card {
    flex: 1; /* Extendable */
    overflow: hidden;
    min-height: 0; /* Important for Firefox/Grid */
}

.converter-card {
    flex: 0 0 410px;
    overflow: hidden;
}

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

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

/* --- New styles for currency input block --- */
.currency-input-container {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 16px; /* Отступы внутри блока */
    background: white;
    transition: all 0.2s ease;
}


/* Focus on entire block */
.currency-input-container:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.currency-input-container:hover {
    border-color: #9ca3af; /* Make darker on hover */
}

.currency-input-container input {
    -moz-appearance:textfield;
}

.currency-input-container input::-webkit-outer-spin-button,
.currency-input-container input::-webkit-inner-spin-button {
    /* display: none; <- Crashes Chrome on hover */
    -webkit-appearance: none;
    margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

.currency-select-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.currency-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%; /* Round flag */
    object-fit: cover;
    border: 1px solid #e5e7eb; /* Thin border */
}

input {
    border: none;
    outline: none;
    flex-grow: 1;
    /*width: 100%;*/ /*Change it for other inputs if needed*/
    font-size: 1.5rem; /* Крупный шрифт как в примере */
    font-weight: 600;
    color: #111827;
    background: transparent;
    min-width: 0;
}

select {
    border: none;
    outline: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    background: transparent;
    cursor: pointer;
    /*width: auto; !* Ширина по содержимому *!*/
    appearance: none; /* Убираем стандартную стрелку браузера (частично) */
    padding-right: 20px; /* Место под нашу кастомную стрелку */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23111827%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 16px;
}

/* --- КОНЕЦ НОВЫХ СТИЛЕЙ --- */

.swap-container {
    display: flex;
    justify-content: center;
    margin: -16px 0; /* Наезжаем на блоки сверху и снизу */
    position: relative;
    z-index: 10;
    padding-top:5px;
    padding-bottom:21px;
}

.swap-btn {
    background: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #2563eb;
}

.swap-btn:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: rotate(180deg);
}

.rate-info {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
}

.rate-info span {
    color: #2563eb;
    font-weight: 600;
}

.effective-date {
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af; /* Светло-серый цвет */
    margin-top: 5px;
}

/* For mobile */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* One column */
        height: auto; /* Height based on content */
        display: flex;
        flex-direction: column;
    }
    .right-column {
        height: auto;
    }
    .wise-card {
        height: 320px;
    }
    .news-card {
        height: 500px; /* Fixed height for mobile */
    }
    .chart-card {
        height: 500px;
    }
}
/* Home Page end*/


.content-container {
    max-width: 1600px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.page-header .date {
    color: var(--text-muted);
    font-size: 14px;
}

/* GRID SYSTEM */
.grid-row {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

.halves {
    grid-template-columns: 1fr 1fr;
}

.full {
    grid-template-columns: 1fr;
}

/* CARDS */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 17px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

/* TYPOGRAPHY & ELEMENTS within Cards */
.big-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* BUTTONS */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-ghost {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-ghost-danger {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}
.btn-ghost-danger:hover {
    color: var(--danger);
}

/* DRAFT LIST */
.draft-list {
    list-style: none;
}
.draft-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.draft-list li:last-child {
    border-bottom: none;
}
.draft-tag {
    background: #EFF6FF;
    color: var(--primary);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    margin-right: 8px;
}
.draft-name {
    font-weight: 500;
    font-size: 14px;
}
.link-arrow {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.2s;
}
.link-arrow:hover {
    color: var(--primary);
}

/* NOTIFICATIONS */
.notification-list {
    list-style: none;
}
.notification-list li {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-start;
}
.notification-list li:last-child {
    margin-bottom: 0;
}
.notification-list li i {
    flex-shrink: 0;
    margin-top: 2px;
}
.notification-list .urgent i { color: #EAB308; } /* Yellow/Orange */
.notification-list .info i { color: var(--primary); }

.notification-list div strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}
.notification-list div p {
    font-size: 13px;
    color: var(--text-muted);
}

/* QUICK ACTIONS */
.actions-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.full-width {
    width: 100%;
}

/* CHART */
.chart-container {
    height: 250px;
    width: 100%;
    position: relative;
}
.badge-success {
    background: #DCFCE7;
    color: #166534;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* FROM Styles CSS Begin*/


/* --- CARDS & GRID --- */

.page-title { font-size: 24px; font-weight: 600; margin-bottom: 24px; }

/* --- FORMS (Customizing to match design) --- */
.form-label {
    font-size: 13px; font-weight: 600; color: #374151;
    margin-bottom: 6px; display: block;
}
.input-group-text {
    display: flex; align-items: center; padding: 0.375rem 0.75rem;
    background-color: #e9ecef; border: 1px solid #ced4da;
    border-radius: 8px 0 0 8px;
}

/* Overriding Bootstrap form-control for cleaner look */
.form-control, .form-select {
    display: block; width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-main);
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px; /* Consistent radius */
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.input-group .form-control { border-radius: 0 8px 8px 0; }
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 77, 216, 0.15);
    outline: 0;
}

/* --- BUTTONS --- */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 8px;
}
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-danger { background-color: var(--danger); border: none; }

/* --- TABLES --- */
.table-responsive { overflow-x: auto; }
.table { width: 100%; margin-bottom: 1rem; color: var(--text-main); border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; border-bottom: 1px solid var(--border-color); text-align: left; font-size: 14px; }
.table th { background-color: #F3F4F6; font-weight: 600; color: #374151; }
.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(0,0,0,.02); }

/* --- RESULTS SECTION --- */
.results-card h3 {
    font-size: 16px; margin: 10px 0; font-weight: 500;
    display: flex; justify-content: space-between; border-bottom: 1px dashed #eee; padding-bottom: 8px;
}
.results-card span { font-size: 18px; font-weight: 700; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .sidebar { display: none; } /* Mobile menu needed logic, hiding for now per prototype */
    .main-content { margin-left: 0; }
    .grid-2-cols { grid-template-columns: 1fr; }
    .exchange { display: none; } /* Hide widget on mobile */

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: var(--text-main);
        cursor: pointer;
        padding: 8px;
        margin-left: 8px;
    }

    .mobile-menu-accordion {
        display: block;
        position: absolute;
        top: 64px;
        left: 0;
        width: 100%;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);

        /* Opening animation */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out, padding 0.3s ease;
        padding-top: 0;
        padding-bottom: 0;
    }

    .mobile-menu-accordion.open {
        max-height: 300px;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .mobile-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 24px;
        text-decoration: none;
        color: var(--text-main);
        font-weight: 500;
        font-size: 16px;
        border-left: 4px solid transparent;
    }

    .mobile-link i {
        color: var(--text-muted);
        width: 20px;
        height: 20px;
    }

    .mobile-link:hover {
        background-color: var(--bg-body);
    }

    .mobile-link.active {
        background-color: #E0E7FF;
        color: var(--primary);
        border-left-color: var(--primary);
    }

    .mobile-link.active i {
        color: var(--primary);
    }

}

/* Tooltip helper specifically for your JS */
.error-message { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* FROM Styles CSS End*/


/* MOBILE RESPONSIVE */
@media (max-width: 900px) {
    .app-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        display: none; /* Hidden on mobile for simplicity in this demo */
    }
    .halves {
        grid-template-columns: 1fr; /* Stack cards */
    }
    .nav-center {
        display: none; /* Hide nav links on mobile */
    }
}