/* MBL Petty Cash Tracker — HR-dashboard-kit-inspired theme.
   Clean white sidebar, off-white content, emerald primary, near-black headings,
   pill-shaped active nav, soft borders, no harsh shadows. */

:root {
    --brand-primary: #10B981;
    --brand-primary-darken: #059669;
    --brand-primary-lighten: #34D399;
    --brand-primary-50: #ECFDF5;
    --brand-primary-100: #D1FAE5;
    --brand-secondary: #EC4899;
    --brand-fg: #0F172A;             /* slate-900 — softer than pure black */
    --brand-fg-muted: #64748B;       /* slate-500 */
    --brand-surface: #FFFFFF;
    --brand-bg: #F8FAFC;             /* slate-50 — subtle cool background */
    --brand-border: #E2E8F0;         /* slate-200 */
    --brand-border-soft: rgba(15,23,42,0.05);
    --brand-radius: 10px;
    --brand-radius-lg: 14px;
    --brand-shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
    --brand-shadow-md: 0 4px 12px rgba(15,23,42,0.06);
}

/* Dark mode — redefine brand tokens so every rule using var(--brand-*) flips automatically.
   Palette is a deep emerald-forest tone (HR-dashboard-kit feel) instead of pure black. */
.mud-theme-dark {
    --brand-primary: #34D399;
    --brand-primary-darken: #10B981;
    --brand-primary-lighten: #6EE7B7;
    --brand-primary-50: rgba(52,211,153,0.10);
    --brand-primary-100: rgba(52,211,153,0.22);
    --brand-fg: #ECFDF5;
    --brand-fg-muted: #9DB4A8;
    --brand-surface: #122B22;
    --brand-bg: #0A1A15;
    --brand-border: rgba(110,231,183,0.10);
    --brand-border-soft: rgba(110,231,183,0.06);
    --brand-shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --brand-shadow-md: 0 4px 12px rgba(0,0,0,0.5);
}

html, body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    /* Let Windows ClearType / macOS subpixel rendering work — do NOT force antialiased. */
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    /* Use MudBlazor's palette vars on the html/body so they flip with the theme even though
       .mud-theme-dark is applied to a child wrapper (so body wouldn't pick up --brand-* overrides). */
    color: var(--mud-palette-text-primary, var(--brand-fg));
    background: var(--mud-palette-background, var(--brand-bg));
}

/* Headings — same Inter family, only weight + letter-spacing change. Avoids the
   "DM Sans on Windows looks chunky" problem and removes a network roundtrip. */
h1, h2, h3, h4, h5, h6,
.mud-typography-h1, .mud-typography-h2, .mud-typography-h3,
.mud-typography-h4, .mud-typography-h5, .mud-typography-h6,
.mud-typography-subtitle1, .mud-typography-subtitle2 {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    letter-spacing: -0.015em;
    font-feature-settings: "ss01", "cv11";
}

/* App shell ------------------------------------------------------------- */
.mud-application-layout { background: var(--brand-bg); }
.mud-theme-dark .mud-application-layout { background: var(--brand-bg); }

/* AppBar — flat white, subtle bottom border */
.mud-appbar {
    background: var(--brand-surface) !important;
    color: var(--brand-fg) !important;
    border-bottom: 1px solid var(--brand-border-soft);
    box-shadow: none !important;
    backdrop-filter: none;
}
.mud-theme-dark .mud-appbar {
    background: var(--brand-bg) !important;
    border-bottom-color: var(--brand-border);
}

/* Drawer — flat white, subtle right border */
.mud-drawer {
    border-right: 1px solid var(--brand-border-soft);
    box-shadow: none !important;
}
.mud-theme-dark .mud-drawer { border-right-color: rgba(255,255,255,0.06); }

