:root {
    /* Tax Review REBRAND, 2026-11-15 (Jacob) -- full rebuild to match the ERS Client Portal
       design system already live on PUTT Analysis and Upload Data (same masthead gradient
       structure, Source Serif 4 headings, pill nav/buttons, card restyle) -- NOT just a color
       swap. Jacob's explicit instruction: "keep your distinctive orange color where needed to
       help differentiate the app" -- Tax Review's long-standing Burnt Orange (#C1590E, changed
       2026-09-19 from a green that was confusingly identical to PUTT Analysis's) is RETAINED
       unchanged as the accent, paired with a new Deep Umber/Espresso base for the gradient
       masthead -- its own distinct hue family from PUTT Analysis's Navy and Upload Data's Teal,
       per the standing per-app-color-family design goal: every app gets a unique base AND a
       unique accent so the family is visually distinguishable at a glance while still reading
       as one cohesive design system (shared structure/typography/components). This exact
       Umber/Burnt-Orange pairing was proposed during the 2026-11-08 app-family branding
       discussion and is being built now for the first time.
       App structure, routes, data, and logic are UNCHANGED -- this file (+ layout/login markup
       updates to match) only. Formerly a flat solid-orange header (see git history); replaced
       in full. */
    --tr-umber: #231209;
    --tr-umber-light: #3E220F;
    --tr-orange: #C1590E;
    --tr-orange-bright: #F0781C;
    --tr-gray-600: #5B6372;
    --tr-gray-300: #D9DCE2;
    --tr-gray-100: #F4F5F7;
    --tr-green: #157F4D;

    /* Back-compat aliases -- every existing component/page in this app references these
       --tr-* names (buttons, borders, tables, modals, login split-panel). Remapping the VALUES
       to the new tokens restyles the whole app without renaming anything else. */
    --tr-primary: var(--tr-orange);
    --tr-primary-light: var(--tr-orange-bright);
    --tr-primary-dark: var(--tr-umber);

    --tr-text-primary: var(--tr-umber);
    --tr-text-secondary: var(--tr-gray-600);

    --tr-background: #FFFFFF;
    --tr-surface: #FFFFFF;
    --tr-border: var(--tr-gray-300);

    --tr-success: var(--tr-green);
    --tr-warning: #B8860B;
    --tr-error: #B3392C;
}

body {
    background-color: var(--tr-background);
    color: var(--tr-text-primary);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

h1, h2, h3 {
    font-family: "Source Serif 4", serif;
}

.tr-serif {
    font-family: "Source Serif 4", serif;
}

a, .btn-link {
    color: var(--tr-primary);
}

/* ===== Masthead (shared app-family chrome, matches PUTT Analysis/Upload Data structure) =====
   Deep Umber/Espresso gradient header, replacing the old flat burnt-orange bar. Structure/nav
   destinations are byte-for-byte the same as before -- only the look changed. */
.tr-header {
    background: linear-gradient(135deg, var(--tr-umber) 0%, var(--tr-umber-light) 100%);
    color: white;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.tr-header .brand {
    font-family: "Source Serif 4", serif;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tr-header-mark {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}
.tr-header-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.tr-header-brandtext small {
    display: block;
    font-family: "Inter", sans-serif;
    font-size: 10.5px;
    color: #D9A98C;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
}

/* ===== Environment badge (added 2026-11-15, matches Upload Data's 2026-11-08 pattern) =====
   ASPNETCORE_ENVIRONMENT can't be used (it's literally "Production" on both real environments
   regardless of which business environment this is), so this renders a brand-new explicit
   AppEnvironmentLabel app setting instead. Dev uses an amber/warning tone -- deliberately NOT
   this app's own brand colors (umber/orange) or the universal green/red semantic colors -- so
   it reads as "caution, non-production" at a glance without colliding with any other meaning
   already in use. Production uses a quiet neutral tone so the environment users work in
   day-to-day doesn't look like a persistent warning. */
.tr-env-badge {
    font-family: "Inter", sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 10px;
    white-space: nowrap;
}
.tr-env-badge.dev {
    background-color: rgba(230, 168, 23, 0.18);
    color: #F0B33B;
    border: 1px solid rgba(240, 179, 59, 0.4);
}
.tr-env-badge.prod {
    background-color: rgba(255, 255, 255, 0.1);
    color: #E0C9BC;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.tr-env-badge.login {
    position: absolute;
    top: 20px;
    left: 24px;
    z-index: 3;
}

.tr-header a.btn-secondary,
.tr-header button.btn-secondary,
.tr-topnav button,
.btn-topnav {
    background-color: transparent;
    color: #E0C9BC;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 0;
    font-family: "Inter", sans-serif;
}
.tr-header a.btn-secondary:hover,
.tr-header button.btn-secondary:hover,
.tr-topnav button:hover,
.btn-topnav:hover {
    color: white;
    border-color: var(--tr-orange-bright);
    background-color: rgba(255,255,255,0.06);
}

.tr-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tr-orange);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    font-family: "Source Serif 4", serif;
    flex-shrink: 0;
}

/* ===== Background watermark (matches PUTT Analysis/Upload Data pattern) =====
   Large greyed-out ERS symbol behind page content, on every screen EXCEPT Login (Login uses
   LoginLayout, which never includes this element). */
.tr-page-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280vw;
    max-width: 3600px;
    height: 280vw;
    max-height: 3600px;
    background-image: url('images/ers-watermark-symbol.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.18;
    z-index: -1;
    pointer-events: none;
}

.tr-page {
    padding: 24px;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

.tr-card {
    background-color: var(--tr-surface);
    border: 1px solid var(--tr-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--tr-text-secondary); }
.form-group input, .form-group select, input, select, textarea {
    padding: 6px 8px;
    border: 1px solid var(--tr-border);
    border-radius: 4px;
    font-size: 14px;
}

table { border-collapse: collapse; }
table th, table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--tr-border); }

