html, body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Theme bootstrap: this selector is active only between the first HTML parse and
   MudThemeProvider's first correct render. It prevents a white frame on dark-mode
   reloads without hiding the page or delaying first content. */
html[data-app-theme-boot="dark"],
html[data-app-theme-boot="dark"] body,
html[data-app-theme-boot="dark"] .mud-layout,
html[data-app-theme-boot="dark"] .mud-main-content {
    background-color: #32333d !important;
    color: #f5f5f5;
}

html[data-app-theme-boot="dark"] .mud-appbar {
    background-color: #27272f !important;
}

html[data-app-theme-boot="dark"] .mud-drawer,
html[data-app-theme-boot="dark"] .mud-drawer-content {
    background-color: #1a1f2b !important;
}

html[data-app-theme-boot="dark"] .mud-paper {
    background-color: #373740 !important;
    color: #f5f5f5;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    height: 36px;
    color: inherit;
    text-decoration: none;
}

.app-brand-icon,
.app-brand-wordmark {
    display: block;
    flex: 0 0 auto;
}

.app-brand-icon {
    width: 32px;
    height: 32px;
}

.app-brand-wordmark {
    width: 96px;
    height: 32px;
}

.app-brand-icon img,
.app-brand-wordmark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.app-brand--large {
    gap: 8px;
    height: 52px;
    margin-inline: auto;
}

.app-brand--large .app-brand-icon {
    width: 46px;
    height: 46px;
}

.app-brand--large .app-brand-wordmark {
    width: 142px;
    height: 48px;
}

.app-brand--large img {
    opacity: 0.94;
}

/* In navigation the brand behaves like the other app-bar content: a quiet,
   single-colour mark. The full-colour artwork remains available in large
   branding contexts such as the sign-in screen. */
.mud-appbar .app-brand:not(.app-brand--large) img {
    filter: brightness(0) invert(1);
    opacity: 0.86;
    transition: opacity 140ms ease;
}

.mud-appbar .app-brand:not(.app-brand--large):hover img,
.mud-appbar .app-brand:not(.app-brand--large):focus-visible img {
    opacity: 1;
}

.auth-page-container {
    padding-top: 56px !important;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 32px;
    border: 1px solid var(--mud-palette-lines-default);
}

.app-login-header {
    margin-bottom: 32px;
    text-align: center;
}

.app-login-header h1 {
    margin: 22px 0 4px;
    color: var(--mud-palette-text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
}

.app-login-header p {
    margin: 0;
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
}

.app-auth-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.app-auth-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.app-auth-field > label {
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
}

.app-auth-input.form-control {
    min-height: 38px;
    padding: 7px 0 6px;
    color: var(--mud-palette-text-primary);
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
}

.app-auth-options {
    margin-top: -4px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
}

.app-auth-options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.app-auth-submit {
    width: 100%;
    min-height: 40px;
    border: 0;
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: filter 140ms ease, box-shadow 140ms ease;
}

.app-auth-submit:hover {
    filter: brightness(0.94);
}

.app-auth-submit:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--mud-palette-primary) 45%, transparent);
    outline-offset: 2px;
}

.app-auth-validation-summary:empty {
    display: none;
}

.app-auth-validation-summary {
    color: var(--mud-palette-error);
    font-size: 0.8125rem;
}

.app-menu-form {
    margin: 0;
}

.app-menu-submit {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    background: transparent;
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.app-menu-submit:hover,
.app-menu-submit:focus-visible {
    background: var(--mud-palette-action-default-hover);
}

.app-menu-submit:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

.auth-culture-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.auth-culture-selector a {
    padding: 6px 2px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.auth-culture-selector a:hover,
.auth-culture-selector a:focus-visible,
.auth-culture-selector a.active {
    color: #fff;
}

.auth-culture-selector a.active {
    border-bottom: 2px solid rgba(255, 255, 255, 0.9);
}

@media (max-width: 600px) {
    .app-brand:not(.app-brand--large) .app-brand-wordmark {
        display: none;
    }

    .auth-page-container {
        padding: 24px 16px !important;
    }

    .auth-card {
        padding: 24px 20px;
    }
}

.company-edit-shell {
    overflow: hidden;
}

.company-edit-tabs .mud-tabs-tabbar {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.company-edit-tabs .mud-tabs-panels {
    min-height: 410px;
    padding: 28px 32px 32px !important;
}

.company-edit-actions {
    padding: 16px 24px;
}

.activity-history-expansion .mud-expand-panel {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
}

@media (max-width: 600px) {
    .company-edit-tabs .mud-tabs-panels {
        min-height: 0;
        padding: 20px 16px 24px !important;
    }

    .company-edit-actions {
        padding: 12px 16px;
    }
}

.app-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.app-error-page {
    max-width: 640px;
    margin: 10vh auto 0;
    text-align: center;
}

#blazor-error-ui .dismiss {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
}

.mud-icon-button:focus-visible,
.mud-nav-link:focus-visible,
.mud-button-root:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--mud-palette-primary) 55%, transparent);
    outline-offset: 2px;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