/* Drawer brand header */
.drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--brand-border-soft);
}
.mud-theme-dark .drawer-brand { border-bottom-color: rgba(255,255,255,0.06); }
.drawer-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.drawer-brand-mark--image { padding: 4px; background: linear-gradient(135deg, #059669 0%, #10B981 100%); }
.drawer-brand-mark--image img { width: 100%; height: 100%; object-fit: contain; display: block; filter: brightness(0) invert(1); }
.drawer-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
    flex: 1;
}
.drawer-brand-text .brand-line-1 {
    font-family: 'Inter', 'Helvetica Neue', sans-serif;
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--brand-fg);
    letter-spacing: -0.005em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.drawer-brand-text .brand-line-2 {
    font-size: 0.68rem;
    color: var(--brand-fg-muted);
    margin-top: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Section header inside the drawer */
.nav-section-header {
    padding: 16px 18px 6px;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--brand-fg-muted);
}

/* NavMenu — pill-shaped active item with emerald tint */
.mud-nav-link {
    margin: 1px 8px;
    border-radius: 8px;
    padding: 8px 12px !important;
    color: var(--brand-fg) !important;
    font-size: 0.875rem !important;
    font-weight: 500;
    transition: background-color 120ms ease, color 120ms ease;
}
.mud-nav-link .mud-nav-link-icon {
    color: var(--brand-fg-muted) !important;
    margin-right: 10px;
}
.mud-nav-link:hover { background-color: rgba(0,0,0,0.04); }
.mud-theme-dark .mud-nav-link:hover { background-color: rgba(255,255,255,0.06); }
.mud-nav-link.active.mud-nav-link {
    background: var(--brand-primary-50);
    color: var(--brand-primary-darken) !important;
    font-weight: 600;
}
.mud-nav-link.active.mud-nav-link .mud-nav-link-icon { color: var(--brand-primary-darken) !important; }
.mud-theme-dark .mud-nav-link.active.mud-nav-link {
    background: rgba(52,211,153,0.12);
    color: #6EE7B7 !important;
}
.mud-theme-dark .mud-nav-link.active.mud-nav-link .mud-nav-link-icon { color: #6EE7B7 !important; }

/* User avatar trigger in AppBar */
.user-menu-trigger {
    border-radius: 999px;
    padding: 4px 6px 4px 4px;
    transition: background-color 120ms ease;
}
.user-menu-trigger:hover { background-color: rgba(0,0,0,0.04); }
.mud-theme-dark .user-menu-trigger:hover { background-color: rgba(255,255,255,0.06); }
.user-avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #059669 0%, #10B981 100%) !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 0.74rem;
}

/* Page header — bold black title (no uppercase, no underline). */
.page-header { margin-bottom: 24px; }
.page-header-title {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--brand-fg);
    letter-spacing: -0.01em;
}
.page-header-subtitle {
    color: var(--brand-fg-muted);
    margin-top: 4px;
    font-size: 0.875rem;
}
.page-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--brand-primary-100);
    color: var(--brand-primary-darken);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mud-theme-dark .page-header-icon {
    background: rgba(52,211,153,0.16);
    color: #6EE7B7;
}
.page-header-crumbs .mud-typography { font-size: 0.78rem; }

/* KPI card */
.kpi-card {
    border: 1px solid var(--brand-border);
    border-radius: var(--brand-radius);
    background: var(--brand-surface);
    transition: border-color 120ms ease, box-shadow 120ms ease;
    height: 100%;
    box-shadow: var(--brand-shadow-sm);
}
.mud-theme-dark .kpi-card {
    background: var(--mud-palette-surface);
    border-color: rgba(255,255,255,0.06);
}
.kpi-card { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: rgba(0,0,0,0.12);
}
.mud-theme-dark .kpi-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.12);
}
.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kpi-label {
    color: var(--brand-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
    font-weight: 600;
}
.kpi-value {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-weight: 700;
    line-height: 1;
}
.kpi-hint { color: var(--brand-fg-muted); margin-top: 4px; }

/* Empty state */
.empty-state {
    border: 1px dashed var(--brand-border);
    border-radius: var(--brand-radius-lg);
    background: rgba(255,255,255,0.6);
}
.mud-theme-dark .empty-state {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.10);
}
.empty-state-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--brand-primary-100);
    color: var(--brand-primary-darken);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mud-theme-dark .empty-state-icon {
    background: rgba(52,211,153,0.12);
    color: #6EE7B7;
}
.empty-state-description {
    color: var(--brand-fg-muted);
    max-width: 420px;
}

/* Cards / Papers */
.mud-paper:not(.mud-paper-square) { border-radius: var(--brand-radius); }
.mud-paper.mud-elevation-1 {
    box-shadow: var(--brand-shadow-sm) !important;
    border: 1px solid var(--brand-border);
}

