.tb-page {
    position: relative;
    isolation: isolate;
}

.tb-page::before {
    content: "";
    position: fixed;
    right: -8rem;
    top: 4rem;
    width: min(34vw, 28rem);
    aspect-ratio: 1;
    pointer-events: none;
    background: url('/brand/icon-fingerprint-teal.png') center / contain no-repeat;
    opacity: 0.025;
    z-index: -1;
}

.tb-page-hero,
.tb-surface-card {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 252, 0.94)),
        var(--tb-color-surface);
    border: 1px solid rgba(203, 213, 225, 0.58);
    border-radius: var(--tb-radius-xl);
    box-shadow: var(--tb-shadow-surface);
}

.tb-page-hero::before,
.tb-surface-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: var(--tb-grain);
    opacity: 0.035;
    mix-blend-mode: overlay;
}

.tb-page-hero > *,
.tb-surface-card > * {
    position: relative;
    z-index: 1;
}

.tb-page-hero {
    padding: clamp(1.8rem, 2.4vw, 2.6rem);
}

.tb-page-hero-row {
    gap: 2rem;
}

.tb-page-eyebrow {
    color: var(--tb-color-primary-deep);
}

.tb-page-subtitle,
.tb-muted,
.tb-card-copy {
    color: var(--tb-color-muted);
}

.tb-page-hero-icon {
    width: 4.25rem;
    height: 4.25rem;
    flex: 0 0 auto;
    padding: 1rem;
    color: var(--tb-color-primary-deep);
    background: rgba(212, 245, 238, 0.62);
    border-radius: 24px;
}

.tb-section-title {
    color: var(--tb-color-ink);
}

.tb-section-mark,
.tb-report-icon,
.tb-table-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--tb-color-primary-deep);
    background: rgba(212, 245, 238, 0.62);
}

.tb-section-mark {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 15px;
}

.tb-report-card {
    height: 100%;
}

.tb-report-card .mud-card-content {
    height: 100%;
    padding: 1.35rem;
}

.tb-report-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 18px;
}

.tb-pill-action.mud-button-root {
    align-self: flex-start;
    border-radius: var(--tb-radius-pill);
    text-transform: none;
    font-weight: 700;
}

.tb-filter-card .mud-card-content,
.tb-table-card .mud-card-content {
    padding: 1.25rem;
}

.tb-table-card {
    border-radius: var(--tb-radius-lg);
}

.tb-table-card .mud-table {
    background: transparent;
}

