﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    --primary-color: #0072bc;
    --upper-nav-height: 56px;
    --lower-nav-height: 56px;
    --nav-bg-color: #0072bc;
    --nav-text-color: #ffffff;
    --nav-hover-color: #ffde59;
    --app-font-family: system-ui, -apple-system, Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --app-font-size: 17px;
}

html {
    font-size: var(--app-font-size);
}

html, body {
    font-family: var(--app-font-family);
}

body {
    overflow-x: hidden;
}

#components-reconnect-modal,
#components-reconnect-modal .components-reconnect-overlay,
#components-reconnect-modal .components-reconnect-dialog {
    display: none !important;
    visibility: hidden !important;
}

a, .btn-link {
    color: #000000;
    text-decoration: none;
}

    a:hover, .btn-link:hover {
        color: #000000;
        cursor: pointer;
    }

.text-justify a {
    text-decoration: underline;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.breadcrumb {
    background-color: #e9ecef;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

.breadcrumb-item a {
    text-decoration: none;
}

::placeholder {
    color: rgba(0, 0, 0, 0.3) !important;
}

.carousel {
    border-bottom: rgba(0, 0, 0, 0.1) solid 1px;
}

.no-lr-padding {
    padding-left: 0;
    padding-right: 0;
}

/* Blazored.Modal */

.blazored-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

/* remove default shell so only custom content is visible */
.blazored-modal-content {
    background: transparent;
    box-shadow: none;
    border: 0;
    padding: 0;
    display: contents;
}

.blazored-modal-header {
    padding: 5px;
}

.blazored-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 5px;
}

.blazored-modal-content {
    padding: 5px;
}

/* Navbar */

.nav-item {
    font-size: 0.82rem;
    text-transform: uppercase;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 74px;
    padding: 0.35rem 0;
}

.site-branding-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.navbar-brand .site-branding-icon {
    width: 200px;
    height: 72px;
}

.navbar-brand .site-branding-placeholder {
    width: 176px;
    height: 72px;
}

.site-branding-banner {
    max-height: 56px;
    width: auto;
    object-fit: contain;
}

.navbar-brand.has-banner {
    gap: 0;
}

    .navbar-brand.has-banner .site-branding-banner {
        max-height: 48px;
    }

.footer-title.has-banner {
    gap: 0.5rem;
}

.branding-preview {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.branding-preview-frame {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.branding-preview-frame .site-branding-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.branding-icon-clear {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    border-radius: 50%;
    --bs-btn-padding-x: 0.4rem;
    --bs-btn-padding-y: 0.4rem;
    line-height: 1;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    color: #dc3545;
    border: none;
}

.branding-preview-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 1rem;
    border: 1px dashed #ced4da;
    color: #6c757d;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.branding-preview-placeholder i {
    font-size: 2rem;
}

.branding-preview .site-branding-banner {
    max-height: 40px;
}

.site-branding-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background-color: #f1f3f5;
    color: #adb5bd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.site-branding-placeholder i {
    line-height: 1;
}

.footer-title {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.static-nav-link {
    color: rgba(0, 0, 0, 0.8) !important;
    cursor: default !important;
}

/* books/authors list */

.sidebar-heading {
    background-color: whitesmoke;
    border: rgba(0, 0, 0, 0.1) solid 1px;
    border-radius: 5px;
    padding: 0.5rem;
    margin-right: -30px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

ul.list {
    text-align: center;
    list-style-type: none;
    cursor: pointer;
    padding-left: 45px;
}

.list-items {
    text-align: left;
    font-size: 0.8rem;
    font-weight: 500;
    font-style: italic;
    padding-bottom: 5px;
}

    .list-items:hover {
        text-decoration: underline !important;
    }

.dropdown-button {
    font-size: 0.8rem !important;
    margin-right: -30px;
    margin-top: 0.5rem;
    border: rgba(0, 0, 0, 0.1) solid 1px;
}

    .dropdown-button:hover {
        font-size: 0.8rem !important;
        margin-right: -30px;
        margin-top: 0.5rem;
        border: rgba(0, 0, 0, 0.1) solid 1px;
        background-color: #f0f0f0;
    }

.dropdown-item {
    font-family: Arial;
    font-size: 12px;
    padding-top: 0.25rem;
    margin-right: 1rem;
}

.dropdown-menu {
    min-width: 198px;
}

/* Show login dropdown on hover */
.nav-item.dropdown:hover .nav-user-dropdown {
    display: block;
    margin-top: 0;
}

/* Ensure dropdown appears above other content */
.nav-user-dropdown {
    z-index: 1050;
}

.no-results {
    font-size: 1rem;
    font-weight: 500;
    font-style: italic;
    padding-left: 0.8rem;
}

/* home page bookshelves */

.heading-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem 1rem 1rem;
}

    .heading-row h3 {
        margin-bottom: 0;
        font-size: 1.25rem;
        font-style: italic;
    }

img.book-cover {
    width: 100px;
    max-height: 150px;
}

.book-title {
    font-size: 1rem;
    font-weight: 700;
    min-height: 3rem;
    max-height: 3rem;
    overflow: hidden;
}

.book-author {
    font-size: 0.8rem;
    font-style: italic;
    min-height: 1.25rem;
    max-height: 1.25rem;
    overflow: hidden;
    color: rgba(0, 0, 0, 0.6);
}

.book-button {
    width: 30%;
    height: 2rem;
    background-color: rgba(255, 255, 255, 0.7);
    color: rgba(0, 0, 0, 0.5);
    border: rgba(0, 0, 0, 0.3) solid 1px;
}

.book-button-layout {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image :hover {
    opacity: 1;
}

    .image :hover button {
        transform: none;
        opacity: 1;
    }

.hover-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(255,255,255, 0.5);
    opacity: 0;
    transition: all 0.5s;
}

    .hover-overlay button {
        z-index: 1000;
        transition: all 0.5s;
    }

    .hover-overlay button {
        transform: translateY(-50px);
    }

/* login & register screens */

.title-text {
    font-size: 1.6rem;
}

.link-text a {
    font-size: 1rem;
    color: rgba(71, 71, 105, 0.5);
    text-decoration: none;
}

    .link-text a:hover {
        color: slategray;
        text-decoration: none;
    }

/* file uploads */

/* Hide file inputs only when explicitly opted in */
input[type="file"].hidden-file-input {
    visibility: hidden;
}

.image-picker {
    margin-top: -3rem;
    cursor: pointer;
}

.image-preview {
    width: 10rem;
    margin: 1rem 0;
}

    .image-preview img {
        width: 100%;
    }

/* pagination */

.page-item.active .page-link {
    z-index: 3;
    color: #fff !important;
    background-color: #343a40 !important;
    border-color: #343a40 !important;
}

.page-link {
    color: #000;
}

.page-item.disabled .page-link {
    color: rgba(0,0,0, 0.4);
}

.page-item:not(.disabled) .page-link {
    color: rgba(0,0,0, 0.8);
}

/* container width control */
@media (min-width: 1200px) {
    .container {
        width: 1150px;
    }
}

/* TandF style header */
#upper-nav {
    background-color: #ffffff;
    color: rgba(0, 0, 0, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

    #upper-nav .navbar-brand,
    #upper-nav .navbar-brand span,
    #upper-nav .nav-link,
    #upper-nav .nav-link span,
    #upper-nav .nav-elements .nav-link,
    #upper-nav .folder-link {
        color: inherit !important;
    }

#upper-nav .nav-elements {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

    #upper-nav .navbar-brand:hover,
        #upper-nav .nav-link:hover,
        #upper-nav .nav-link:focus {
            color: var(--primary-color) !important;
        }

    #upper-nav .navbar-toggler {
        border-color: rgba(0, 0, 0, 0.2);
    }