/* Data grid + table polish — finance-density compact rows, bold sticky header */
.mud-table-root th,
.mud-data-grid .mud-table-head .mud-table-cell {
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
    color: var(--brand-fg) !important;
    background: rgba(0,0,0,0.03);
    border-bottom: 1px solid var(--brand-border) !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    white-space: nowrap;
}
.mud-theme-dark .mud-table-root th,
.mud-theme-dark .mud-data-grid .mud-table-head .mud-table-cell {
    background: rgba(255,255,255,0.04);
    color: #F5F5F5 !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
}
/* Sortable column header chevrons inherit the header weight */
.mud-data-grid .mud-table-head .mud-table-sort-label { font-weight: 700; color: var(--brand-fg); }
.mud-theme-dark .mud-data-grid .mud-table-head .mud-table-sort-label { color: #F5F5F5; }

/* Body rows — tight finance density, monospace numerics */
.mud-table-dense .mud-table-cell,
.mud-table-dense.mud-table-row,
.mud-data-grid .mud-table-cell {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    vertical-align: middle;
    font-size: 0.85rem;
}
.mud-table-cell { vertical-align: middle; }
.mud-data-grid .mud-table-row { border-bottom: 1px solid var(--brand-border-soft); }
.mud-theme-dark .mud-data-grid .mud-table-row { border-bottom-color: rgba(255,255,255,0.05); }

/* Inline inputs inside table cells — flush, no extra margin */
.mud-table-cell .mud-input.mud-input-outlined,
.mud-data-grid .mud-input.mud-input-outlined { margin-top: 0; }
.mud-table-cell .mud-input-outlined .mud-input-outlined-input,
.mud-data-grid .mud-input-outlined .mud-input-outlined-input {
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 0.85rem;
}

/* Footer / totals row in tables — clear separation */
.mud-table-foot .mud-table-cell {
    font-weight: 700;
    background: rgba(0,0,0,0.025);
    border-top: 2px solid var(--brand-border) !important;
    color: var(--brand-fg);
}
.mud-theme-dark .mud-table-foot .mud-table-cell {
    background: rgba(255,255,255,0.04);
    border-top-color: rgba(255,255,255,0.10) !important;
    color: #F5F5F5;
}

/* Form-row alignment */
.mud-grid > .mud-grid-item .mud-input-outlined,
.mud-grid > .mud-grid-item .mud-input-control,
.mud-grid > .mud-grid-item > .mud-form-control { width: 100%; }

/* Outlined inputs — subtler border, larger radius */
.mud-input-outlined-border { border-radius: 8px; }
.mud-input.mud-input-outlined { background: transparent; }

/* Filter bar */
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.filter-row > * { flex: 1 1 220px; min-width: 200px; }

/* Professional grid toolbar */
.grid-toolbar {
    border: 1px solid var(--brand-border);
    background: var(--brand-surface);
    border-radius: var(--brand-radius);
}
.mud-theme-dark .grid-toolbar {
    background: var(--mud-palette-surface);
    border-color: rgba(255,255,255,0.06);
}
.grid-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
}
.grid-toolbar .mud-picker .mud-input-helper-text { display: none; }
/* Finance accept/reject drawer — width is set as a parameter on the MudDrawer
   (Width="380px") so MudBlazor's internal slide-off-screen transform knows the
   actual offset. Without that parameter, the closed-state translateX uses the
   default width (240px) and only partially hides a 380px-wide drawer, leaving
   a visible sliver on page load. The media-query override below caps the open
   width on phones so the form doesn't clip.

   Don't add a CSS `width` rule that contradicts the parameter — MudBlazor
   computes the closed-state translateX from the parameter, not from CSS. */
.finance-decision-drawer.mud-drawer { max-width: 100vw; }
@media (max-width: 480px) {
    .finance-decision-drawer.mud-drawer { width: 100vw !important; }
}

/* All filter fields share the row evenly. Search gets a slightly larger basis
   so the typed-in field still leads the row, but every item grows at the same
   rate (flex-grow: 1) so trailing whitespace doesn't pile up after the last
   autocomplete on wide screens. */
.grid-toolbar-search { flex: 1 1 220px; min-width: 180px; }
.grid-toolbar-date   { flex: 1 1 160px; min-width: 150px; }
.grid-toolbar-filter { flex: 1 1 180px; min-width: 160px; }
.grid-toolbar-clear  { flex: 0 0 auto; align-self: center; }
@media (max-width: 720px) {
    .grid-toolbar-search,
    .grid-toolbar-date,
    .grid-toolbar-filter { flex: 1 1 100%; }
}

/* Date-range quick-pick chips (Last 24h / 3d / 7d / 30d / 3m / All) */
.date-range-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.date-range-pill.mud-chip {
    height: 30px;
    padding: 0 12px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: 999px;
    border: 1px solid var(--brand-border, rgba(0,0,0,0.1));
    background: transparent !important;
}
.date-range-pill.mud-chip:hover { background: rgba(0,0,0,0.04) !important; }
.mud-theme-dark .date-range-pill.mud-chip:hover { background: rgba(255,255,255,0.05) !important; }
.date-range-pill.mud-chip.mud-chip-selected {
    background: var(--mud-palette-primary) !important;
    color: var(--mud-palette-primary-text) !important;
    border-color: var(--mud-palette-primary) !important;
}