.btn-primary {
    background-color: var(--tr-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 11px 20px;
    cursor: pointer;
    font-weight: 600;
    font-family: "Inter", sans-serif;
}
.btn-primary:hover:not(:disabled) { background-color: var(--tr-primary-light); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    background-color: var(--tr-surface);
    color: var(--tr-primary);
    border: 1px solid var(--tr-primary);
    border-radius: 4px;
    padding: 8px 14px;
    cursor: pointer;
}
.btn-secondary:hover { background-color: #FCF1E8; }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger {
    background-color: var(--tr-error);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
}
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-switchboard {
    display: block;
    width: 100%;
    max-width: 560px;
    text-align: center;
    padding: 26px 24px;
    font-size: 16px;
    margin: 0 auto 16px auto;
    border-radius: 8px;
    background-color: var(--tr-primary);
    color: white;
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
}
.btn-switchboard:hover:not(:disabled) { background-color: var(--tr-primary-light); }
.btn-switchboard:disabled {
    background-color: #4A5568;
    color: #A0AEC0;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Editable-field highlight (2026-11-09, Jacob) -- visually distinguish user-editable fields
   from read-only ones in both Review Transactions of Interest and Review Refund Detail: the
   Step "Fields" checklist table (a light tint on the whole row) and the View All Detail grid
   itself (a tinted header + left accent bar on editable columns), so a user can tell at a
   glance which cells they're allowed to type into without needing to click first. */
.tr-editable-row {
    background-color: #FDF3E7;
}
.tr-editable-header {
    background-color: #FDF3E7 !important;
    border-left: 3px solid var(--tr-primary) !important;
}
.tr-editable-header .mud-table-sort-label,
.tr-editable-header .mud-data-grid-col-title {
    color: var(--tr-primary-dark);
    font-weight: 700;
}
.tr-editable-cell {
    background-color: #FEFAF4;
}

/* Exemption Basis autocomplete dropdown (Review Master Roll Up Table, 2026-09-28) -- smaller
   font + wide enough that each option's full "Category / Description -- Exempt %" text fits on
   one line without wrapping. MudBlazor's popover matches the input's width by default, so this
   overrides it with !important.
   RESIZED 2026-11-08 per Jacob: half the prior width/row-height, font 9-10px (prior was
   620px min-width / 90vw max-width, 12.5px font, 3px top/bottom padding). */
.exemption-basis-popover {
    min-width: 310px !important;
    max-width: 45vw !important;
}
.exemption-basis-popover .mud-list-item-text,
.exemption-basis-popover .mud-list-item {
    font-size: 9.5px !important;
    white-space: nowrap !important;
}
.exemption-basis-popover .mud-list-item {
    padding-top: 1.5px !important;
    padding-bottom: 1.5px !important;
    min-height: 0 !important;
    border-bottom: 1px solid var(--tr-border);
}
.exemption-basis-popover .mud-list-item:last-child {
    border-bottom: none;
}


/* ===== Login screen redesign, 2026-11-15 =====
   REBUILT to match the locked ERS Client Portal design system (same richer brand-panel
   treatment already live on PUTT Analysis/Upload Data: geometric overlay, radial glow,
   decorative rings, logo lockup) -- with Tax Review's own Umber/Burnt-Orange identity in
   place of Navy/Crimson or Teal/Blue. App logic/markup structure (forgot password, temp
   password reset, mandatory MFA setup, MFA verify) is unchanged -- visual only. */
.app-login-split {
    display: flex;
    min-height: 100vh;
}

/* ---------- LEFT PANEL (brand) ---------- */
.app-login-left {
    flex: 1.05;
    position: relative;
    background: linear-gradient(145deg, var(--tr-umber) 0%, var(--tr-umber-light) 60%, #4F2B13 100%);
    color: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 72px;
}

.app-login-left::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px, transparent 1px, transparent 46px),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 46px);
    pointer-events: none;
}
.app-login-left::after {
    content: "";
    position: absolute; top: -20%; right: -15%;
    width: 60%; height: 60%;
    background: radial-gradient(circle, rgba(240,120,28,0.22) 0%, rgba(240,120,28,0) 70%);
    pointer-events: none;
}

