/* =====================================================================================
   TindahanMate theme
   The look comes from the sari-sari storefront: a painted green wall, a marigold awning,
   red ballpen ink for utang. The awning is the one memorable thing; everything else stays quiet.
   "Fresh Filipino Sari-Sari": warm cream wall, store green, marigold awning.
   Colour tokens mirror Layout/AppTheme.cs. MudBlazor's own variables (--mud-palette-*) are used
   where a component already has one.
   ===================================================================================== */

:root {
    --tm-green: #176B2C;
    --tm-green-deep: #164D28;
    --tm-green-tint: #E5F0E2;
    --tm-marigold: #F9A825;
    --tm-mango: #FFD166;
    --tm-marigold-ink: #2B1F00;
    --tm-ledger-red: #B3261E;
    --tm-paper: #FFF9EE;
    --tm-card: #FFFFFF;
    --tm-line: #D8D8D0;
    --tm-disabled: #E1E1DE;
    --tm-ink: #263238;
    --tm-ink-soft: #6B7280;
    --tm-focus: #0B57D0;

    --tm-shadow-card: 0 8px 24px rgba(22, 77, 40, 0.10);
    --tm-shadow-soft: 0 2px 8px rgba(22, 77, 40, 0.07);

    /* Nunito Sans first; Plus Jakarta Sans and Inter follow, and cover any glyph Nunito Sans lacks (the peso sign). */
    --tm-font-body: "Nunito Sans", "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --tm-font-display: var(--tm-font-body);

    /* Height of the phone bottom navigation (see .tm-nav). Pages that pin something above it use this. */
    --tm-nav-h: 64px;
}

/* No white flash before MudBlazor paints its own background. */
html {
    background: var(--tm-paper);
}

/* MudBlazor writes its font list into :root variables at run time; html:root outranks that. */
html:root {
    --mud-typography-default-family: var(--tm-font-body);
    --mud-typography-body1-family: var(--tm-font-body);
    --mud-typography-body2-family: var(--tm-font-body);
    --mud-typography-subtitle1-family: var(--tm-font-body);
    --mud-typography-subtitle2-family: var(--tm-font-body);
    --mud-typography-button-family: var(--tm-font-body);
    --mud-typography-caption-family: var(--tm-font-body);
    --mud-typography-overline-family: var(--tm-font-body);
    --mud-typography-h1-family: var(--tm-font-display);
    --mud-typography-h2-family: var(--tm-font-display);
    --mud-typography-h3-family: var(--tm-font-display);
    --mud-typography-h4-family: var(--tm-font-display);
    --mud-typography-h5-family: var(--tm-font-display);
    --mud-typography-h6-family: var(--tm-font-display);
    --mud-typography-button-text-transform: none;
}

body {
    font-family: var(--tm-font-body);
    /* Prices and balances line up in columns. */
    font-variant-numeric: tabular-nums;
    -webkit-text-size-adjust: 100%;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--tm-ink);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--mud-palette-success);
}

.invalid {
    outline: 1px solid var(--mud-palette-error);
}

.validation-message {
    color: var(--mud-palette-error);
}

#blazor-error-ui {
    color-scheme: light only;
    background: #FFF1CC;
    color: #2B1F00;
    border-top: 3px solid #F9A825;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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;
    }

.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."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #E8E2D2;
        stroke-width: 0.6rem;
        stroke-linecap: round;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #176B2C;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #164D28;
}

.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;
}


/* =====================================================================================
   Type
   Headings and money figures use the display face; body copy stays calm and a little larger
   than MudBlazor's default, because the app is read at arm's length over a counter.
   ===================================================================================== */

/* Direct rules as well as the variables above, so the face holds whichever way MudBlazor builds its font stack. */
.mud-typography, .mud-button-root, .mud-input, .mud-input-slot, .mud-tab, .mud-chip,
.mud-table-root, .mud-alert, .mud-snackbar, .mud-list-item {
    font-family: var(--tm-font-body);
}