/* Picker popover — pin to viewport center when Dialog variant is used */
.mud-picker-popover-paper.mud-picker-paper {
    border-radius: var(--brand-radius-lg) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08) !important;
}

/* Claim list grid container */
.claims-grid .mud-table-container {
    max-height: calc(100vh - 360px);
    border-radius: var(--brand-radius);
    border: 1px solid var(--brand-border);
}
.mud-theme-dark .claims-grid .mud-table-container { border-color: rgba(255,255,255,0.06); }
.claims-grid .mud-table-row:hover {
    background-color: rgba(16,185,129,0.04) !important;
}
.mud-theme-dark .claims-grid .mud-table-row:hover {
    background-color: rgba(52,211,153,0.06) !important;
}

/* Project two-line cell (number bold on top, name muted below) */
.project-cell { line-height: 1.2; }
.project-cell .project-number { font-weight: 600; font-size: 0.82rem; color: var(--brand-fg); }
.project-cell .project-name { font-size: 0.74rem; color: var(--brand-fg-muted); }

/* Column alignment helpers */
.grid-col-amount, .grid-col-amount > * { text-align: end !important; font-feature-settings: "tnum"; }
.grid-col-center, .grid-col-center > * { text-align: center !important; }
.grid-col-mono { font-feature-settings: "tnum"; }
.grid-col-actions { width: 64px; text-align: end; white-space: nowrap; }

/* Read-only cell value */
.readonly-cell {
    display: inline-block;
    color: var(--brand-fg-muted);
    font-feature-settings: "tnum";
    font-size: 0.85rem;
    padding: 6px 8px;
    background: rgba(0,0,0,0.025);
    border-radius: 6px;
    min-width: 80px;
    text-align: start;
}
.mud-theme-dark .readonly-cell { background: rgba(255,255,255,0.04); }

/* PDF dropzone (claim line dialog) */
.pdf-dropzone {
    border: 2px dashed rgba(220, 38, 38, 0.40);
    border-radius: var(--brand-radius-lg);
    padding: 28px 24px;
    background: rgba(220, 38, 38, 0.03);
    text-align: center;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}
.pdf-dropzone:hover {
    background: rgba(220, 38, 38, 0.06);
    border-color: rgba(220, 38, 38, 0.65);
}
.pdf-dropzone .mud-icon-root { color: rgba(220, 38, 38, 0.85); }

/* PDF browse button: primary background with white PDF icon */
.pdf-required-btn .mud-button-icon-start .mud-icon-root,
.pdf-required-btn .mud-icon-root {
    color: #ffffff !important;
}
.mud-theme-dark .pdf-dropzone {
    background: rgba(248, 113, 113, 0.05);
    border-color: rgba(248, 113, 113, 0.35);
}
.pdf-attached {
    background: var(--brand-primary-50);
    border: 1px solid var(--brand-primary-100);
    border-radius: var(--brand-radius);
}
.mud-theme-dark .pdf-attached {
    background: rgba(52,211,153,0.08);
    border-color: rgba(52,211,153,0.30);
}

/* Line summary table */
.line-summary-row .supplier-cell { line-height: 1.2; }
.line-summary-row .supplier-cell .supplier-meta { font-size: 0.72rem; color: var(--brand-fg-muted); }

/* Required PDF upload button — pulse */
.pdf-required-btn {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
    animation: pdf-pulse 2.4s ease-out infinite;
    font-weight: 600;
    letter-spacing: 0.04em;
    min-width: 84px;
    text-transform: none;
}
.pdf-required-btn:hover {
    animation: none;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.30);
}
@keyframes pdf-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(220, 38, 38, 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0   rgba(220, 38, 38, 0); }
}

/* Claim-detail invoice-lines table footer */
.claim-lines-table .mud-table-foot td {
    background: rgba(0,0,0,0.025);
    border-top: 2px solid var(--brand-border);
}
.mud-theme-dark .claim-lines-table .mud-table-foot td {
    background: rgba(255,255,255,0.03);
    border-top-color: rgba(255,255,255,0.10);
}