#lower-nav {
    background-color: var(--nav-bg-color);
    color: var(--nav-text-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
}

    #lower-nav .nav-link,
    #lower-nav .folder-link {
        color: var(--nav-text-color) !important;
    }

        #lower-nav .nav-link:hover,
        #lower-nav .nav-link:focus {
            color: var(--nav-hover-color) !important;
        }

        #lower-nav .nav-link.active,
        #lower-nav .nav-item.show > .nav-link {
            color: var(--nav-hover-color) !important;
        }

    #lower-nav .navbar-toggler {
        border-color: rgba(255, 255, 255, 0.35);
    }


@media (max-width: 767.98px) {
    #upper-nav .navbar-brand {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }

        #upper-nav .navbar-brand .site-branding-icon {
            width: 132px;
            height: 56px;
        }

        #upper-nav .navbar-brand .site-branding-placeholder {
            width: 132px;
            height: 56px;
        }

        #upper-nav .navbar-brand.has-banner .site-branding-banner {
            max-height: 36px;
        }

    #upper-nav .nav-elements .navbar-nav {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }

    #upper-nav .nav-elements .nav-item {
        margin-left: 0;
    }

    #upper-nav .nav-elements .nav-link {
        text-transform: uppercase;
        font-weight: 600;
        font-size: 0.85rem;
    }
}

