html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(214, 233, 255, 0.9), transparent 35%),
        radial-gradient(circle at bottom right, rgba(255, 227, 205, 0.5), transparent 30%),
        linear-gradient(180deg, #f5f7fb 0%, #eef2f8 100%);
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Move bottom section inside nav-scrollable for mobile */
.nav-bottom-section {
    position: static;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--bs-dark);
    padding: 0.5rem 0;
}

/* Desktop: make it fixed at bottom */
@media (min-width: 641px) {
    .nav-bottom-section {
        position: static;
        margin-top: 0;
    }
}

.user-menu-checkbox {
    display: none;
}

.user-info-container {
    padding: 0 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
    color: #e0e0e0;
}

.user-info:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-email {
    font-weight: 500;
    color: #f0f0f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    font-size: 0.75rem;
    color: #b0b0b0;
    margin-top: 0.125rem;
}

.chevron-icon {
    transition: transform 0.2s;
    color: #e0e0e0;
}

/* Rotate chevron when menu is open */
.user-menu-checkbox:checked ~ .user-info-container .chevron-icon {
    transform: rotate(180deg);
}

.user-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0;
}

/* Show menu when checkbox is checked */
.user-menu-checkbox:checked ~ .user-info-container .user-menu {
    max-height: 200px;
    padding-top: 0.5rem;
}

.user-menu .nav-link {
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    color: #e0e0e0;
}

.user-menu .nav-link:hover {
    color: #ffffff;
}

.user-menu .nav-link span {
    color: #b0b0b0;
}

.user-menu form {
    margin: 0;
}

.user-menu button.nav-link {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
}

.user-menu button.nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-login {
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    color: #f0f0f0;
}

.btn-login:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.btn-login span {
    color: #e0e0e0;
}

/* Mobile nav sizing is handled in NavMenu.razor.css */
@media (max-width: 640px) {
    .nav-scrollable nav {
        flex: 1;
    }
}

/* Fix Bootstrap Icons alignment */
.nav-link span[class*="bi-"],
.user-info span[class*="bi-"] {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
    margin-right: 0.5rem;
}

.user-menu .nav-link span[class*="bi-"] {
    margin-right: 0.5rem;
}

/* Fix SVG icon alignment */
.nav-link svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.chart-card {
    height: 100%;
    border-radius: 0.75rem;
    background: var(--bs-card-bg, #fff);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

@media (max-width: 767.98px) {
    .container,
    .container-fluid {
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
    }

    .row {
        --bs-gutter-x: 0.75rem;
    }

    .btn {
        min-height: 2.55rem;
    }

    .form-control,
    .form-select {
        min-height: 2.7rem;
        font-size: 0.95rem;
    }

    .table-responsive {
        border-radius: 0.8rem;
    }

    .card {
        border-radius: 0.95rem;
    }

    .modal,
    .modal-dialog {
        margin: 0.25rem;
    }
}

@media (max-width: 575.98px) {
    .card,
    .table-responsive {
        border-radius: 0.78rem !important;
    }

    .portfolio-shell .card-body,
    .users-shell .card-body,
    .catalog-shell .card-body,
    .objectives-shell .card-body,
    .details-shell .card-body,
    .insights-shell .card-body,
    .home-shell .card-body {
        padding: 0.8rem !important;
    }

    .portfolio-panel,
    .admin-panel,
    .catalog-panel,
    .objectives-panel,
    .details-panel,
    .insight-card,
    .hero-panel {
        border-radius: 0.82rem !important;
    }

    .portfolio-modal-backdrop,
    .catalog-modal-backdrop,
    .objectives-modal-backdrop {
        padding: 0.35rem !important;
    }

    .portfolio-modal,
    .catalog-modal,
    .objectives-modal {
        width: 100% !important;
        max-height: calc(100vh - 0.7rem) !important;
        border-radius: 0.82rem !important;
    }
}

/* Global design system */
:root {
    --app-primary: #0f4c81;
    --app-primary-hover: #0c3f6b;
    --app-primary-soft: rgba(15, 76, 129, 0.1);
    --app-secondary: #1f3a63;
    --app-secondary-hover: #162b4b;
    --app-secondary-soft: rgba(31, 58, 99, 0.1);
    --app-accent: #f59e0b;
    --app-accent-hover: #d97706;
    --app-accent-soft: rgba(245, 158, 11, 0.13);

    --app-surface: rgba(255, 255, 255, 0.96);
    --app-surface-muted: rgba(248, 250, 252, 0.95);
    --app-border: rgba(226, 232, 240, 0.95);
    --app-text: #0f172a;
    --app-text-muted: #64748b;

    --app-radius-lg: 1.25rem;
    --app-radius-md: 0.95rem;
    --app-radius-sm: 0.72rem;
    --app-shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.07);
    --app-shadow-strong: 0 20px 44px rgba(15, 23, 42, 0.1);
    --app-focus-ring: 0 0 0 0.12rem #fff, 0 0 0 0.26rem rgba(15, 76, 129, 0.32);

    --table-border: var(--app-border);
    --table-header-bg: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.98));
    --table-row-hover: rgba(239, 246, 255, 0.72);
    --table-row-alt: rgba(248, 250, 252, 0.55);
    --table-head-text: #475569;
    --table-cell-text: var(--app-text);
}

