body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

html {
    height: -webkit-fill-available;
}

:root {
    --sidebar-width: 4.5rem;
    --content-inset: 0.5rem;
    --app-header-height: 3.5rem;
}

main.login-page
{
    height: 100vh;
    height: -webkit-fill-available;
    max-height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
}
.dropdown-toggle { outline: 0; }

.btn-toggle {
    padding: .25rem .5rem;
    font-weight: 600;
    color: var(--bs-emphasis-color);
    background-color: transparent;
}
.btn-toggle:hover,
.btn-toggle:focus {
    color: rgba(var(--bs-emphasis-color-rgb), .85);
    background-color: var(--bs-tertiary-bg);
}

.btn-toggle::before {
    width: 1.25em;
    line-height: 0;
    content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%280,0,0,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
    transition: transform .35s ease;
    transform-origin: .5em 50%;
}

[data-bs-theme="dark"] .btn-toggle::before {
    content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%28255,255,255,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
}

.btn-toggle[aria-expanded="true"] {
    color: rgba(var(--bs-emphasis-color-rgb), .85);
}
.btn-toggle[aria-expanded="true"]::before {
    transform: rotate(90deg);
}

.btn-toggle-nav a {
    padding: .1875rem .5rem;
    margin-top: .125rem;
    margin-left: 1.25rem;
}
.btn-toggle-nav a:hover,
.btn-toggle-nav a:focus {
    background-color: var(--bs-tertiary-bg);
}

.scrollarea {
    overflow-y: auto;
}