.mud-typography-h1, .mud-typography-h2, .mud-typography-h3,
.mud-typography-h4, .mud-typography-h5, .mud-typography-h6 {
    font-family: var(--tm-font-display);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

/* Headings in page content take the dark forest green. Scoped to the main content so headings on the green
   bar, in dialogs and on coloured chips keep their own colour. */
.mud-main-content .mud-typography-h1, .mud-main-content .mud-typography-h2,
.mud-main-content .mud-typography-h3, .mud-main-content .mud-typography-h4,
.mud-main-content .mud-typography-h5, .mud-main-content .mud-typography-h6 {
    color: var(--tm-green-deep);
}

.mud-typography-subtitle1, .mud-typography-subtitle2 {
    font-family: var(--tm-font-body);
    font-weight: 600;
}

.mud-typography-body1 {
    line-height: 1.55;
}

.mud-typography-body2 {
    font-size: 0.9375rem;
    line-height: 1.5;
}

.mud-typography-caption {
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* Field labels and helper text: 13-14px. */
.mud-input-helper-text,
.mud-input-label-inputcontrol {
    font-size: 0.875rem;
}

/* Several pages use Color.Secondary for quiet captions. Secondary is marigold, which is unreadable
   as text (1.9:1 on white), so as text it becomes the muted ink. Marigold buttons are unaffected. */
.mud-secondary-text {
    color: var(--mud-palette-text-secondary) !important;
}

/* =====================================================================================
   Finishing for MudBlazor components (applies to every page)
   ===================================================================================== */

/* Cards: a hairline and a soft green-tinted shadow instead of floating Material shadows. */
.mud-elevation-1 {
    box-shadow: 0 0 0 1px var(--tm-line), 0 1px 3px rgba(22, 77, 40, 0.06);
}

.mud-elevation-2 {
    box-shadow: 0 0 0 1px var(--tm-line), var(--tm-shadow-soft);
}

/* Buttons: sentence case, flat, with a small press. */
.mud-button-root {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.mud-button-filled-primary:hover {
    background-color: var(--tm-green-deep);
}

.mud-button-filled.mud-disabled,
.mud-button-filled:disabled {
    background-color: var(--tm-disabled);
    color: var(--tm-ink-soft);
    box-shadow: none;
}

.mud-button-filled {
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.mud-button-filled:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: none;
}

.mud-tab {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}

/* Fields sit on white so they read as things to fill in against the paper background. */
.mud-input.mud-input-outlined {
    background: var(--mud-palette-surface);
}

.mud-chip-size-medium {
    min-height: 36px;
    font-weight: 600;
}

.mud-table-root .mud-table-head .mud-table-cell {
    background: var(--tm-green-tint);
    color: var(--tm-green-deep);
    font-weight: 700;
}

/* Keyboard and switch-access focus must be visible on every surface. */
:focus-visible {
    outline: 3px solid var(--tm-focus);
    outline-offset: 2px;
}

.tm-appbar :focus-visible,
.tm-login-top :focus-visible {
    outline-color: #FFE29A;
}

/* =====================================================================================
   Storefront chrome: app bar, awning, brand mark
   ===================================================================================== */

.tm-appbar.mud-appbar {
    /* A very light tonal step, green to a slightly deeper green; white text stays well above 4.5:1. */
    background: linear-gradient(180deg, var(--tm-green) 0%, #145F28 100%);
    color: #FFFFFF;
    overflow: visible;
}

.tm-appbar__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The awning: alternating marigold and green scallops hanging off the app bar (and off the sign-in wall).
   One definition for both. The 48px repeat is one orange and one green scallop, centred on an orange one so
   both screen edges match at any width; the pattern is fixed-size, so it never stretches on small phones. */
.tm-appbar:not(.tm-appbar--staff)::after,
.tm-login-wall::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 12px;
    pointer-events: none;
    background:
        radial-gradient(circle at 12px 0, var(--tm-marigold) 11.5px, transparent 12px),
        radial-gradient(circle at 36px 0, var(--tm-green) 11.5px, transparent 12px);
    background-size: 48px 12px;
    background-repeat: repeat-x;
    background-position: calc(50% + 12px) 0;
    filter: drop-shadow(0 2px 2px rgba(22, 77, 40, 0.18));
    transform-origin: top;
}

/* The one moment of motion: the awning rolls down when the app opens. */
.tm-appbar:not(.tm-appbar--staff)::after {
    animation: tm-awning-drop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes tm-awning-drop {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

/* Leave room under the app bar for the scallops. */
.tm-main::before {
    content: "";
    display: block;
    height: 12px;
}

.tm-brand-mark {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--tm-marigold);
    color: var(--tm-green-deep);
    box-shadow: 0 1px 3px rgba(22, 77, 40, 0.28);
}

.tm-brand-mark .mud-icon-root {
    font-size: 1.2rem;
}

.tm-brand-mark--lg {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    box-shadow: 0 2px 6px rgba(22, 77, 40, 0.22);
}

.tm-brand-mark--lg .mud-icon-root {
    font-size: 2.1rem;
}

/* Staff console: same family, no awning, a slate bar so nobody mistakes it for a store. */
.tm-appbar--staff.mud-appbar {
    background: #26323A;
    border-radius: 0 0 16px 16px;
}

/* Language toggle: compact pill on any green or slate bar, still a 44px target, white text. */
.tm-lang.mud-button-root {
    min-width: 64px;
    min-height: 44px;
    padding: 4px 14px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.tm-lang.mud-button-root:hover {
    background: rgba(255, 255, 255, 0.22);
}

.tm-lang.mud-button-root .mud-icon-root {
    font-size: 1.125rem;
}

/* Sync chip on the green bar: quiet when fine, loud only when the owner must act. */
.tm-appbar .tm-sync.mud-chip {
    background: rgba(255, 255, 255, 0.16);
    color: #FFFFFF;
}

.tm-appbar .tm-sync--offline.mud-chip {
    background: var(--tm-marigold);
    color: var(--tm-marigold-ink);
}

.tm-appbar .tm-sync--alert.mud-chip {
    background: #FFDAD6;
    color: #8C1D18;
}

/* =====================================================================================
   Phone bottom navigation
   ===================================================================================== */

.tm-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1300;
    box-sizing: border-box;
    display: flex;
    height: calc(var(--tm-nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--tm-line);
    box-shadow: 0 -4px 14px rgba(22, 77, 40, 0.07);
}

.tm-nav__item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    color: var(--tm-ink-soft);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.tm-nav__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 30px;
    border-radius: 15px;
    transition: background-color 0.15s ease;
}

.tm-nav__label {
    max-width: 100%;
    padding: 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.1;
}

.tm-nav__item.is-active {
    color: var(--tm-green-deep);
}

.tm-nav__item.is-active .tm-nav__icon {
    background: var(--tm-marigold);
}

.tm-nav__item.is-active .tm-nav__label {
    font-weight: 800;
}

/* =====================================================================================
   Sell screen (Home.razor)
   ===================================================================================== */

.tm-tile {
    position: relative;
    background: var(--mud-palette-surface);
    border: 1px solid var(--tm-line);
    border-radius: 14px;
    transition: border-color 0.12s ease, background-color 0.12s ease, transform 0.08s ease;
}

.tm-tile:active {
    transform: scale(0.98);
}

.tm-tile__name {
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.tm-price {
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* In the cart: the tile fills with green wash and a firmer edge. */
.tm-tile--in-cart {
    background: var(--tm-green-tint);
    border-color: var(--tm-green);
    box-shadow: inset 0 0 0 1px var(--tm-green);
}

.tm-tile--out {
    opacity: 0.72;
}

.tm-cartbar.mud-paper {
    border-top: 1px solid var(--tm-line);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -6px 16px rgba(22, 77, 40, 0.09);
}

/* =====================================================================================
   Sign-in screen: "Fresh Filipino Sari-Sari".
   The shop front: a green wall with a striped awning, and the sign-in card is the counter.

   Everything here is scoped to .tm-login, so the rest of the app keeps its own look. The --ss-* tokens
   are the whole palette; the --mud-* lines at the end of the block point MudBlazor's components at them.
   ===================================================================================== */

.tm-login {
    /* Palette */
    --ss-green: #176B2C;          /* header, primary buttons, links */
    --ss-forest: #164D28;         /* headings, important labels, button hover */
    --ss-orange: #F9A825;         /* logo, awning, selected-tab bar */
    --ss-mango: #FFD166;          /* focus ring on the green wall */
    --ss-cream: #FFF9EE;          /* page background */
    --ss-card: #FFFFFF;           /* cards and fields */
    --ss-text: #263238;           /* body text */
    --ss-muted: #6B7280;          /* supporting text */
    --ss-border: #D8D8D0;         /* card edges, dividers */
    --ss-disabled: #E1E1DE;       /* disabled buttons */
    /* Border gray is 1.4:1 on white, too faint to find a text field by. Fields get a darker edge (3.6:1). */
    --ss-field-border: #7F8A80;

    /* Shape and depth */
    --ss-radius-card: 24px;
    --ss-radius-field: 12px;
    --ss-radius-button: 14px;
    --ss-radius-logo: 18px;
    --ss-shadow-card: 0 8px 24px rgba(22, 77, 40, 0.10);

    /* Type: Nunito Sans first, then the app's own faces. */
    --ss-font: "Nunito Sans", "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Point MudBlazor at the palette (these only apply inside the sign-in screen). */
    --mud-palette-primary: var(--ss-green);
    --mud-palette-primary-darken: var(--ss-forest);
    --mud-palette-primary-text: #FFFFFF;
    --mud-palette-primary-hover: rgba(23, 107, 44, 0.08);
    --mud-palette-secondary: var(--ss-orange);
    --mud-palette-secondary-text: var(--ss-forest);
    --mud-palette-background: var(--ss-cream);
    --mud-palette-surface: var(--ss-card);
    --mud-palette-text-primary: var(--ss-text);
    --mud-palette-text-secondary: var(--ss-muted);
    --mud-palette-action-default: var(--ss-muted);
    --mud-palette-action-disabled: var(--ss-muted);
    --mud-palette-action-disabled-background: var(--ss-disabled);
    --mud-palette-lines-default: var(--ss-border);
    --mud-palette-lines-inputs: var(--ss-field-border);
    --mud-palette-divider: var(--ss-border);
    --mud-typography-default-family: var(--ss-font);
    --mud-typography-body1-family: var(--ss-font);
    --mud-typography-body2-family: var(--ss-font);
    --mud-typography-subtitle1-family: var(--ss-font);
    --mud-typography-subtitle2-family: var(--ss-font);
    --mud-typography-button-family: var(--ss-font);
    --mud-typography-caption-family: var(--ss-font);
    --mud-typography-h5-family: var(--ss-font);

    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--ss-cream);
    color: var(--ss-text);
    font-family: var(--ss-font);
}

/* Warm cream behind the overscroll area too, not just behind the content. */
html:has(.tm-login) {
    background: #FFF9EE;
}

.tm-login .mud-typography,
.tm-login .mud-button-root,
.tm-login .mud-input,
.tm-login .mud-input-slot,
.tm-login .mud-input-label,
.tm-login .mud-tab,
.tm-login .mud-alert {
    font-family: var(--ss-font);
}

/* ----- Header: green wall, language toggle, logo, title ----- */

.tm-login-top {
    background: var(--ss-green);
    color: #FFFFFF;
}

.tm-login-top :focus-visible,
.tm-login-wall :focus-visible {
    outline-color: var(--ss-mango);
}

.tm-login-wall {
    position: relative;
    padding: 4px 20px 32px;
    /* A very light tonal step so the wall reads as a surface and the green awning stripes show against it. */
    background: linear-gradient(180deg, var(--ss-green) 0%, var(--ss-forest) 100%);
    color: #FFFFFF;
}

.tm-login .tm-brand-mark--lg {
    width: 64px;
    height: 64px;
    border-radius: var(--ss-radius-logo);
    background: var(--ss-orange);
    color: var(--ss-forest);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.tm-login .tm-brand-mark--lg .mud-icon-root {
    font-size: 2.1rem;
}

.tm-login-brand__title.mud-typography {
    color: #FFFFFF;
    font-family: var(--ss-font);
    font-size: 1.625rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-align: center;
}

.tm-login-brand__sub.mud-typography {
    max-width: 34ch;
    color: rgba(255, 255, 255, 0.92);
    font-size: 1rem;
    line-height: 1.5;
}

/* The awning under the wall is the shared one defined with the app bar above. */

/* ----- Card ----- */

.tm-login-main.mud-container {
    padding: 36px 16px 40px;
}

.tm-login-card.mud-paper {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 20px 28px;
    border: 0;
    border-radius: var(--ss-radius-card);
    background: var(--ss-card);
    box-shadow: var(--ss-shadow-card);
}

@media (min-width: 600px) {
    .tm-login-card.mud-paper {
        padding: 20px 32px 32px;
    }
}

.tm-login .mud-tabs-panels {
    padding-top: 20px;
}

/* ----- Tabs: dark-green label, orange bar under the selected one ----- */

.tm-login .mud-tabs-tabbar {
    border-bottom: 1px solid var(--ss-border);
}

.tm-login .mud-tab {
    min-width: 0;
    min-height: 48px;
    padding: 6px 12px;
    color: var(--ss-muted);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.tm-login .mud-tabs-tabbar .mud-tab.mud-tab-active {
    color: var(--ss-forest);
    font-weight: 800;
}

.tm-login .mud-tabs-tabbar .mud-tab-slider {
    height: 4px;
    border-radius: 4px 4px 0 0;
    background-color: var(--ss-orange);
}

/* ----- Text ----- */

.tm-login .mud-typography-body2,
.tm-login-help.mud-typography {
    font-size: 0.9375rem;
    line-height: 1.55;
}

.tm-login-help.mud-typography {
    color: var(--ss-muted);
}

.tm-login .mud-typography-subtitle1 {
    color: var(--ss-forest);
    font-size: 1.0625rem;
    font-weight: 700;
}

/* ----- Fields: white, rounded, a border you can see, a clear green focus ----- */

.tm-login .mud-input-outlined {
    border-radius: var(--ss-radius-field);
    background: var(--ss-card);
}

.tm-login .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--ss-field-border);
    border-radius: var(--ss-radius-field);
}

.tm-login .mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--ss-forest);
}

.tm-login .mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: var(--ss-green);
    border-width: 2px;
}

.tm-login .mud-input > input.mud-input-root,
.tm-login .mud-input-slot {
    color: var(--ss-text);
    font-size: 1rem;
}

.tm-login .mud-input-label {
    color: var(--ss-muted);
    font-size: 1rem;
}

.tm-login .mud-input-control.mud-input-focused .mud-input-label,
.tm-login .mud-input-outlined:focus-within ~ .mud-input-label {
    color: var(--ss-forest);
}

/* ----- Buttons ----- */

.tm-login .mud-button-root {
    border-radius: var(--ss-radius-button);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.tm-login .mud-button-filled-primary {
    background-color: var(--ss-green);
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(22, 77, 40, 0.22);
}

.tm-login .mud-button-filled-primary:hover {
    background-color: var(--ss-forest);
}

.tm-login .mud-button-filled-secondary {
    background-color: var(--ss-orange);
    color: var(--ss-forest);
    box-shadow: 0 2px 6px rgba(22, 77, 40, 0.18);
}

.tm-login .mud-button-filled-secondary:hover {
    background-color: var(--ss-mango);
}

.tm-login .mud-button-outlined-primary {
    min-height: 48px;
    border: 1.5px solid var(--ss-green);
    color: var(--ss-green);
}

.tm-login .mud-button-text {
    min-height: 44px;
    font-weight: 600;
}

.tm-login .mud-button-text-primary {
    color: var(--ss-green);
}

.tm-login .mud-button-filled.mud-disabled,
.tm-login .mud-button-filled:disabled {
    background-color: var(--ss-disabled);
    color: var(--ss-muted);
    box-shadow: none;
}

.tm-login .mud-divider {
    border-color: var(--ss-border);
}

/* =====================================================================================
   Staff console (Pages/Platform)
   ===================================================================================== */

.tm-staff-nav {
    display: flex;
    gap: 4px;
    margin-left: 16px;
}

.tm-staff-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
}

.tm-staff-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.tm-staff-nav a.is-active {
    background: #FFFFFF;
    color: #26323A;
}

.tm-staff-nav .mud-icon-root {
    font-size: 1.15rem;
}

@media (max-width: 599.98px) {
    .tm-staff-nav {
        margin-left: 4px;
    }

    .tm-staff-nav a {
        padding: 6px 8px;
    }

    .tm-staff-nav .mud-icon-root {
        display: none;
    }
}

/* A number with its label: overview counts and import results. A link when it is an anchor. */
.tm-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--tm-line);
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
}

a.tm-stat:hover {
    border-color: var(--tm-green);
}

.tm-stat__value {
    font-family: var(--tm-font-display);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.tm-stat__label {
    color: var(--mud-palette-text-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
}

.tm-stat--warn .tm-stat__value {
    color: var(--mud-palette-warning);
}

.tm-code {
    margin: 0;
    padding: 12px;
    overflow-x: auto;
    background: var(--mud-palette-background-gray);
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* =====================================================================================
   Loading and error screens
   ===================================================================================== */

.loading-progress-text {
    color: var(--tm-ink-soft);
    font-family: var(--tm-font-body);
}

#blazor-error-ui .reload {
    color: var(--tm-green);
    font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