a, .btn-link, .sort-link:hover {
    color: var(--app-primary);
}

.btn {
    border-radius: 0.78rem;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--app-primary), var(--app-secondary));
    border-color: var(--app-secondary);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--app-primary-hover), var(--app-secondary-hover));
    border-color: var(--app-secondary-hover);
    color: #fff;
}

.btn-outline-secondary {
    border-color: rgba(100, 116, 139, 0.35);
    color: #334155;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--app-secondary-soft);
    border-color: rgba(31, 58, 99, 0.45);
    color: var(--app-secondary);
}

.btn-dark {
    background: linear-gradient(135deg, var(--app-secondary), #172a46);
    border-color: #172a46;
}

.btn-dark:hover,
.btn-dark:focus {
    background: linear-gradient(135deg, var(--app-secondary-hover), #111f35);
    border-color: #111f35;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-color: #991b1b;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: var(--app-focus-ring) !important;
    border-color: rgba(15, 76, 129, 0.55);
}

.card,
.portfolio-panel,
.admin-panel,
.catalog-panel,
.objectives-panel,
.insights-panel,
.dashboard-panel {
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-soft);
}

.admin-eyebrow,
.portfolio-eyebrow,
.objectives-eyebrow,
.insights-eyebrow,
.dashboard-eyebrow {
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.table-responsive {
    border: 1px solid var(--table-border);
    border-radius: 1rem;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-soft);
    overflow-x: auto;
    overflow-y: visible !important;
    position: relative;
}

.admin-table-shell.table-responsive,
.catalog-table-shell.table-responsive,
.objectives-table-shell.table-responsive,
.portfolio-table-wrap.table-responsive {
    overflow: visible !important;
}

.table {
    margin-bottom: 0;
    color: var(--table-cell-text);
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    border-color: var(--table-border);
    padding: 0.78rem 0.85rem;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--table-header-bg);
    color: var(--table-head-text);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody tr:nth-child(even) {
    background: var(--table-row-alt);
}

.table tbody tr:hover {
    background: var(--table-row-hover);
}

.table td .btn.btn-sm {
    min-height: 2rem;
    border-radius: 0.7rem;
}

.app-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    white-space: nowrap;
    border-bottom-width: 1px;
}

.app-table tbody tr {
    border-color: rgba(226, 232, 240, 0.9);
}

.app-table tbody tr:hover {
    background: rgba(248, 250, 252, 0.88);
}

.app-table td {
    vertical-align: middle;
    position: relative;
    overflow: visible;
}

.app-action-group {
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
}

.app-action-group:has(.app-action-menu) {
    z-index: 90;
}

.portfolio-panel,
.admin-panel,
.catalog-panel,
.objectives-panel,
.proposals-panel,
.insights-panel,
.dashboard-panel {
    position: relative;
    overflow: visible !important;
}