.tb-table-card .mud-table-head .mud-table-cell {
    color: var(--tb-color-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tb-summary-tile {
    height: 100%;
    border: 1px solid var(--tb-color-divider, #E8E8E8);
    border-radius: 14px;
}

.tb-modal-card {
    width: min(100%, 44rem);
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    border-radius: var(--tb-radius-lg);
}

.tb-modal-card-wide {
    width: min(100%, 72rem);
}

.tb-modal-card .mud-card-content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1.35rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.tb-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1501;
    display: grid;
    place-items: center;
    padding: 2rem;
    background: rgba(9, 9, 9, 0.48);
    overflow: auto;
    overscroll-behavior: contain;
}

.tb-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.tb-form-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tb-form-span {
    grid-column: 1 / -1;
}

.tb-actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.tb-danger-text {
    color: var(--tb-color-error);
}

.tb-out-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 3rem;
    background:
        radial-gradient(circle at 92% 8%, rgba(85, 195, 182, 0.16), transparent 26rem),
        linear-gradient(180deg, #ffffff, var(--tb-color-canvas-warm));
}

.tb-out-content {
    width: min(100%, 58rem);
}

.tb-app-bar.mud-appbar {
    height: 64px;
    padding-inline: 2.4rem;
    color: var(--tb-color-ink);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(133, 153, 150, 0.18);
    box-shadow: none;
    backdrop-filter: blur(18px);
}

.tb-user-actions {
    min-height: 48px;
}

.tb-user-button {
    color: var(--tb-color-ink);
    font-weight: 600;
    text-transform: none;
}

.tb-logout-button {
    min-height: 2.55rem;
    padding-inline: 1.2rem;
    color: var(--tb-color-ink);
    border-color: rgba(31, 31, 31, 0.32);
    border-radius: var(--tb-radius-pill);
    font-weight: 600;
    text-transform: none;
}

.tb-logout-button:hover {
    color: var(--tb-color-primary-deep);
    border-color: rgba(85, 195, 182, 0.52);
    background: rgba(212, 245, 238, 0.26);
}

.tb-main-drawer.mud-drawer {
    color: #e6efed;
    background: #161b1a;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
    overflow-x: hidden;
}

.tb-main-drawer .mud-drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-x: hidden;
}

.tb-drawer-header {
    min-height: 72px;
    padding: 0 1rem 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    justify-content: space-between;
    gap: 0.75rem;
}

.tb-brand-lockup {
    min-width: 0;
}

.tb-drawer-toggle {
    width: 32px;
    height: 32px;
    color: rgba(230, 239, 237, 0.7);
    border: none;
    background: transparent;
}

.tb-drawer-toggle:hover {
    color: #8ed2c5;
    background: rgba(255, 255, 255, 0.05);
}

.tb-main-drawer.mud-drawer--closed .tb-brand-copy {
    width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.tb-main-drawer.mud-drawer--closed .tb-drawer-header {
    padding-inline: 1.18rem;
}

.tb-main-content.mud-main-content {
    min-height: 100vh;
    padding-top: 64px;
    background: var(--tb-color-canvas-warm);
}

.tb-content-container {
    width: 100%;
    max-width: none;
    padding: 3rem 3.25rem 4rem;
}

@media (min-width: 1500px) {
    .tb-content-container {
        padding-inline: 4rem;
    }
}

.tb-nav-menu {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.tb-nav-menu::-webkit-scrollbar {
    width: 6px;
}

.tb-nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}

.tb-nav-menu .mud-nav-link {
    min-height: 40px;
    margin: 1px 0;
    padding-inline: 0.75rem;
    border-radius: 8px;
    color: rgba(230, 239, 237, 0.72);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    text-transform: none;
    transition: background 0.12s ease, color 0.12s ease;
}

.tb-nav-menu .mud-nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.tb-nav-menu .mud-nav-link.active,
.tb-nav-menu .mud-nav-link.mud-nav-link-active {
    color: #ffffff;
    background: rgba(142, 210, 197, 0.14);
    font-weight: 600;
}

.tb-nav-menu .mud-nav-link-icon {
    color: currentColor;
    opacity: 0.85;
}

.tb-nav-menu .mud-nav-link-expand-icon {
    color: rgba(230, 239, 237, 0.45);
    opacity: 1;
}

.tb-nav-menu .mud-nav-link-text {
    letter-spacing: 0;
}

.tb-nav-menu .mud-nav-group > .mud-nav-link {
    min-height: 32px;
    margin-top: 0.85rem;
    margin-bottom: 0.15rem;
    padding-inline: 0.85rem;
    color: rgba(230, 239, 237, 0.42);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: transparent !important;
    border-radius: 0;
}

.tb-nav-menu .mud-nav-group > .mud-nav-link:hover {
    color: rgba(230, 239, 237, 0.65);
    background: transparent !important;
}

.tb-nav-menu .mud-nav-group > .mud-nav-link .mud-nav-link-icon {
    font-size: 1rem;
    opacity: 0.55;
}

.tb-nav-menu .mud-nav-group .mud-navmenu {
    margin: 0;
    padding-left: 0;
    border-left: none;
}

.tb-nav-menu .mud-nav-group .mud-navmenu .mud-nav-link {
    min-height: 36px;
    color: rgba(230, 239, 237, 0.72);
    font-size: 0.875rem;
    font-weight: 500;
}

.tb-nav-divider {
    margin: auto 0.5rem 0.85rem;
    border-color: rgba(255, 255, 255, 0.06);
}

.tb-nav-user {
    min-height: 44px;
    margin: 0 0.25rem;
    padding: 0.55rem 0.65rem;
    color: rgba(230, 239, 237, 0.68);
    background: transparent;
    border: none;
    border-radius: 8px;
}

.tb-nav-user-icon {
    color: rgba(230, 239, 237, 0.55);
    flex: 0 0 auto;
}

.mud-drawer--closed .tb-nav-menu {
    padding-inline: 0.55rem;
}

.mud-drawer--closed .tb-nav-menu .mud-nav-link {
    justify-content: center;
    padding-inline: 0;
}

.mud-drawer--closed .tb-nav-menu .mud-nav-group > .mud-nav-link {
    display: none;
}

.mud-drawer--closed .tb-nav-menu .mud-nav-group .mud-navmenu {
    display: none;
}

.mud-drawer--closed .tb-nav-user {
    justify-content: center;
    padding-inline: 0;
}

.mud-drawer--closed .tb-nav-user-text {
    width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ============================================================================
   Pricing tooltip content
   MudTooltip teleports TooltipContent through MudPopoverProvider to the layout
   root, so component-scoped .razor.css can never reach it. These rules are
   class-namespaced (pricing-*) globals applied via Class= inside TooltipContent
   in IngredientPricingWorkbenchPanel.razor.
   ========================================================================== */

.pricing-math-tooltip {
    max-width: 32rem;
    text-align: left;
    white-space: normal;
}