h1:focus {
    outline: none;
}

/* Keep Bootstrap validation styling on the static Identity forms only.
   Blazor also adds valid/invalid classes to MudBlazor component wrappers;
   applying a global outline there produced stray green/red slivers above
   selects such as Company and Direction. MudBlazor renders its own errors. */
.form-control.valid.modified:not([type=checkbox]),
.form-select.valid.modified {
    border-color: #26b050;
}

.form-control.invalid,
.form-select.invalid {
    border-color: #e50000;
}

/* Identity pages use Bootstrap inputs instead of MudBlazor. Keep them in the
   same borderless, underline-only form language as Variant.Text controls. */
.form-control,
.form-select {
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: #2E5A87;
    box-shadow: 0 2px 0 #2E5A87;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* Global search on the colored app bar: white text, underline, placeholder and the
   magnifier icon so the field matches the bar instead of the default dark input
   colors. */
.appbar-search .mud-input-slot,
.appbar-search .mud-input,
.appbar-search input {
    color: #fff !important;
    caret-color: #fff;
}

.appbar-search input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 1;
}

.appbar-search .mud-input-underline::before {
    border-bottom-color: rgba(255, 255, 255, 0.6) !important;
}

.appbar-search:hover .mud-input-underline::before,
.appbar-search .mud-input-underline::after {
    border-bottom-color: #fff !important;
}

.appbar-search .mud-input-adornment .mud-icon-root,
.appbar-search .mud-input-adornment svg {
    color: rgba(255, 255, 255, 0.85) !important;
    fill: rgba(255, 255, 255, 0.85) !important;
}

/* The notification count badge defaulted to top:-8px, so it was clipped above
   the fixed app bar (off the top of the window). Pull it down so the whole
   bubble sits inside the bar, still at the bell's top-right corner. */
.appbar-bell .mud-badge {
    top: 6px !important;
}

/* Dark side nav: the active link's default colour is the theme Primary, which is
   almost the drawer background — so give the active/hover links their own bright
   contrast (left accent bar + light text/icons) to stand out on the dark panel. */
.mud-drawer .mud-nav-link.active {
    background-color: rgba(255, 255, 255, 0.14) !important;
    border-left: 3px solid #7FB1E0;
    color: #ffffff !important;
}

.mud-drawer .mud-nav-link.active .mud-nav-link-icon,
.mud-drawer .mud-nav-link.active .mud-icon-root {
    color: #ffffff !important;
}

.mud-drawer .mud-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Extra-compact dense tables app-wide: tighter row height + header padding
   so long lists (invoices, stock, statements) fit more rows on screen. */
.mud-table-dense .mud-table-cell {
    padding-top: 3px;
    padding-bottom: 3px;
}

.mud-table-dense .mud-table-cell.mud-table-cell-hide + .mud-table-cell {
    padding-left: 8px;
}

.mud-table-dense th.mud-table-cell {
    padding-top: 4px;
    padding-bottom: 4px;
}

/* Date filters need room for the localized date, calendar button and optional
   clear button. Fixed 150/160px fields clipped their content in toolbars. */
.app-date-filter {
    flex: 0 0 220px;
    width: 220px;
    min-width: 220px;
    max-width: 100%;
}

.app-date-range-filter {
    flex: 0 1 340px;
    width: 340px;
    min-width: 300px;
    max-width: 100%;
}

/* A pager with no enabled navigation action represents a single page (or an
   empty table). Keep pagination chrome only when it can actually navigate. */