.portfolio-panel .card-body,
.admin-panel .card-body,
.catalog-panel .card-body,
.objectives-panel .card-body,
.proposals-panel .card-body,
.insights-panel .card-body,
.dashboard-panel .card-body {
    overflow: visible !important;
}

.menu-open {
    position: relative;
    z-index: 220 !important;
    isolation: isolate;
}

.portfolio-panel:has(.portfolio-action-menu),
.admin-panel:has(.app-action-menu),
.catalog-panel:has(.app-action-menu),
.objectives-panel:has(.objectives-action-menu),
.proposals-panel:has(.app-action-menu),
.insights-panel:has(.app-action-menu),
.dashboard-panel:has(.app-action-menu) {
    z-index: 120;
}

.app-action-trigger {
    min-width: 96px;
    border-radius: 999px;
}

.app-action-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 999;
    min-width: 170px;
    padding: 0.4rem;
    border: 1px solid #dbe3ee;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 38px rgba(15, 23, 42, 0.14);
}

.app-table tbody tr:nth-last-child(-n + 4) .app-action-menu {
    top: auto;
    bottom: calc(100% + 0.4rem);
}

.app-action-menu .dropdown-item {
    border-radius: 0.8rem;
    padding: 0.65rem 0.8rem;
}

.app-action-menu .dropdown-item:hover {
    background: #f8fbff;
}

.search-spotlight-backdrop,
.portfolio-modal-backdrop,
.catalog-modal-backdrop,
.objectives-modal-backdrop,
.notifications-modal-backdrop {
    z-index: 50000 !important;
}

.search-spotlight-panel,
.portfolio-modal,
.catalog-modal,
.objectives-modal,
.notifications-modal {
    z-index: 50010 !important;
}

body.spotlight-open .app-topbar-actions {
    visibility: hidden !important;
    pointer-events: none !important;
}

body.spotlight-open .notification-bell-root {
    visibility: hidden !important;
}

body.spotlight-open .app-topbar {
    z-index: 50020 !important;
}

.search-spotlight-body,
.portfolio-modal,
.catalog-modal,
.objectives-modal,
.notifications-modal {
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}

.search-spotlight-body::-webkit-scrollbar,
.portfolio-modal::-webkit-scrollbar,
.catalog-modal::-webkit-scrollbar,
.objectives-modal::-webkit-scrollbar,
.notifications-modal::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.search-spotlight-body::after,
.portfolio-modal::after,
.catalog-modal::after,
.objectives-modal::after,
.notifications-modal::after {
    content: "";
    position: sticky;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    height: 16px;
    margin-top: -16px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(15, 23, 42, 0.18));
}

/* Unified filter panels */
.catalog-filters-body,
.portfolio-filters-body,
.objectives-filters-body,
.insights-filters-body,
.users-filters-body,
.manage-notifications-page .card .row.g-3 {
    border-top-color: var(--app-border) !important;
}

.catalog-collapse-btn,
.portfolio-collapse-btn,
.objectives-collapse-btn,
.insights-collapse-btn,
.users-collapse-btn {
    min-width: 118px;
    border-radius: 999px;
}

.catalog-filters .form-control,
.catalog-filters .form-select,
.portfolio-filters-body .form-control,
.portfolio-filters-body .form-select,
.objectives-filters-body .form-control,
.objectives-filters-body .form-select,
.insights-filters-body .form-control,
.insights-filters-body .form-select,
.users-filters-body .form-control,
.users-filters-body .form-select,
.manage-notifications-page .row.g-3 .form-control,
.manage-notifications-page .row.g-3 .form-select {
    min-height: 2.82rem;
    border-radius: var(--app-radius-md);
    border-color: rgba(203, 213, 225, 0.9);
    background: var(--app-surface-muted);
}

.sort-link {
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    white-space: nowrap;
    font-weight: 700;
}