@media (max-width: 575.98px) {
    .branding-preview-frame,
    .branding-preview-placeholder {
        width: 110px;
        height: 110px;
    }
}



/* Nested dropdowns */
.dropdown-submenu {
    position: relative;
}

    .dropdown-submenu > .dropdown-menu {
        top: 0;
        left: 100%;
        margin-left: -1px;
    }

@media (max-width: 991.98px) {
    .dropdown-submenu > .dropdown-menu {
        left: 0;
        margin-left: 0;
    }
}

/* Home news spotlight */
.news-spotlight-section {
    padding: clamp(3rem, 5vw, 4.5rem) 0;
    background-color: #ffffff;
    border-top: 1px solid rgba(11, 26, 69, 0.08);
    border-bottom: 1px solid rgba(11, 26, 69, 0.08);
}

.news-spotlight-section .section-header {
    gap: 1rem;
}

.news-spotlight-section .section-link {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.news-spotlight-section .section-link:hover,
.news-spotlight-section .section-link:focus {
    text-decoration: underline;
}

.news-spotlight-section .section-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.news-spotlight-section .section-title {
    font-weight: 700;
    font-size: 1.85rem;
    color: #0b1a45;
}

.news-feature-card {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    background-color: #101735;
    color: #ffffff;
    border-radius: 26px;
    box-shadow: 0 28px 48px rgba(16, 23, 53, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.news-feature-card .feature-image {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-color: #18224d;
    filter: brightness(0.82);
}

.news-feature-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(9, 17, 43, 0.78) 0%, rgba(9, 17, 43, 0.05) 70%);
    transition: opacity 0.2s ease;
}

.news-feature-card:hover,
.news-feature-card:focus-visible {
    transform: translateY(-6px);
    box-shadow: 0 28px 48px rgba(16, 23, 53, 0.32);
}

.news-feature-card:hover::after,
.news-feature-card:focus-visible::after {
    opacity: 0.85;
}

.news-feature-card .feature-content {
    position: relative;
    z-index: 1;
    padding: clamp(2rem, 3vw, 2.75rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    justify-content: flex-end;
}

.feature-meta {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

.feature-title {
    font-size: clamp(1.65rem, 2.6vw, 1.95rem);
    font-weight: 700;
    line-height: 1.3;
}

.feature-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.news-list-card {
    background: #ffffff;
    border-radius: 22px;
    border: 1px solid rgba(15, 30, 90, 0.08);
    box-shadow: 0 18px 36px rgba(15, 30, 90, 0.12);
    padding: 1.75rem 1.5rem;
}

.news-list-card ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
}

.news-list-item {
    display: flex;
    gap: 1rem;
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    padding: 0.35rem 0.25rem;
    border-radius: 16px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.news-list-item:hover,
.news-list-item:focus-visible {
    background: rgba(11, 26, 69, 0.06);
    transform: translateX(4px);
}

.news-list-item .thumb {
    width: 120px;
    height: 72px;
    background: linear-gradient(135deg, #4f6bdc 0%, #8c9df5 100%);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.news-list-item .body {
    flex: 1;
}

.news-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5c6b92;
    margin-bottom: 0.35rem;
}

.news-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0b1a45;
    margin-bottom: 0.25rem;
}

.news-summary {
    font-size: 0.85rem;
    color: #5b6785;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-empty {
    border: 1px dashed rgba(11, 26, 69, 0.2);
    border-radius: 18px;
    background: rgba(250, 251, 255, 0.7);
}

.news-feature-card.shimmer,
.news-list-card.shimmer {
    background: linear-gradient(90deg, rgba(225, 230, 245, 0.2) 0%, rgba(225, 230, 245, 0.8) 50%, rgba(225, 230, 245, 0.2) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
    border-radius: 24px;
    min-height: 320px;
}

.news-list-card.shimmer {
    min-height: 320px;
}

@media (max-width: 991.98px) {
    .news-feature-card {
        min-height: 300px;
    }

    .news-list-card {
        margin-top: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .news-feature-card .feature-content {
        padding: 1.75rem;
    }

    .news-feature-card {
        min-height: 280px;
    }

    .news-title {
        font-size: 0.95rem;
    }

    .news-list-item .thumb {
        width: 80px;
        height: 64px;
    }
}

/* Quick access catalogue */
.quick-access-section {
    background: #ffffff;
    padding: clamp(3rem, 5vw, 1.5rem) 0;
    border-bottom: 1px solid rgba(11, 26, 69, 0.08);
}

.quick-access-section .section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    max-width: 620px;
}

.quick-access-section .section-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.quick-access-section .section-title {
    font-weight: 700;
    font-size: 1.85rem;
    color: #0b1a45;
}

.quick-access-section .section-description {
    font-size: 1rem;
    color: #5b6785;
    margin-top: 0.75rem;
}

.quick-access-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
}

@media (max-width: 480px) {
    .quick-access-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        gap: 1rem;
    }

    .quick-access-card {
        min-height: 150px;
        padding: 1.25rem 0.75rem;
    }
}

@media (min-width: 576px) {
    .quick-access-grid {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
}

@media (min-width: 768px) {
    .quick-access-grid {
        grid-template-columns: repeat(4, minmax(160px, 1fr));
    }
}

.quick-access-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1.6rem 1.1rem;
    background-color: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(11, 26, 69, 0.08);
    box-shadow: 0 18px 36px rgba(11, 26, 69, 0.1);
    text-align: center;
    color: #0b1a45;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    min-height: 190px;
    appearance: none;
    -webkit-appearance: none;
}

.quick-access-card:hover,
.quick-access-card:focus-visible {
    transform: translateY(-6px);
    box-shadow: 0 24px 40px rgba(11, 26, 69, 0.16);
    border-color: rgba(9, 49, 243, 0.35);
    outline: none;
}

.quick-access-card:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(9, 90, 199, 0.35);
}