.mud-table-pagination:not(:has(.mud-icon-button:not(:disabled))) {
    display: none;
}

/* Wrapped filter rows should turn date controls into comfortable full-width
   fields on phones instead of leaving a clipped field at the row edge. */
@media (max-width: 600px) {
    .mud-main-content > .mud-container {
        padding: 16px 12px !important;
    }

    .mud-appbar .mud-icon-button {
        padding: 8px;
    }

    .app-filter-bar {
        align-items: stretch !important;
    }

    .app-filter-bar > .app-date-filter {
        flex-basis: 100%;
        width: 100%;
        min-width: 0;
    }

    .app-date-range-filter {
        flex-basis: 100%;
        width: 100%;
        min-width: 0;
    }
}

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

/* Shared page anatomy: a consistent heading/action area and a quiet filter
   surface that separates controls from the data below. */
.app-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.app-page-heading {
    min-width: 0;
}

.app-page-heading .mud-typography-body2 {
    margin-top: 4px;
    color: var(--mud-palette-text-secondary);
}

.app-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.app-filter-panel {
    margin-bottom: 16px;
    padding: 10px 12px 12px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-surface);
}

.app-filter-panel-head {
    display: flex;
    min-height: 28px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.app-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-size: .75rem;
    font-weight: 700;
}

.app-filter-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.app-filter-controls--end {
    justify-content: flex-end;
}

.app-filter-push-right {
    margin-left: auto;
}

/* Compact selectors used next to import/upload actions. A stable width keeps
   long company/account names readable without letting Mud inputs fill the row. */
.app-import-selector {
    flex: 0 1 320px;
    width: 320px;
    min-width: 280px;
    max-width: 100%;
}

.app-import-selector > .mud-input-control,
.app-import-selector > .mud-select,
.app-import-selector > .mud-autocomplete {
    width: 100%;
}

.app-quick-dates {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding-left: 4px;
    border-left: 1px solid var(--mud-palette-lines-default);
}

/* Data tables: stable headers, clearer row focus and a contained surface. */
.app-data-table {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-surface);
}

.app-data-table thead th {
    position: sticky;
    /* The MudTable container is itself the sticky containing block. A 48px
       offset pushed the first body row under the header and exposed only the
       top edge of status chips (the stray green/blue line above the table). */
    top: 0;
    z-index: 2;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-secondary);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.app-data-table .app-row-actions {
    opacity: .35;
    transition: opacity 120ms ease;
}

.app-data-table tbody tr:hover .app-row-actions,
.app-data-table tbody tr:focus-within .app-row-actions {
    opacity: 1;
}

.app-data-table tbody tr {
    transition: background-color 120ms ease, box-shadow 120ms ease;
}

.app-data-table tbody tr:hover {
    background: var(--mud-palette-action-default-hover) !important;
    box-shadow: inset 3px 0 0 var(--mud-palette-primary);
}

/* Management cards replace fragile responsive tables on the small, high-value
   company/user/rate screens. Records stay readable at every viewport width. */
.company-card,
.user-card,
.rate-card {
    height: 100%;
    border: 1px solid var(--mud-palette-lines-default);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.company-card:hover,
.user-card:hover,
.rate-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--mud-palette-primary) 55%, var(--mud-palette-lines-default));
    box-shadow: var(--mud-elevation-4);
}

.rate-hero {
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 30%, var(--mud-palette-lines-default));
    border-radius: var(--mud-default-borderradius);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--mud-palette-primary) 9%, var(--mud-palette-surface)),
        var(--mud-palette-surface));
}

.rate-card .mud-typography-h5 {
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

/* Invoice lines use explicit captions instead of floating labels. Long Turkish
   and German labels therefore never overlap values in narrow numeric fields. */
.invoice-line-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    background: color-mix(in srgb, var(--mud-palette-surface) 96%, var(--mud-palette-primary));
}

.invoice-line-main {
    display: grid;
    grid-template-columns: minmax(190px, 1.4fr) minmax(220px, 2fr) 90px 120px 90px 110px 40px;
    gap: 12px;
    align-items: end;
}

.invoice-line-field {
    min-width: 0;
}

