/* Application shell and design tokens */
:root {
    --app-sidebar-width: 335px;
    --app-shell-transition: all 0.28s ease;
    --app-content-max-width: 1440px;
}

body {
    min-width: 300px;
}

.wrapper,
.app-shell {
    display: flex;
    width: 100%;
}

#sidebar,
.app-sidebar {
    width: var(--app-sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    z-index: 999;
    transition: var(--app-shell-transition);
    transform-origin: center left;
    overflow-y: auto;
}

#sidebar.active {
    margin-left: calc(var(--app-sidebar-width) * -1);
}

.sidebar-header {
    padding: 0;
    margin-top: -0.25rem;
    margin-bottom: 0.25rem;
}

.sidebar-header + hr {
    margin-top: 0.5rem !important;
    margin-bottom: 0.75rem !important;
}

.sidebar-brand {
    font-size: 1.75rem;
    line-height: 1.2;
    margin: 0;
}

.sidebar-brand a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.brand-logo {
    max-height: min(256px, 100vh - 610px);
    min-height: 128px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 10px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-brand a:hover .brand-logo {
    transform: scale(1.08) rotate(-4deg);
}




#nav_menu .nav-link,
.sidebar-account a {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
}


#nav_menu {
    position: static;
    gap: 0.125rem;
}

#nav_menu .nav-link {
    min-height: 2.5rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.86) !important;
}

#nav_menu .nav-link:hover,
#nav_menu .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

#nav_menu .nav-link i {
    width: 1.25rem;
    text-align: center;
    opacity: 0.9;
}

.sidebar-account {
    margin-right: 1rem;
}

/* Account row and collapse arrow share one flex row; the arrow used to be
   absolutely pinned to the sidebar's bottom, which drifts away from the
   account row once the sidebar content overflows (e.g. when the ad fills). */
.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#dismiss {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#content {
    min-width: 300px;
    width: calc(100% - var(--app-sidebar-width));
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    transition: var(--app-shell-transition);
    position: absolute;
    top: 0;
    right: 0;
}

#content.active {
    width: 100%;
}

#sidebarCollapse {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1001;
    width: 2.5rem;
    height: 2.5rem;
    border-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.22);
    transition: var(--app-shell-transition);
}

#sidebarCollapse.active {
    opacity: 1;
    pointer-events: auto;
}

#right-content,
.app-main {
    width: min(100%, var(--app-content-max-width));
    margin: 0 auto;
    padding: 1rem;
}

#footer {
    padding: 0 1rem 1rem;
}

.love {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    :root {
        --app-sidebar-width: min(335px, 88vw);
    }

    #content {
        min-width: 300px;
        width: 100%;
        margin-left: 0;
        left: 0;
    }

    #content.active {
        width: calc(100% - var(--app-sidebar-width));
        margin-left: var(--app-sidebar-width);
    }

    #sidebar {
        margin-left: calc(var(--app-sidebar-width) * -1);
        transform: rotateY(100deg);
    }

    #sidebar.active {
        margin-left: 0;
        transform: none;
    }

    #sidebarCollapse {
        opacity: 1;
        pointer-events: auto;
    }

    #sidebarCollapse.active {
        opacity: 0;
        pointer-events: none;
    }

    #right-content,
    .app-main {
        padding: 0.75rem;
    }
}

/* Modern premium table list design */
.modern-table-responsive {
    border-radius: 12px;
    overflow-x: auto;
    border: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.08));
    background-color: var(--bs-card-bg, rgba(255, 255, 255, 0.02));
    padding: 0.5rem;
}

.modern-table {
    width: 100%;
    margin-bottom: 0;
    color: var(--bs-body-color);
    vertical-align: middle;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.modern-table thead th {
    border: none;
    font-weight: 600;
    color: var(--bs-secondary-color, #8a94a6);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
}

.modern-table tbody tr {
    background-color: var(--bs-tertiary-bg, rgba(255, 255, 255, 0.01));
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modern-table tbody tr:hover {
    background-color: var(--bs-secondary-bg, rgba(255, 255, 255, 0.06));
    transform: translateX(4px);
}

.modern-table td, .modern-table th {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-top: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.05));
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.05));
}