.quick-access-card.empty {
    border-style: dashed;
    color: #6c757d;
    background: transparent;
    box-shadow: none;
    cursor: default;
}

.quick-icon {
    width: 105px;
    height: 105px;
    border-radius: 30px;
    background: #ffffff;
    border: 1px solid rgba(11, 26, 69, 0.08);
    box-shadow: 0 12px 24px rgba(11, 26, 69, 0.12);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.quick-icon i {
    font-size: 4.35rem;
}

.quick-icon-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px;
}

.quick-label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
}

.quick-title {
    font-weight: 600;
    font-size: 1rem;
}

.quick-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    background: rgba(9, 49, 243, 0.12);
    color: #0b1a45;
    font-size: 0.75rem;
    font-weight: 600;
}

.quick-count.placeholder {
    background: linear-gradient(90deg, rgba(200, 210, 230, 0.35) 0%, rgba(200, 210, 230, 0.9) 50%, rgba(200, 210, 230, 0.35) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
    color: transparent;
}

.quick-access-card.loading {
    border: 1px solid rgba(11, 26, 69, 0.05);
    box-shadow: none;
    cursor: default;
    min-height: 160px;
}

.quick-access-card.loading .skeleton-icon,
.quick-access-card.loading .skeleton-line {
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(210, 216, 230, 0.2) 0%, rgba(210, 216, 230, 0.7) 50%, rgba(210, 216, 230, 0.2) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
}

.skeleton-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
}

.skeleton-line {
    width: 70%;
    height: 16px;
}