@media (min-width: 641px) {
    body.app-sidebar-collapsed .sidebar {
        width: 84px !important;
    }

    body.app-sidebar-collapsed .sidebar .brand-copy,
    body.app-sidebar-collapsed .sidebar .user-details,
    body.app-sidebar-collapsed .sidebar .chevron-icon,
    body.app-sidebar-collapsed .sidebar .nav-label {
        display: none !important;
    }

    body.app-sidebar-collapsed .sidebar .top-row-content {
        justify-content: center;
        padding-right: 0;
    }

    body.app-sidebar-collapsed .sidebar .navbar-brand {
        justify-content: center;
        margin-right: 0;
        flex: 0 0 auto;
    }

    body.app-sidebar-collapsed .sidebar .nav-item {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.app-sidebar-collapsed .sidebar .nav-item .nav-link,
    body.app-sidebar-collapsed .sidebar .nav-item a.nav-link {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    body.app-sidebar-collapsed .sidebar .bi,
    body.app-sidebar-collapsed .sidebar .bi-bell-menu-inline {
        margin-right: 0;
    }

    body.app-sidebar-collapsed .sidebar .user-info {
        justify-content: center;
        padding-inline: 0.4rem;
    }

    body.app-sidebar-collapsed .sidebar .user-info-container {
        padding-inline: 0.35rem;
    }

    body.app-sidebar-collapsed .sidebar .user-menu {
        display: none !important;
    }

    body.app-sidebar-collapsed .sidebar .sidebar-collapse-wrap {
        padding: 0.55rem 0.35rem 0.12rem;
        margin-top: 0.35rem;
    }

    body.app-sidebar-collapsed .sidebar .sidebar-collapse-btn {
        min-height: 2.35rem;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    body.mobile-nav-open .app-topbar {
        display: none !important;
    }

    .table > :not(caption) > * > * {
        padding: 0.65rem 0.62rem;
        font-size: 0.86rem;
    }

    .table thead th {
        font-size: 0.68rem;
        letter-spacing: 0.04em;
    }

    .app-table th,
    .app-table td {
        font-size: 0.84rem;
    }

    .app-action-group {
        width: auto;
    }

    .app-action-trigger {
        width: auto;
        min-width: 92px;
    }

    .app-action-menu {
        position: static;
        width: min(240px, 100%);
        margin-top: 0.5rem;
    }

    /* Convert all app tables to card-list on mobile */
    .table-responsive:has(.app-table) {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .app-table {
        border-collapse: separate;
        width: 100%;
    }

    .app-table thead {
        display: none;
    }

    .app-table tbody,
    .app-table tr,
    .app-table td {
        display: block;
        width: 100%;
    }

    .app-table tr {
        margin-bottom: 0.72rem;
        border: 1px solid rgba(226, 232, 240, 0.92);
        border-radius: 0.9rem;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
        overflow: hidden;
    }

    .app-table td {
        border: 0 !important;
        border-bottom: 1px solid rgba(226, 232, 240, 0.85) !important;
        padding: 0.62rem 0.72rem !important;
        white-space: normal !important;
        text-align: left !important;
    }

    .app-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.22rem;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #64748b;
    }

    .app-table td:last-child {
        border-bottom: 0 !important;
    }

    .app-table .thumb-xs,
    .app-table .home-thumb,
    .app-table .table-img {
        width: 52px !important;
        height: 72px !important;
        object-fit: cover;
        border-radius: 0.55rem;
    }

    .app-table td .btn:not(.app-action-trigger) {
        width: 100%;
    }

    .app-table td .app-action-group {
        width: auto;
        display: inline-flex;
    }

    .app-table td .app-action-trigger {
        width: auto;
        min-width: 84px;
    }
}

.chart-body {
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lang-flag-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.lang-flag {
    border-radius: 0.2rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    object-fit: cover;
    display: inline-block;
}

.lang-flag-code {
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.03em;
}

.table-body {
    display: flex;
    justify-content: center;
    min-height: 300px;
}

.chart-spinner {
    width: 3rem;
    height: 3rem;
}

.auth-shell {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 4rem);
    padding: clamp(1.25rem, 4vw, 3rem) 1rem;
    overflow: hidden;
}

.auth-shell::before,
.auth-shell::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(18px);
    pointer-events: none;
}

.auth-shell::before {
    width: 22rem;
    height: 22rem;
    top: -7rem;
    left: -6rem;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0));
}