.modern-table th:first-child, .modern-table td:first-child {
    border-left: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.05));
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.modern-table th:last-child, .modern-table td:last-child {
    border-right: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.05));
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.modern-table tr:hover td {
    border-color: var(--bs-primary-border-subtle, rgba(13, 110, 253, 0.3));
}

/* Empty state styles */
.empty-state {
    padding: 2rem 1.25rem;
    text-align: center;
    background: var(--bs-tertiary-bg, rgba(255, 255, 255, 0.02));
    border: 1px dashed var(--bs-border-color, rgba(255, 255, 255, 0.15));
    border-radius: 8px;
    margin: 1rem 0;
}

.empty-state-compact {
    padding: 1.5rem 1rem;
    margin: 0;
}

.empty-state-icon {
    font-size: 2rem;
    color: var(--bs-secondary, #6c757d);
    margin-bottom: 0.75rem;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.empty-state-desc {
    color: var(--bs-secondary-color, #8a94a6);
    max-width: 420px;
    margin: 0 auto 1rem;
    font-size: 0.95rem;
}

/* Badge styling */
.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background-color: var(--bs-secondary-bg, rgba(255, 255, 255, 0.1));
    color: var(--bs-body-color, #fff);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Title truncation for mobile viewports */
.text-truncate-title {
    display: inline-block;
    max-width: 25vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}
@media (max-width: 768px) {
    .text-truncate-title {
        max-width: 50vw;
    }
}
@media (max-width: 576px) {
    .text-truncate-title {
        max-width: 40vw;
    }
    .stat-badge {
        padding: 0;
        font-size: 0.7rem;
        gap: 0.15rem;
        background-color: transparent;
        border-radius: 0;
        margin-right: 0.25rem;
    }
    .modern-table td .d-flex {
        gap: 0.25rem !important;
    }
}

/* Improve readability of description text inside tables */
.modern-table td.text-secondary {
    color: var(--bs-body-color) !important;
    opacity: 0.75;
}

/* Premium Modern Pagination Styling */
.pagination {
    gap: 0.25rem;
    margin: 1.5rem 0;
}

.pagination .page-link {
    background-color: var(--bs-tertiary-bg, rgba(255, 255, 255, 0.02));
    border: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.08));
    color: var(--bs-body-color, #fff);
    padding: 0.5rem 0.85rem;
    border-radius: 8px !important;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.pagination .page-link:hover {
    background-color: var(--bs-secondary-bg, rgba(255, 255, 255, 0.08));
    border-color: var(--bs-primary, #0d6efd);
    color: var(--bs-primary, #0d6efd) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--bs-primary, #0d6efd), var(--bs-primary-border-subtle, #3b82f6));
    border-color: var(--bs-primary, #0d6efd);
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}

.pagination .page-item.disabled .page-link {
    background-color: transparent;
    border-color: var(--bs-border-color-translucent, rgba(255, 255, 255, 0.03));
    color: var(--bs-secondary-color, #6c757d);
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Modern premium card design (re-introduced for grid card view mode) */
.modern-card {
    border: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: var(--bs-card-bg, rgba(255, 255, 255, 0.05));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--bs-primary, #0d6efd);
}
.modern-card-body {
    padding: 1.25rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}
.modern-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.modern-card-title a {
    color: var(--bs-heading-color, inherit);
    text-decoration: none;
    transition: color 0.2s ease;
}
.modern-card-title a:hover {
    color: var(--app-link);
}
.modern-card-desc {
    font-size: 0.9rem;
    color: var(--bs-secondary-color, #8a94a6);
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.modern-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--bs-secondary-color, #8a94a6);
    border-top: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.08));
    padding-top: 0.75rem;
    margin-top: auto;
}

/* Force standard pill badges in card grid layout */
.layout-card-view .stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem !important;
    border-radius: 6px !important;
    background-color: var(--bs-secondary-bg, rgba(255, 255, 255, 0.1)) !important;
    color: var(--bs-body-color, #fff) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

/* Responsive visibility default rules */
@media (min-width: 768px) {
    .layout-card-view { display: none; }
    .layout-list-view { display: block; }
}
@media (max-width: 767.98px) {
    .layout-card-view { display: block; }
    .layout-list-view { display: none; }
}

/* User preference overrides */
html.layout-pref-list .layout-card-view, body.layout-pref-list .layout-card-view { display: none !important; }
html.layout-pref-list .layout-list-view, body.layout-pref-list .layout-list-view { display: block !important; }

html.layout-pref-card .layout-card-view, body.layout-pref-card .layout-card-view { display: block !important; }
html.layout-pref-card .layout-list-view, body.layout-pref-card .layout-list-view { display: none !important; }

/* Styles for toggle buttons */
.layout-toggle-container {
    display: inline-flex;
    flex-shrink: 0;
    border: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    overflow: hidden;
    padding: 2px;
    background-color: var(--bs-tertiary-bg, rgba(255, 255, 255, 0.02));
}
.layout-toggle-container .btn {
    border: none;
    border-radius: 6px !important;
    color: var(--bs-secondary-color, #8a94a6);
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
}
.layout-toggle-container .btn:hover {
    color: var(--bs-primary, #0d6efd);
    background-color: var(--bs-secondary-bg, rgba(255, 255, 255, 0.05));
}
.layout-toggle-container .btn.active {
    background-color: var(--bs-primary, #0d6efd);
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

/* Breadcrumb responsive improvements */
#report-breadcrumb {
    flex: 1 1 auto;
    min-width: 0;
}
#report-breadcrumb ol {
    border-radius: 0px;
    flex-wrap: nowrap;
}
.breadcrumb-item {
    max-width: 80%;
}
.breadcrumb-item.active {
    max-width: 80%;
}
/* Dark theme surface polish */
:root {
    --bs-body-bg: #101418;
    --bs-body-color: #edf2f7;
    --bs-heading-color: #f8fafc;
    --bs-secondary-color: #aab4c0;
    --bs-tertiary-bg: #171d24;
    --bs-secondary-bg: #202833;
    --bs-card-bg: #171d24;
    --bs-border-color: #303a46;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.12);
    --app-page-bg: #0d1116;
    --app-surface: #171d24;
    --app-surface-muted: #1d2530;
    --app-surface-hover: #243042;
    --app-border: #303a46;
    --app-muted: #aab4c0;
    --app-link: #2ecc71;
}

html,
body {
    background-color: var(--app-page-bg);
    color: var(--bs-body-color);
}

a {
    color: var(--app-link);
}

a:hover,
a:focus {
    color: #5eff9c;
}

.app-main > .m-3:first-child,
.app-main > div:first-child:not(.layout-list-view):not(.layout-card-view) {
    margin-top: 0 !important;
}


.modern-table-responsive,
.modern-card,
.empty-state,
.layout-toggle-container,
.modal-content,
.form-control,
.form-select,
.form-check-input,
.list-group-item,
.card {
    background-color: var(--app-surface);
    border-color: var(--app-border);
    color: var(--bs-body-color);
}

.form-control,
.form-select {
    background-color: #111821;
}

.form-control::placeholder {
    color: #7f8a99;
}

.form-control:focus,
.form-select:focus {
    background-color: #111821;
    color: var(--bs-body-color);
    border-color: #5f8df7;
    box-shadow: 0 0 0 0.2rem rgba(95, 141, 247, 0.18);
}

.modern-table tbody tr {
    background-color: var(--app-surface-muted);
}

.modern-table tbody tr:hover {
    background-color: var(--app-surface-hover);
}

.modern-table td,
.modern-table th,
.modern-table th:first-child,
.modern-table td:first-child,
.modern-table th:last-child,
.modern-table td:last-child {
    border-color: var(--app-border);
}

.modern-card-desc,
.modern-card-footer,
.empty-state-desc,
.modern-table td.text-secondary,
.text-secondary {
    color: var(--app-muted) !important;
}

.stat-badge,
.layout-card-view .stat-badge {
    background-color: #263241 !important;
    color: #d7e0ea !important;
}

.breadcrumb,
.breadcrumb-item.active {
    color: var(--app-muted);
}

.pagination .page-link {
    background-color: var(--app-surface);
    border-color: var(--app-border);
    color: var(--bs-body-color);
}

.pagination .page-link:hover {
    background-color: var(--app-surface-hover);
}

/* Page composition */
.page-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.page-hero,
.content-section,
.search-panel,
.upload-panel,
.page-toolbar {
    background-color: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
}

.page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}


.page-title {
    color: var(--bs-heading-color);
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    line-height: 1.2;
    margin: 0;
}

.page-subtitle {
    color: var(--app-muted);
    margin: 0.3rem 0 0;
    max-width: 52rem;
    font-size: 0.92rem;
}

.page-actions,
.section-actions,
.category-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.content-section {
    padding: 1rem;
}

.section-header,
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.section-header {
    margin-bottom: 0.75rem;
}

.section-title {
    color: var(--bs-heading-color);
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 0;
}

.section-title a {
    font-size: 0.9rem;
    font-weight: 500;
}

.page-toolbar {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.category-description {
    overflow: hidden;
    display: block;
    color: var(--bs-body-color);
}

.category-description :last-child {
    margin-bottom: 0;
}

.category-description.collapsible-copy .collapsible-copy-inner {
    width: 100%;
}

.category-description.collapsible-copy.is-collapsed .collapsible-copy-inner::after {
    background: linear-gradient(to bottom, rgba(23, 29, 36, 0), var(--app-surface));
}

.category-desc-toggle {
    margin-top: 0.65rem;
}

.category-actions {
    margin-top: 0.9rem;
}

.search-panel,
.upload-panel {
    padding: 1rem;
}

.search-panel .form-control {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 2.75rem;
}

.search-panel .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 6.5rem;
    white-space: nowrap;
}

.upload-panel {
    margin: 1rem 0;
}

.upload-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.upload-panel-title {
    color: var(--bs-heading-color);
    font-size: 1rem;
    margin: 0;
}

.upload-panel-desc {
    color: var(--app-muted);
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
}

.btn-soft {
    color: var(--bs-body-color);
    background-color: #263241;
    border-color: #334255;
}

.btn-soft:hover,
.btn-soft:focus {
    color: #fff;
    background-color: #314156;
    border-color: #49617d;
}

.btn-danger-soft {
    color: #ffb4a9;
    background-color: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.35);
}

.btn-danger-soft:hover,
.btn-danger-soft:focus {
    color: #fff;
    background-color: rgba(220, 53, 69, 0.28);
    border-color: rgba(220, 53, 69, 0.55);
}

.search-form {
    align-items: stretch;
}

@media (max-width: 767.98px) {
    .page-hero {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem;
    }

    .page-actions,
    .page-actions .btn,
    .search-panel .btn {
        width: 100%;
    }

    .search-panel form {
        flex-direction: column;
    }

    .search-panel .form-control {
        margin-right: 0 !important;
    }
}

/* Report details */
.report-detail-page .page-toolbar {
    margin-bottom: 0;
}

.report-hero .page-actions {
    justify-content: flex-end;
}

.report-hero > div:first-child {
    min-width: 0;
}

.report-title-copy {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.report-hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.report-preview-section {
    padding: 0;
    overflow: hidden;
}

.report-preview-section > .section-header {
    padding: 1rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--app-border);
}

.report-tabs {
    gap: 0.35rem;
}

.report-tabs .nav-link {
    color: var(--app-muted);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
}

.report-tabs .nav-link:hover,
.report-tabs .nav-link:focus {
    color: #fff;
    background-color: #263241;
}

.report-tabs .nav-link.active {
    color: #fff;
    background-color: var(--bs-primary, #0d6efd);
}

.report-frame-shell {
    position: relative;
    height: min(72vh, 760px);
    min-height: 420px;
    background-color: #0b0f14;
    border-bottom: 1px solid var(--app-border);
}

.report-frame-shell iframe {
    width: 100%;
    height: 100%;
    display: none;
    border: 0;
    background-color: #fff;
}

.report-spinner {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.report-spinner .spinner-border {
    width: 4rem;
    height: 4rem;
}

.report-action-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background-color: var(--app-surface-muted);
}

.report-metric {
    min-width: 4.5rem;
}

.report-meta-stack {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

@media (min-width: 1100px) {
    .report-meta-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-description-panel {
        grid-column: 1 / -1;
    }
}

.metadata-panel {
    background-color: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 1rem;
}

.metadata-panel .section-header {
    margin-bottom: 0.75rem;
}

.report-description {
    color: var(--bs-body-color);
}

.report-description :last-child {
    margin-bottom: 0;
}

.collapsible-copy {
    min-width: 0;
}

.collapsible-copy-inner {
    overflow: hidden;
    transition: max-height 0.2s ease;
}

.collapsible-copy.is-collapsed .collapsible-copy-inner {
    position: relative;
    max-height: var(--collapsed-height, 8rem);
}

.collapsible-copy.is-collapsed .collapsible-copy-inner::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2.25rem;
    content: "";
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(20, 30, 41, 0), var(--app-surface-muted));
}

.collapsible-copy-toggle {
    margin-top: 0.55rem;
}


.metadata-grid dd.collapsible-copy {
    display: block;
}

.metadata-grid dd .collapsible-copy-toggle {
    padding: 0.2rem 0.55rem;
    font-size: 0.82rem;
}

.metadata-grid {
    display: grid;
    grid-template-columns: minmax(9rem, 0.38fr) minmax(0, 1fr);
    column-gap: 1rem;
    row-gap: 0;
    margin: 0.75rem 0 0;
}

.metadata-grid dt,
.metadata-grid dd {
    padding: 0.55rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.metadata-grid dt {
    color: var(--app-muted);
    font-weight: 600;
}

.metadata-grid dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .report-hero .page-actions,
    .report-hero .page-actions .btn {
        width: 100%;
    }

    .report-preview-section > .section-header {
        align-items: stretch;
    }

    .report-tabs {
        width: 100%;
    }

    .report-tabs .nav-item,
    .report-tabs .nav-link {
        flex: 1 1 0;
        text-align: center;
    }

    .report-frame-shell {
        height: 64vh;
        min-height: 340px;
    }

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

    .metadata-grid dt {
        padding-bottom: 0.15rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .metadata-grid dd {
        padding-top: 0;
        border-top: 0;
    }
}

/* Form pages */
.form-page {
    max-width: 1120px;
    margin: 0 auto;
}

.form-hero .page-actions {
    justify-content: flex-end;
}

.app-form {
    display: grid;
    gap: 1.25rem;
}

.form-section {
    display: grid;
    grid-template-columns: minmax(12rem, 0.34fr) minmax(0, 1fr);
    gap: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--app-border);
}

.form-section:last-of-type {
    padding-bottom: 0;
    border-bottom: 0;
}

.form-section-heading {
    min-width: 0;
}

.form-section-heading .section-title {
    margin-bottom: 0.35rem;
}

.section-subtitle {
    margin: 0;
    color: var(--app-muted);
    font-size: 0.92rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    min-width: 0;
}

.form-field {
    min-width: 0;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.form-label {
    color: var(--bs-body-color);
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.form-control,
.form-select {
    color: var(--bs-body-color);
    background-color: #111923;
    border-color: #334255;
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    color: #fff;
    background-color: #121d29;
    border-color: rgba(87, 166, 255, 0.85);
    box-shadow: 0 0 0 0.2rem rgba(87, 166, 255, 0.18);
}

.form-control::placeholder {
    color: rgba(226, 232, 240, 0.45);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    color: var(--app-muted);
    background-color: #182231;
    border-color: #2a384b;
}

.form-text {
    color: var(--app-muted);
}

.invalid-feedback {
    color: #ffb4a9;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #ff8f82;
    background-image: none;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.25rem;
}

@media (max-width: 991.98px) {
    .form-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .form-hero .page-actions,
    .form-hero .page-actions .btn,
    .form-actions,
    .form-actions .btn {
        width: 100%;
    }

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

    .form-actions {
        flex-direction: column-reverse;
    }
}

/* Reorder page */
.reorder-page {
    max-width: 1180px;
    margin: 0 auto;
}

.reorder-description {
    margin-top: 0.85rem;
    color: var(--bs-body-color);
}

.reorder-form {
    padding: 0;
    overflow: hidden;
}

.reorder-section-header {
    padding: 1rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--app-border);
}

.reorder-actions {
    padding-top: 0;
}

.reorder-table-shell {
    border: 0;
    border-radius: 0;
    padding: 0.5rem;
}

.reorder-row {
    cursor: grab;
}

.reorder-row:active {
    cursor: grabbing;
}

.reorder-handle-cell {
    width: 56px;
}

.reorder-handle {
    color: var(--app-muted);
    font-size: 1rem;
}

.reorder-row:hover .reorder-handle {
    color: #fff;
}

@media (max-width: 767.98px) {
    .reorder-section-header {
        align-items: stretch;
    }

    .reorder-actions,
    .reorder-actions .btn {
        width: 100%;
    }
}

/* Account and feedback pages */
.auth-page,
.profile-page,
.feedback-page {
    max-width: 980px;
    margin: 0 auto;
}

.auth-form {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}

.form-grid-single {
    grid-template-columns: 1fr;
}

.account-status .empty-state {
    padding-block: 1rem;
}

.auth-actions {
    align-items: center;
}

@media (max-width: 767.98px) {
    .auth-actions,
    .auth-actions .btn {
        width: 100%;
    }
}

/* Info and usage pages */
.info-page,
.usage-page {
    max-width: 1180px;
    margin: 0 auto;
}

.info-section p:last-child,
.info-list:last-child {
    margin-bottom: 0;
}

.info-steps {
    display: grid;
    gap: 0.75rem;
}

.info-step {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.info-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    color: #fff;
    background-color: var(--bs-primary, #0d6efd);
    font-weight: 700;
}

.info-step p {
    margin: 0.35rem 0 0;
}

.info-grid,
.usage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.info-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-panel {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background-color: var(--app-surface-muted);
}

.info-panel > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    color: var(--bs-primary, #0d6efd);
    margin: 0 0.5rem 0.55rem 0;
    vertical-align: -0.12em;
}

.info-panel h3,
.usage-unavailable h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.info-panel h3 {
    display: inline;
    margin-bottom: 0;
}

.info-panel p,
.usage-note,
.usage-unavailable p {
    color: var(--app-muted);
    margin-bottom: 0;
}

.info-panel p {
    margin-top: 0.35rem;
}

.donate-panel {
    display: block;
}

.donate-panel p {
    margin-bottom: 0;
}

.donate-qr {
    display: block;
    margin-top: 0.75rem;
    width: min(100%, 12rem);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background-color: #fff;
    padding: 0.35rem;
}

.info-list {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 0;
}

.usage-card {
    display: grid;
    gap: 1rem;
}

.usage-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.usage-card-header > div {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.usage-card-header i {
    color: var(--bs-primary, #0d6efd);
}

.usage-progress {
    height: 1.6rem;
    overflow: hidden;
    border-radius: 999px;
    background-color: #111923;
    border: 1px solid var(--app-border);
}

.usage-progress .progress-bar {
    height: 100%;
    min-width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.usage-metrics {
    display: grid;
    grid-template-columns: minmax(7rem, 0.5fr) minmax(0, 1fr);
    gap: 0;
    margin: 0;
}

.usage-metrics dt,
.usage-metrics dd {
    padding: 0.55rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.usage-metrics dt {
    color: var(--app-muted);
    font-weight: 600;
}

.usage-metrics dd {
    margin: 0;
    text-align: right;
    font-weight: 700;
}

.usage-unavailable {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
    text-align: center;
}

.usage-unavailable > i {
    color: #ffd166;
    font-size: 2rem;
}

.usage-ok {
    color: #b7f7cf;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(34, 160, 97, 0.35);
    border-radius: 8px;
    background-color: rgba(34, 160, 97, 0.12);
}

@media (max-width: 991.98px) {
    .info-grid,
    .info-grid.compact,
    .usage-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767.98px) {
    .info-grid,
    .info-grid.compact,
    .usage-grid {
        grid-template-columns: 1fr;
    }

    .usage-card-header {
        flex-direction: column;
    }
}

/* System Stats styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}

.stats-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    border: 1px solid var(--app-border, #2c3340);
    border-radius: 8px;
    background-color: var(--app-surface-muted, #1b222d);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    border-color: var(--bs-primary, #0d6efd);
}

.stats-card-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.03);
}

.stats-card-content {
    min-width: 0;
    width: 100%;
}

.stats-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--app-text-bright, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-label {
    font-size: 0.85rem;
    color: var(--app-muted, #767b8b);
    margin-top: 0.25rem;
}

@media (max-width: 1199.98px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 479.98px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