html,
body {
    background-color: var(--bs-body-bg);
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1028;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    height: var(--app-header-height);
    padding: 0 0.75rem 0 1rem;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

.header-leading {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.header-actions {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    min-width: 0;
}

.header-account {
    position: relative;
    display: flex;
    align-items: center;
    align-self: stretch;
    gap: 0.6rem;
    min-width: 0;
}

.header-account-name {
    overflow: hidden;
    max-width: 16rem;
    color: var(--bs-secondary-color);
    font-size: 0.95rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.header-user {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: var(--bs-body-color);
    background: transparent;
    border: 0;
}

.header-user svg,
.header-tool svg {
    width: 22px;
    height: 22px;
}

.header-tool {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: var(--bs-body-color);
    cursor: pointer;
    background: transparent;
    border: 0;
}

.header-menu {
    display: none;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.header-search[hidden] {
    display: none !important;
}

.header-search-input {
    width: min(15rem, 42vw);
    height: 2.15rem;
    padding: 0.25rem 1.75rem 0.25rem 0.75rem;
    color: var(--bs-body-color);
    background-color: transparent;
    border: 1px solid var(--bs-primary);
    border-radius: 0.375rem;
    box-shadow: 0 0 0 0.15rem rgba(var(--bs-primary-rgb), 0.35);
}

.header-search-input::placeholder {
    color: var(--bs-secondary-color);
}

.header-search-input:focus {
    outline: 0;
    border-color: var(--bs-primary);
}

.header-search-input::-webkit-search-cancel-button,
.header-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.header-search-dismiss {
    position: absolute;
    top: 50%;
    right: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    color: var(--bs-secondary-color);
    cursor: pointer;
    background: transparent;
    border: 0;
    transform: translateY(-50%);
}

.header-search-dismiss svg {
    width: 16px;
    height: 16px;
}

.header-theme .theme-icon {
    display: none;
    align-items: center;
    justify-content: center;
}

[data-bs-theme="dark"] .header-theme .theme-icon-dark,
[data-bs-theme="light"] .header-theme .theme-icon-light {
    display: flex;
}

.calc-widget-anchor {
    position: relative;
    flex-shrink: 0;
}

.header-calc:hover,
.header-calc.is-active {
    border-radius: 0.35rem;
    background-color: rgba(var(--bs-emphasis-color-rgb), 0.12);
}

.exchange-mini-popup {
    display: none;
    position: absolute;
    top: calc(100% + 0.85rem);
    right: 0;
    z-index: 1080;
    width: max-content;
    max-width: calc(100vw - 1rem);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
}

.exchange-mini-popup.is-open {
    display: block;
}

.exchange-mini-popup .exchange-mini {
    min-width: 0;
    max-width: calc(100vw - 1rem);
    box-sizing: border-box;
    color-scheme: light;
}

.exchange-mini-popup .exchange-mini__input {
    background-color: #fff;
    color: #212529;
}

.header-account .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    display: none;
    min-width: 10rem;
    margin: 0.25rem 0 0;
    --bs-dropdown-color: var(--bs-body-color);
    --bs-dropdown-bg: var(--bs-body-bg);
    --bs-dropdown-border-color: var(--bs-border-color);
    --bs-dropdown-link-color: var(--bs-body-color);
    --bs-dropdown-link-hover-color: var(--bs-emphasis-color);
    --bs-dropdown-link-hover-bg: var(--bs-tertiary-bg);
}

.header-account .dropdown-menu.show {
    display: block;
}

.dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.25rem;
}

.dropdown-menu .dropdown-icon,
.dropdown-menu .dropdown-label {
    display: flex;
    align-items: center;
    min-height: 1.25rem;
}

.dropdown-menu .dropdown-icon {
    flex: 0 0 1.25rem;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
}

.dropdown-menu .dropdown-icon svg,
.dropdown-menu .dropdown-item > svg {
    display: block;
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
}

.header-account form.dropdown-menu .dropdown-item {
    width: 100%;
    text-align: start;
}

.sidebar-shell {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1030;
    box-sizing: border-box;
    width: var(--sidebar-width);
    height: 100vh;
    overflow: visible;
    background-color: var(--bs-tertiary-bg);
    border-left: 1px solid var(--bs-border-color);
    pointer-events: none;
    transform: translateX(100%);
    transition: transform 0.22s ease;
}

.sidebar-shell.is-open {
    z-index: 2000;
    pointer-events: auto;
    transform: translateX(0);
}

.sidebar-shell:not(.is-open) .dropdown-menu {
    display: none;
}

.sidebar-brand {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    color: var(--bs-body-color);
    overflow: visible;
}

.app-header .sidebar-brand {
    position: static;
    z-index: auto;
}

.sidebar-brand svg {
    display: block;
    width: 90px;
    height: 25px;
    overflow: visible;
}

.sidebar-panel {
    width: 100%;
    height: 100%;
}

.sidebar-panel .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: var(--app-header-height);
    padding: 0;
    border-radius: 0;
}

.sidebar-panel .nav-link {
    color: var(--bs-body-color);
}

.sidebar-panel .nav-link svg {
    width: 32px;
    height: 32px;
    overflow: hidden;
}

.sidebar-panel button.nav-link {
    cursor: pointer;
    background-color: transparent;
    border-top: 0;
    border-right: 0;
    border-left: 0;
}

.sidebar-panel .dropdown-toggle::after {
    display: none;
}

.sidebar-panel .dropstart .dropdown-menu {
    top: 0;
    right: 100%;
    left: auto;
    min-width: min(12.5rem, calc(100vw - var(--sidebar-width) - 1rem));
    max-width: calc(100vw - var(--sidebar-width) - 1rem);
    max-height: calc(100vh - 1rem);
    margin: 0 0.35rem 0 0;
    overflow-y: auto;
    text-align: start;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1025;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.app-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: auto;
    z-index: 1080;
    display: flex;
    gap: 12px;
    align-items: center;
    max-width: min(320px, calc(100vw - 32px));
    padding: 12px 14px;
    color: var(--bs-body-color);
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
}

.app-toast.is-error {
    border-color: #dc3545;
}

.app-toast button {
    display: flex;
    padding: 0;
    color: inherit;
    cursor: pointer;
    background: transparent;
    border: 0;
}

.app-toast svg {
    width: 16px;
    height: 16px;
}

.text-small {
    font-size: 0.875rem;
}

body:has(#sidebar) .app-header {
    right: var(--content-inset);
}

body:has(#sidebar) .app-toast {
    right: calc(var(--content-inset) + 16px);
}

.app-content {
    box-sizing: border-box;
    height: auto;
    max-height: none;
    min-width: 0;
    min-height: 100vh;
    margin-right: 0;
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
    overflow: visible;
}

body:has(#sidebar) .app-content {
    margin-right: var(--content-inset);
}

body:has(.app-header) .app-content {
    padding-top: calc(var(--app-header-height) + 1.75rem);
}

.app-content h1,
.login-card h1 {
    font-size: 1.5rem;
}

.form-card {
    max-width: 36rem;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 26rem;
}

.app-content .card-header h4 {
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.app-content img {
    max-width: 100%;
    height: auto;
}

.app-content .card-body form > .d-flex,
.app-content .card-footer {
    flex-wrap: wrap;
}

@media (max-width: 1199.98px) {
    .header-account-name {
        max-width: 10rem;
    }
}

@media (max-width: 991.98px) {
    :root {
        --content-inset: 0px;
    }

    .app-content {
        padding-right: 1rem;
        padding-left: 1rem;
        padding-bottom: 0.5rem;
    }

    body:has(.app-header) .app-content {
        padding-top: calc(var(--app-header-height) + 1rem);
    }

    .exchange-mini-popup .exchange-mini__row {
        flex-wrap: wrap;
    }
}

@media (max-width: 767.98px) {
    .header-account-name {
        display: none;
    }

    .header-actions,
    .header-leading {
        gap: 0.2rem;
    }

    .app-header {
        padding-right: 0.4rem;
        padding-left: 0.6rem;
    }

    .sidebar-brand svg {
        width: 68px;
        height: 20px;
    }

    .header-search:not([hidden]) {
        position: absolute;
        top: 50%;
        right: 0.4rem;
        left: 0.4rem;
        z-index: 2;
        background-color: var(--bs-body-bg);
        transform: translateY(-50%);
    }

    .header-search-input {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .app-content {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .app-content h1,
    .login-card h1 {
        font-size: 1.35rem;
    }

    .app-content .card-body.p-4 {
        padding: 0.5rem !important;
    }

    .app-content .card-footer .btn,
    .app-content .card-body form > .d-flex .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .app-content .container {
        padding-right: 0;
        padding-left: 0;
    }

    .app-toast {
        right: 12px;
        bottom: 12px;
        left: 12px;
        max-width: none;
    }

    body:has(#sidebar) .app-toast {
        right: calc(var(--content-inset) + 12px);
        left: 12px;
    }

    .login-page {
        align-items: flex-start;
        padding: 1rem;
    }

    .app-content .card-body,
    .app-content .alert {
        overflow-wrap: anywhere;
    }
}


@media (max-width: 359.98px) {
    .header-tool,
    .header-user {
        width: 1.75rem;
    }

    .sidebar-brand svg {
        width: 52px;
        height: 16px;
    }
}