.auth-shell::after {
    width: 18rem;
    height: 18rem;
    right: -4rem;
    bottom: -4rem;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.18), rgba(249, 115, 22, 0));
}

.auth-card {
    position: relative;
    width: min(720px, 100%);
    padding: clamp(1.25rem, 3vw, 2.2rem);
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 1.5rem;
    background:
        radial-gradient(circle at top right, rgba(125, 211, 252, 0.16), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.94));
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
}

.auth-card-form {
    max-width: 640px;
}

.auth-card-compact {
    max-width: 520px;
}

.auth-card-message {
    max-width: 760px;
}

.auth-card-danger {
    border-color: rgba(248, 113, 113, 0.32);
    background:
        radial-gradient(circle at top right, rgba(254, 202, 202, 0.22), transparent 24%),
        linear-gradient(180deg, rgba(255, 252, 252, 0.98), rgba(248, 250, 252, 0.96));
}

.auth-card::before {
    content: "TCG Price Tracker";
    display: inline-flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-brand-mark {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    margin-bottom: 1.1rem;
}

.auth-brand-logo {
    width: 3.5rem;
    height: 3.5rem;
    object-fit: contain;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
    padding: 0.35rem;
}

.auth-brand-copy {
    display: flex;
    flex-direction: column;
}

.auth-brand-name {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-brand-tagline {
    font-size: 0.85rem;
    color: #64748b;
}

.auth-kicker {
    margin-bottom: 0.45rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #0f766e;
}

.auth-subtitle {
    margin-bottom: 1.25rem;
    color: #64748b;
    line-height: 1.65;
}

.auth-section-title {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #0f172a;
}

.auth-card .form-control,
.auth-card .form-select {
    border-radius: 1rem;
    border-color: #dbe3ee;
    background: rgba(248, 250, 252, 0.95);
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.12);
}

.auth-card .btn-primary {
    min-height: 3rem;
    border-radius: 999px;
    font-weight: 700;
    background: linear-gradient(135deg, #111827, #1f3f75);
    border-color: #1f3f75;
    box-shadow: 0 14px 28px rgba(31, 63, 117, 0.18);
}

.auth-card a {
    color: #0f4c81;
    font-weight: 600;
    text-decoration: none;
}

.auth-card a:hover {
    text-decoration: underline;
}

.auth-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

@media (max-width: 640px) {
    .auth-shell {
        min-height: auto;
        padding: 1rem 0.75rem 1.5rem;
    }

    .auth-card {
        padding: 1.25rem;
        border-radius: 1.2rem;
    }

    .auth-actions {
        flex-direction: column;
    }

    .auth-brand-mark {
        align-items: flex-start;
    }

    .auth-brand-logo {
        width: 3rem;
        height: 3rem;
    }
}

.chart-canvas {
    width: 100%;
    height: 100%;
}

.stat-card {
    border-radius: 0.75rem;
    background: var(--bs-card-bg, #fff);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stretched {
    align-items: stretch;
}

.dynamic-table .table-img {
    transition: transform 0.2s ease-in-out;
    cursor: zoom-in;
}

.dynamic-table .table-img:hover {
    transform: scale(10);
    z-index: 999;
    position: relative;
}

.table-card {
    border-radius: 0.75rem;
    background: var(--bs-card-bg, #fff);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.table {
    color: inherit;
}

.table > :not(caption) > * > * {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.15);
}

.title-sub-container .title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #222;
}

.title-sub-container .subtitle {
    font-size: 0.75rem; /* più piccolo */
    font-weight: 400; /* più leggero */
    color: #6c757d; /* grigio elegante */
    font-family: "Segoe UI", sans-serif; /* font diverso */
    margin-top: 2px;
    display: block;
}

.flag-icon {
    width: 20px;
    height: 14px;
    margin-right: 6px;
    vertical-align: middle;
}