.app-login-watermark-ring {
    position: absolute;
    top: 8%;
    left: -12%;
    width: 340px;
    height: 340px;
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    pointer-events: none;
}
.app-login-watermark-ring.small {
    width: 180px; height: 180px; top: 62%; left: 4%;
    border-color: rgba(255,255,255,0.06);
}
.app-login-watermark-logo {
    position: absolute;
    right: -4%;
    bottom: -2%;
    width: 36%;
    max-width: 320px;
    opacity: 0.08;
    filter: grayscale(1) brightness(3);
    pointer-events: none;
    user-select: none;
}

.app-login-brand-content { position: relative; z-index: 2; max-width: 600px; text-align: center; }

.app-login-logo-card {
    margin-bottom: 44px;
    position: relative;
    display: inline-block;
    background: none;
    padding: 0;
}
.app-login-logo-card::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 420px; height: 420px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(240,120,28,0.28) 0%, rgba(240,120,28,0) 70%);
    pointer-events: none;
    z-index: 0;
}
.app-login-logo-card img { height: 220px; width: auto; display: block; position: relative; z-index: 1; margin: 0 auto; }

.app-login-left h1 {
    font-family: "Source Serif 4", serif;
    color: white;
    font-size: 46px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    margin: 0 0 20px 0;
}
.app-login-left p {
    color: #D9BBA8;
    font-size: 17px;
    line-height: 1.65;
    text-align: center;
    max-width: 560px;
    margin: 0 auto 44px auto;
}

.app-login-version {
    position: absolute;
    bottom: 16px;
    color: #6B7280;
    font-size: 11px;
    text-align: center;
    width: 100%;
    left: 0;
}

.app-login-confidential {
    font-size: 12px;
    color: #6B7280;
    text-align: center;
    margin-top: 28px;
    letter-spacing: 0.04em;
}

/* ---------- RIGHT PANEL (form) ---------- */
.app-login-right {
    flex: 1;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
}
.app-login-right-top-logo {
    margin-bottom: 30px;
}
.app-login-right-top-logo img {
    height: 100px;
    width: auto;
    display: block;
}

.app-login-form {
    width: 100%;
    max-width: 380px;
}
.app-login-form h2 {
    font-family: "Source Serif 4", serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--tr-umber);
    margin: 0 0 6px 0;
    text-align: center;
}
.app-login-form .subtitle {
    color: var(--tr-gray-600);
    font-size: 14px;
    margin: 0 0 30px 0;
    text-align: center;
}
.app-login-form label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--tr-umber);
    margin: 20px 0 7px 0;
}
.app-login-form label:first-of-type { margin-top: 0; }
.app-login-form input[type="text"],
.app-login-form input[type="email"],
.app-login-form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1.5px solid var(--tr-gray-300);
    border-radius: 8px;
    outline: none;
    color: var(--tr-umber);
    box-sizing: border-box;
    transition: 0.15s;
}
.app-login-form input[type="text"]:focus,
.app-login-form input[type="email"]:focus,
.app-login-form input[type="password"]:focus {
    border-color: var(--tr-orange);
    box-shadow: 0 0 0 3px rgba(193,89,14,0.1);
}
.app-login-password-row { position: relative; }
.app-login-password-row input { padding-right: 46px !important; }
.app-login-eye-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--tr-gray-600);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    font-family: inherit;
}
.app-login-eye-toggle:hover { color: var(--tr-orange); }

.app-login-error {
    color: var(--tr-error);
    font-size: 13px;
    white-space: pre-wrap;
    margin-top: 10px;
}

.app-login-submit {
    width: 100%;
    margin-top: 20px;
    background: linear-gradient(135deg, var(--tr-orange-bright), var(--tr-orange));
    color: white;
    font-weight: 700;
    font-size: 14.5px;
    border: none;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(193,89,14,0.28);
    transition: 0.15s;
}
.app-login-submit:hover:not(:disabled) { filter: brightness(1.05); }
.app-login-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.app-login-busy {
    text-align: center;
    color: var(--tr-gray-600);
    font-size: 13px;
    margin-top: 10px;
}

.app-login-helper {
    color: var(--tr-gray-600);
    font-size: 12.5px;
    text-align: center;
    margin-top: 36px;
}
.app-login-helper a {
    color: var(--tr-orange);
    font-weight: 600;
    text-decoration: none;
}