@keyframes shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.synced-password-table {
    max-height: 20rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.synced-password-table-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
}

.first-password-modal {
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

.first-password-modal-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.first-password-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.first-password-modal-footer {
    flex-wrap: wrap;
}

.quick-topic-icon-wrapper {
    display: inline-flex;
}

.quick-topic-icon-picker {
    width: 72px;
    height: 72px;
    border: 2px dashed var(--bs-border-color, #ced4da);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-color: var(--bs-body-bg, #f8f9fa);
    transition: border-color .2s ease, box-shadow .2s ease;
    cursor: pointer;
}

.quick-topic-icon-picker:hover {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.quick-topic-icon-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quick-topic-icon-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 110, 253, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quick-topic-icon-picker:hover .quick-topic-icon-overlay {
    opacity: 1;
}

.quick-topic-icon-placeholder {
    font-size: 2rem;
    color: var(--bs-secondary-color, #6c757d);
}

.quick-topic-icon-spinner {
    width: 1.75rem;
    height: 1.75rem;
}

.loan-history-card {
    border: 1px solid #d9e2ef;
    background: #f7f9fc;
    font-family: 'Inter', var(--app-font-family);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.05);
}

.loan-history-card .card-header {
    background: linear-gradient(135deg, #eef3fb 0%, #f7f9fc 100%);
    border-bottom: 1px solid #d0d9e6;
    color: #1f2a44;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.loan-history-card .card-header h5 {
    font-family: 'Inter', var(--app-font-family);
    font-weight: 600;
}

.loan-history-card .card-body,
.loan-history-card .card-footer {
    background-color: #ffffff;
    color: #27304b;
    font-family: 'Inter', var(--app-font-family);
}

.loan-history-card .card-footer {
    border-top: 1px solid #e1e7f0;
}

.loan-history-card .table {
    margin-bottom: 0;
}

.loan-history-card .table thead th {
    color: #334166;
    font-size: 0.95rem;
    font-weight: 600;
    background-color: transparent;
    border-bottom: 1px solid #e1e7f0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.loan-history-card .table tbody td {
    vertical-align: middle;
    color: #3c4a67;
    font-size: 0.95rem;
}

.loan-history-card .table tbody td small {
    color: #59647c;
}

.loan-history-card__item {
    background-color: #ffffff;
    border-radius: 0.85rem;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    margin-bottom: 1.25rem;
    font-family: 'Inter', var(--app-font-family);
    border: 1px solid #e6ecf4;
}

.loan-history-card__item:last-of-type {
    margin-bottom: 0;
}

.loan-history-card__item .badge {
    font-weight: 600;
    letter-spacing: 0.03em;
}

.loan-history-card__item .text-muted,
.loan-history-card__item small {
    color: #5f6b85 !important;
}

.bb-fast-scanner {
    position: relative;
    width: 100%;
    min-height: 280px;
    aspect-ratio: 3 / 4;
    background-color: #000;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(12, 21, 36, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.bb-fast-scanner--active {
    box-shadow: 0 18px 48px rgba(12, 21, 36, 0.45);
}

.bb-fast-scanner__video {
    width: 100%;
    height: 100%;
    display: block;
    background-color: #000;
    object-fit: cover;
}

.bb-fast-scanner__canvas {
    display: none !important;
}

.bb-fast-scanner__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms ease-in-out;
    background: radial-gradient(circle at center, rgba(6, 17, 32, 0.05) 35%, rgba(6, 17, 32, 0.32) 100%);
}

.bb-fast-scanner__overlay--active {
    opacity: 1;
}

.bb-fast-scanner__frame {
    position: relative;
    max-width: min(360px, 78%);
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    border: 3px solid rgba(74, 255, 175, 0.88);
    box-shadow: 0 0 0 1400px rgba(5, 15, 28, 0.32);
    backdrop-filter: blur(1px);
    background: rgba(12, 28, 46, 0.18);
}

.bb-fast-scanner__frame::before {
    content: "";
    position: absolute;
    inset: 8%;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.28);
}

.bb-fast-scanner__frame::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(74, 255, 175, 0), rgba(74, 255, 175, 0.85), rgba(74, 255, 175, 0));
    top: 14%;
    animation: bb-fast-scanner__line 2s ease-in-out infinite;
}
.bb-fast-scanner__flash {
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    transition: transform .12s ease, background-color .12s ease;
}

    .bb-fast-scanner__flash:active {
        transform: scale(.95);
    }