/* PDF preview dialog — full-bleed iframe area */
.pdf-preview-dialog .mud-dialog-content { padding: 0; }
.pdf-preview-frame {
    width: 100%;
    height: 78vh;
    min-height: 480px;
    border: 0;
    background: #1f2937;
    display: block;
}

/* Login page ------------------------------------------------------------ */
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--brand-bg);
}
@media (min-width: 960px) {
    .login-shell { grid-template-columns: 1.05fr 1fr; }
}
.login-hero {
    display: none;
    position: relative;
    padding: 64px;
    color: #fff;
    background: linear-gradient(135deg, #064E3B 0%, #047857 50%, #10B981 100%);
    overflow: hidden;
}
@media (min-width: 960px) {
    .login-hero { display: flex; flex-direction: column; justify-content: space-between; }
}
.login-hero::before {
    content: "";
    position: absolute;
    inset: -10%;
    background: radial-gradient(60% 50% at 80% 20%, rgba(255,255,255,0.16), transparent 60%),
                radial-gradient(40% 40% at 10% 90%, rgba(110,231,183,0.20), transparent 60%);
    pointer-events: none;
}
.login-hero-mark {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(8px);
    color: #fff;
    font-weight: 700;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.24);
    position: relative;
    z-index: 1;
    overflow: hidden;
}
.login-hero-mark--image { padding: 6px; }
.login-hero-mark--image img { width: 100%; height: 100%; object-fit: contain; display: block; filter: brightness(0) invert(1); }
.login-hero-headline {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-top: 28px;
    position: relative;
    z-index: 1;
}
.login-hero-sub {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.85);
    margin-top: 18px;
    max-width: 460px;
    position: relative;
    z-index: 1;
}
.login-hero-points {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 36px;
    position: relative;
    z-index: 1;
}
.login-hero-point {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: rgba(255,255,255,0.94);
    font-size: 0.92rem;
}
.login-hero-point-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.login-hero-foot {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    position: relative;
    z-index: 1;
}
.login-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.03);
    border: 1px solid var(--brand-border);
}
.mud-theme-dark .login-card {
    background: #171717;
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-mark-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
@media (min-width: 960px) { .login-mark-mobile { display: none; } }
.login-title {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    color: var(--brand-fg);
}
.login-subtitle {
    color: var(--brand-fg-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}
.login-field { margin-bottom: 16px; }
.login-field label {
    display: block;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--brand-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.login-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    background: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.login-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.18);
}
.mud-theme-dark .login-input {
    background: #0F0F0F;
    color: #F5F5F5;
    border-color: rgba(255,255,255,0.14);
}
.mud-theme-dark .login-input:focus {
    border-color: var(--brand-primary-lighten);
    box-shadow: 0 0 0 3px rgba(52,211,153,0.20);
}
.login-submit {
    width: 100%;
    padding: 12px 16px;
    background: var(--brand-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background-color 120ms ease, transform 120ms ease;
    margin-top: 8px;
}
.login-submit:hover { background: var(--brand-primary-darken); transform: translateY(-1px); }
.login-submit:active { transform: translateY(0); }
.login-foot {
    margin-top: 18px;
    text-align: center;
    font-size: 0.85rem;
}
.login-foot a { color: var(--brand-primary-darken); text-decoration: none; font-weight: 500; }
.login-foot a:hover { text-decoration: underline; }

/* Breadcrumbs */
.mud-breadcrumbs { padding: 0; }
.mud-breadcrumb-item { font-size: 0.78rem; }
.mud-breadcrumb-item a, .mud-breadcrumbs .mud-typography { color: var(--brand-fg-muted) !important; }
.mud-breadcrumb-item.mud-disabled .mud-typography { color: var(--brand-fg) !important; font-weight: 500; }

/* Misc utilities */
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* ───────── Confirm dialog (icon header + tone-aware actions) ───────── */
.confirm-dialog .mud-dialog { border-radius: 16px !important; overflow: hidden; }
.confirm-dialog .mud-dialog-title    { padding: 24px 24px 8px 24px !important; }
.confirm-dialog .mud-dialog-content  { padding: 8px 24px 16px 24px !important; }
.confirm-dialog .mud-dialog-actions  { padding: 8px 24px 24px 24px !important; gap: 8px; }
.confirm-dialog-header { display: flex; align-items: center; gap: 14px; }
.confirm-dialog-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.confirm-dialog-icon--error   { background: rgba(220,38,38,0.12);  color: #B91C1C; }
.confirm-dialog-icon--warning { background: rgba(245,158,11,0.14); color: #B45309; }
.confirm-dialog-icon--success { background: var(--brand-primary-50); color: var(--brand-primary-darken); }
.confirm-dialog-icon--info    { background: rgba(2,132,199,0.12);  color: #0369A1; }
.confirm-dialog-icon--primary { background: rgba(0,0,0,0.06);      color: var(--brand-fg); }
.mud-theme-dark .confirm-dialog-icon--error   { background: rgba(248,113,113,0.14); color: #FCA5A5; }
.mud-theme-dark .confirm-dialog-icon--warning { background: rgba(251,191,36,0.16);  color: #FCD34D; }
.mud-theme-dark .confirm-dialog-icon--success { background: rgba(52,211,153,0.14);  color: #6EE7B7; }
.mud-theme-dark .confirm-dialog-icon--info    { background: rgba(56,189,248,0.16);  color: #7DD3FC; }
.mud-theme-dark .confirm-dialog-icon--primary { background: rgba(255,255,255,0.10); color: #F5F5F5; }
.confirm-dialog-title   { font-weight: 700; color: var(--brand-fg); }
.confirm-dialog-message { color: var(--brand-fg-muted); line-height: 1.6; }

/* ───────── Claim list — status tabs row (tabs on the left, date-range chips on the right) ───────── */
.status-range-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--brand-border);
    padding-bottom: 4px;
}
.mud-theme-dark .status-range-row { border-bottom-color: rgba(255,255,255,0.08); }

/* Status filter rendered as proper tabs with an active underline. */
.status-tabs.mud-chipset {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    margin-bottom: -1px; /* overlap the row's bottom border so the active underline sits on top */
}
.status-tab.mud-chip {
    background: transparent !important;
    color: var(--brand-fg-muted) !important;
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    padding: 10px 16px !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    margin: 0 !important;
    transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}
.status-tab.mud-chip:hover {
    color: var(--brand-fg) !important;
    background: rgba(0,0,0,0.03) !important;
}
.mud-theme-dark .status-tab.mud-chip:hover { background: rgba(255,255,255,0.04) !important; }
.status-tab.mud-chip.mud-chip-selected {
    color: var(--brand-fg) !important;
    font-weight: 600 !important;
    border-bottom-color: var(--mud-palette-primary) !important;
    background: transparent !important;
    box-shadow: none !important;
}
/* When a tab is selected, tint the underline with the status's own color. */
.status-tab:has(.pill-dot--info).mud-chip-selected    { border-bottom-color: var(--mud-palette-info)    !important; }
.status-tab:has(.pill-dot--warning).mud-chip-selected { border-bottom-color: var(--mud-palette-warning) !important; }
.status-tab:has(.pill-dot--success).mud-chip-selected { border-bottom-color: var(--mud-palette-success) !important; }
.status-tab:has(.pill-dot--error).mud-chip-selected   { border-bottom-color: var(--mud-palette-error)   !important; }

/* Inactive — count badges tinted per status so each tab is scannable at a glance. */
.status-tab:has(.pill-dot--info)    .pill-count { background: rgba(54,137,222,0.18);  color: var(--mud-palette-info); }
.status-tab:has(.pill-dot--warning) .pill-count { background: rgba(245,159,0,0.22);   color: #B45309; }
.status-tab:has(.pill-dot--success) .pill-count { background: rgba(16,185,129,0.18);  color: var(--mud-palette-success); }
.status-tab:has(.pill-dot--error)   .pill-count { background: rgba(220,38,38,0.18);   color: var(--mud-palette-error); }
.mud-theme-dark .status-tab:has(.pill-dot--info)    .pill-count { background: rgba(96,165,250,0.22); color: #93C5FD; }
.mud-theme-dark .status-tab:has(.pill-dot--warning) .pill-count { background: rgba(251,191,36,0.22); color: #FBBF24; }
.mud-theme-dark .status-tab:has(.pill-dot--success) .pill-count { background: rgba(52,211,153,0.22); color: #6EE7B7; }
.mud-theme-dark .status-tab:has(.pill-dot--error)   .pill-count { background: rgba(248,113,113,0.22); color: #FCA5A5; }

/* Active tab — badge picks up the SOLID status color. */
.status-tab.mud-chip-selected .pill-count                                  { background: var(--brand-fg);            color: #fff; }
.status-tab:has(.pill-dot--info).mud-chip-selected    .pill-count          { background: var(--mud-palette-info);    color: #fff; }
.status-tab:has(.pill-dot--warning).mud-chip-selected .pill-count          { background: var(--mud-palette-warning); color: #1f1300; }
.status-tab:has(.pill-dot--success).mud-chip-selected .pill-count          { background: var(--mud-palette-success); color: #fff; }
.status-tab:has(.pill-dot--error).mud-chip-selected   .pill-count          { background: var(--mud-palette-error);   color: #fff; }
.mud-theme-dark .status-tab.mud-chip-selected .pill-count                  { background: #F5F5F5;                    color: #0A0A0A; }
.mud-theme-dark .status-tab:has(.pill-dot--warning).mud-chip-selected .pill-count { background: var(--mud-palette-warning); color: #1f1300; }

/* ───────── Claim list — status filter pills (segmented control) ───────── */
.status-filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: rgba(0,0,0,0.025);
    border: 1px solid var(--brand-border);
    border-radius: 12px;
}
.mud-theme-dark .status-filters {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.06);
}
.status-filters.mud-chipset { padding: 4px; }
.status-filter-pill.mud-chip {
    background: transparent !important;
    color: var(--brand-fg-muted) !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    margin: 0 !important;
    transition: background-color 120ms ease, color 120ms ease;
}
.status-filter-pill.mud-chip:hover { background: rgba(0,0,0,0.04) !important; }
.mud-theme-dark .status-filter-pill.mud-chip:hover { background: rgba(255,255,255,0.05) !important; }
.status-filter-pill.mud-chip.mud-chip-selected {
    background: var(--brand-surface) !important;
    color: var(--brand-fg) !important;
    box-shadow: var(--brand-shadow-sm) !important;
    font-weight: 600 !important;
}
.mud-theme-dark .status-filter-pill.mud-chip.mud-chip-selected {
    background: rgba(255,255,255,0.08) !important;
    color: #F5F5F5 !important;
}
.pill-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-inline-end: 8px;
    vertical-align: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}
.mud-theme-dark .pill-dot { box-shadow: 0 0 0 2px rgba(0,0,0,0.4); }
.pill-dot--neutral { background: var(--brand-fg-muted); }
.pill-dot--info    { background: var(--mud-palette-info); }
.pill-dot--warning { background: var(--mud-palette-warning); }
.pill-dot--success { background: var(--mud-palette-success); }
.pill-dot--error   { background: var(--mud-palette-error); }
.pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 7px;
    margin-inline-start: 8px;
    background: rgba(0,0,0,0.06);
    color: var(--brand-fg);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    font-feature-settings: "tnum";
}
.mud-theme-dark .pill-count {
    background: rgba(255,255,255,0.10);
    color: #F5F5F5;
}
/* Inactive — count badges get a tinted background per status, so each chip is
   visually distinguishable at a glance (the small dot alone wasn't enough). */
.status-filter-pill:has(.pill-dot--info)    .pill-count { background: rgba(54,137,222,0.18);  color: var(--mud-palette-info); }
.status-filter-pill:has(.pill-dot--warning) .pill-count { background: rgba(245,159,0,0.22);   color: #B45309; }
.status-filter-pill:has(.pill-dot--success) .pill-count { background: rgba(16,185,129,0.18);  color: var(--mud-palette-success); }
.status-filter-pill:has(.pill-dot--error)   .pill-count { background: rgba(220,38,38,0.18);   color: var(--mud-palette-error); }

.mud-theme-dark .status-filter-pill:has(.pill-dot--info)    .pill-count { background: rgba(96,165,250,0.22); color: #93C5FD; }
.mud-theme-dark .status-filter-pill:has(.pill-dot--warning) .pill-count { background: rgba(251,191,36,0.22); color: #FBBF24; }
.mud-theme-dark .status-filter-pill:has(.pill-dot--success) .pill-count { background: rgba(52,211,153,0.22); color: #6EE7B7; }
.mud-theme-dark .status-filter-pill:has(.pill-dot--error)   .pill-count { background: rgba(248,113,113,0.22); color: #FCA5A5; }

/* Active pill — badge picks up the SOLID dot color for instant scanning. These
   override the inactive tinted rules above. */
.status-filter-pill.mud-chip-selected .pill-count        { background: var(--brand-fg);          color: #fff; }
.status-filter-pill:has(.pill-dot--info).mud-chip-selected    .pill-count { background: var(--mud-palette-info);    color: #fff; }
.status-filter-pill:has(.pill-dot--warning).mud-chip-selected .pill-count { background: var(--mud-palette-warning); color: #1f1300; }
.status-filter-pill:has(.pill-dot--success).mud-chip-selected .pill-count { background: var(--mud-palette-success); color: #fff; }
.status-filter-pill:has(.pill-dot--error).mud-chip-selected   .pill-count { background: var(--mud-palette-error);   color: #fff; }
.mud-theme-dark .status-filter-pill.mud-chip-selected .pill-count { background: #F5F5F5; color: #0A0A0A; }
.mud-theme-dark .status-filter-pill:has(.pill-dot--warning).mud-chip-selected .pill-count { background: var(--mud-palette-warning); color: #1f1300; }

/* List summary bar above the grid */
.list-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 4px 10px;
    color: var(--brand-fg-muted);
    font-size: 0.82rem;
}
.list-summary strong {
    color: var(--brand-fg);
    font-weight: 600;
    font-feature-settings: "tnum";
}

/* ───────── Claim entry — meta header (replaces read-only inputs) ───────── */
.claim-meta-card {
    border: 1px solid var(--brand-border);
    background: var(--brand-surface);
    border-radius: var(--brand-radius);
}
.mud-theme-dark .claim-meta-card {
    background: var(--mud-palette-surface);
    border-color: rgba(255,255,255,0.06);
}
.meta-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.meta-field .meta-label {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--brand-fg-muted);
}
.meta-field .meta-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--brand-fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 24px;
    display: flex;
    align-items: center;
}
.meta-field .meta-value--muted { color: var(--brand-fg-muted); font-weight: 400; }
.meta-field .meta-value--strong { font-weight: 700; color: var(--brand-fg); }

/* ───────── Claim entry — totals card (right-aligned, primary-tinted) ───── */
.claim-totals-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}
.claim-totals-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 20px;
    min-width: 300px;
    background: var(--brand-primary-50);
    border: 1px solid var(--brand-primary-100);
    border-radius: var(--brand-radius);
}
.mud-theme-dark .claim-totals-card {
    background: rgba(52,211,153,0.08);
    border-color: rgba(52,211,153,0.20);
}
.claim-totals-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: baseline;
}
.claim-totals-row .label { color: var(--brand-fg-muted); font-size: 0.82rem; }
.claim-totals-row .value { font-feature-settings: "tnum"; }
.claim-totals-grand {
    border-top: 1px solid rgba(0,0,0,0.06);
    padding-top: 8px;
    margin-top: 4px;
}
.mud-theme-dark .claim-totals-grand { border-top-color: rgba(255,255,255,0.10); }
.claim-totals-grand .label { font-weight: 600; color: var(--brand-fg); font-size: 0.9rem; }
.claim-totals-grand .value { font-size: 1.1rem; font-weight: 700; }

/* Empty-lines state inside the new-claim table */
.lines-empty {
    padding: 36px 16px;
    text-align: center;
}
.lines-empty .icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary-50);
    color: var(--brand-primary-darken);
    margin-bottom: 12px;
}
.mud-theme-dark .lines-empty .icon {
    background: rgba(52,211,153,0.10);
    color: #6EE7B7;
}
.lines-empty .title { font-weight: 600; color: var(--brand-fg); margin-bottom: 2px; }
.lines-empty .desc { font-size: 0.85rem; color: var(--brand-fg-muted); max-width: 360px; margin: 0 auto; }

/* Lines table — validation error state */
.lines-table--error { box-shadow: 0 0 0 2px var(--mud-palette-error) !important; border-radius: 4px; }
.lines-table--error .lines-empty .icon { background: rgba(239, 68, 68, 0.10); color: var(--mud-palette-error); }
.lines-table--error .lines-empty .title { color: var(--mud-palette-error); }
.lines-error-text { font-size: 0.75rem; color: var(--mud-palette-error); margin-top: 2px; padding-left: 14px; }

/* PDF status pill in lines table */
.pdf-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}
.pdf-status--ok   { background: var(--brand-primary-50); color: var(--brand-primary-darken); border: 1px solid var(--brand-primary-100); }
.pdf-status--miss { background: rgba(220,38,38,0.06);   color: #B91C1C;                  border: 1px solid rgba(220,38,38,0.18); }
.mud-theme-dark .pdf-status--ok   { background: rgba(52,211,153,0.10); color: #6EE7B7; border-color: rgba(52,211,153,0.25); }
.mud-theme-dark .pdf-status--miss { background: rgba(248,113,113,0.10); color: #FCA5A5; border-color: rgba(248,113,113,0.25); }

/* Form footer (claim entry actions) */
.entry-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 0 4px;
    border-top: 1px solid var(--brand-border-soft);
    margin-top: 12px;
}
.mud-theme-dark .entry-actions { border-top-color: rgba(255,255,255,0.06); }