.invoice-line-field > .mud-typography-caption,
.invoice-line-total > .mud-typography-caption {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.invoice-line-total {
    align-self: end;
    padding-bottom: 8px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.invoice-line-delete {
    align-self: end;
    margin-bottom: 2px;
}

.invoice-line-tax-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

/* Editor pattern: fields use the app-wide Text variant and explicit density;
   this class owns only layout so input semantics remain visible in Razor. */
.app-form-card .mud-input-control,
.invoice-line-card .mud-input-control {
    min-width: 0;
}

.app-form-actions {
    justify-content: flex-end;
    margin-top: 8px;
}

.shipment-packing-line {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 120px auto;
    gap: 12px;
    align-items: end;
}

.price-list-add-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 140px auto;
    gap: 12px;
    align-items: end;
}

@media (max-width: 1200px) {
    .invoice-line-main {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .invoice-line-product,
    .invoice-line-description {
        grid-column: span 3;
    }

    .invoice-line-main > .invoice-line-field:not(.invoice-line-product):not(.invoice-line-description) {
        grid-column: span 1;
    }

    .invoice-line-tax-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 700px) {
    .invoice-line-main,
    .invoice-line-tax-grid {
        grid-template-columns: 1fr;
    }

    .invoice-line-product,
    .invoice-line-description,
    .invoice-line-main > .invoice-line-field:not(.invoice-line-product):not(.invoice-line-description) {
        grid-column: auto;
    }

    .invoice-line-total {
        text-align: left;
    }

    .invoice-line-delete {
        justify-self: end;
    }

    .shipment-packing-line {
        grid-template-columns: minmax(0, 1fr) 100px auto;
        margin-left: 0 !important;
    }

    .price-list-add-row {
        grid-template-columns: 1fr;
    }

    .price-list-add-row .mud-input-control {
        max-width: none !important;
    }

    .app-form-actions {
        flex-wrap: wrap;
    }

    .app-form-actions .mud-button-root {
        flex: 1 1 140px;
    }
}

.app-kpi-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.app-kpi-card {
    height: 100%;
    border: 1px solid var(--mud-palette-lines-default);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.app-kpi-link:hover .app-kpi-card,
.app-kpi-link:focus-visible .app-kpi-card {
    transform: translateY(-2px);
    border-color: var(--mud-palette-primary);
    box-shadow: var(--mud-elevation-4);
}

.app-dashboard-value-link {
    color: var(--mud-palette-primary);
    font-weight: 600;
    text-decoration: none;
}

.app-dashboard-value-link:hover,
.app-dashboard-value-link:focus-visible {
    text-decoration: underline;
}

.app-dashboard-value-link.success {
    color: var(--mud-palette-success);
}

.app-dashboard-value-link.error {
    color: var(--mud-palette-error);
}

@media (max-width: 600px) {
    .app-page-header {
        display: block;
        margin-bottom: 18px;
    }

    .app-page-actions {
        justify-content: flex-start;
        margin-top: 14px;
    }

    .mud-dialog-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .mud-dialog-actions .mud-button-root {
        flex: 1 1 140px;
    }

    .app-filter-panel {
        padding: 10px;
    }

    .app-filter-controls > .mud-input-control,
    .app-filter-controls > .mud-picker {
        width: 100% !important;
        max-width: none !important;
    }

    .app-filter-push-right {
        margin-left: 0;
    }

    .app-import-selector {
        flex-basis: 100%;
        width: 100%;
        min-width: 0;
    }

    .app-quick-dates {
        width: 100%;
        padding-top: 8px;
        padding-left: 0;
        border-top: 1px solid var(--mud-palette-lines-default);
        border-left: 0;
    }

    /* MudTable switches to labelled rows at Breakpoint.Sm. Make each row read
       as a separate, touch-friendly card instead of a collapsed desktop row. */
    .app-data-table .mud-table-body .mud-table-row {
        display: block;
        margin: 10px;
        overflow: hidden;
        border: 1px solid var(--mud-palette-lines-default);
        border-radius: var(--mud-default-borderradius);
        box-shadow: var(--mud-elevation-1);
    }

    .app-data-table .mud-table-body .mud-table-cell {
        min-height: 42px;
        padding: 8px 12px;
    }

    .app-data-table .app-row-actions {
        opacity: 1;
    }

    .app-data-table tbody tr:hover {
        box-shadow: var(--mud-elevation-2);
    }
}