@keyframes bb-fast-scanner__line {
    0%,
    100% {
        top: 14%;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    50% {
        top: 86%;
        opacity: 1;
    }

    80% {
        opacity: 1;
    }
}

/* Lower navigation menu */
#lower-nav .lower-nav-menu {
    background-color: var(--nav-bg-color);
    padding-top: 0.9rem;
    padding-bottom: 0.45rem;
}

#lower-nav .lower-nav-menu .navbar-toggler {
    z-index: 10;
    position: relative;
    cursor: pointer;
    pointer-events: auto !important;
    border-color: rgba(255, 255, 255, 0.65);
    color: #ffffff;
}

#lower-nav .lower-nav-menu .navbar-collapse {
    background-color: var(--nav-bg-color);
}

#lower-nav .lower-nav-menu .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.35);
}

#lower-nav .lower-nav-menu .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (min-width: 840px) {
    #lower-nav .lower-nav-menu .navbar-nav .dropdown:hover > .dropdown-menu {
        display: block;
        padding-top: 0;
    }

    #lower-nav .lower-nav-menu .dropdown-submenu {
        position: relative;
    }

    #lower-nav .lower-nav-menu .dropdown-submenu > .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -6px;
        margin-left: -1px;
        border-radius: 0.25rem;
    }

    #lower-nav .lower-nav-menu .navbar-nav .nav-item.dropdown:last-child .dropdown-submenu > .dropdown-menu {
        left: auto;
        right: 100%;
        margin-left: 0;
        margin-right: -1px;
    }

    #lower-nav .lower-nav-menu .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }

    #lower-nav .lower-nav-menu .dropdown-submenu:hover .submenu-arrow {
        transform: rotate(90deg);
    }

    #lower-nav .lower-nav-menu .dropdown-submenu > .dropdown-toggle::after {
        display: block;
        content: " ";
        float: right;
        width: 0;
        height: 0;
        border-color: transparent;
        border-style: solid;
        border-width: 5px 0 5px 5px;
        border-left-color: #cccccc;
        margin-top: 5px;
        margin-right: -10px;
    }

    #lower-nav .lower-nav-menu .navbar-nav .nav-item.dropdown:last-child .dropdown-submenu > .dropdown-toggle::after {
        float: left;
        border-width: 5px 5px 5px 0;
        border-left-color: transparent;
        border-right-color: #cccccc;
        margin-left: -10px;
        margin-right: 0;
    }

    #lower-nav .lower-nav-menu .dropdown-toggle::after {
        display: none !important;
    }

    #lower-nav .lower-nav-menu .dropdown-menu {
        margin: 0;
        padding: 0.5rem 0;
        border: 1px solid rgba(0, 0, 0, 0.15);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        z-index: 1000;
    }

    #lower-nav .lower-nav-menu .dropdown-item {
        font-family: var(--app-font-family);
        font-size: 12px;
        padding: 0.5rem 1.5rem;
        transition: background-color 0.2s;
    }

    #lower-nav .lower-nav-menu .dropdown-item:hover {
        background-color: #f8f9fa;
    }

    #lower-nav .lower-nav-menu li.dropdown-submenu {
        display: flex;
    }

    #lower-nav .lower-nav-menu i.bi.bi-chevron-right.submenu-arrow {
        margin-right: 15px;
        display: flex;
        align-items: center;
    }
}

#lower-nav .nav-menu-alert {
    margin: 0.25rem 0;
    padding: 0.35rem 0.75rem;
    color: #212529;
}

#lower-nav .nav-menu-alert.alert-danger {
    color: #66121a;
}

#lower-nav .nav-menu-alert.alert-warning {
    color: #5f4200;
}

#lower-nav .nav-menu-alert .nav-menu-retry {
    white-space: nowrap;
}

#lower-nav .nav-menu-empty {
    font-size: 0.85rem;
}
