.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

html, body, #app {
    height: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
}

body {
    margin: 0;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            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: #c02d76;
}

.theme-solid {
    --bg-primary: #05070b;
    --bg-surface: #111827;
    --bg-surface-2: #0b1220;
    --border-color: #1f2937;
    --text-primary: #f8fafc;
    --text-muted: #cbd5e1;
    --accent: linear-gradient(135deg, #6366f1, #8b5cf6);
    --accent-hover: linear-gradient(135deg, #4f46e5, #7c3aed);
    --blur-amount: 0px;
    --card-opacity: 1;
}

.theme-solid-light {
    --bg-primary: #f5f5f5;
    --bg-surface: #ffffff;
    --bg-surface-2: #f1f5f9;
    --border-color: #dbe4ee;
    --text-primary: #0f172a;
    --text-muted: #475569;
    --accent: linear-gradient(135deg, #4f46e5, #7c3aed);
    --accent-hover: linear-gradient(135deg, #4338ca, #6d28d9);
    --blur-amount: 0px;
    --card-opacity: 1;
}

.theme-glass {
    --bg-primary:
        radial-gradient(700px 420px at 10% 12%, rgba(244, 114, 182, 0.35), transparent 62%),
        radial-gradient(640px 400px at 88% 16%, rgba(129, 140, 248, 0.35), transparent 62%),
        radial-gradient(760px 440px at 16% 88%, rgba(192, 132, 252, 0.28), transparent 64%),
        radial-gradient(720px 420px at 88% 88%, rgba(244, 114, 182, 0.25), transparent 64%),
        linear-gradient(160deg, #eaf6ff 0%, #eff8ff 45%, #f6fbff 100%);
    --bg-surface: rgba(255, 255, 255, 0.42);
    --bg-surface-2: rgba(255, 255, 255, 0.36);
    --border-color: rgba(255, 255, 255, 0.58);
    --text-primary: #0f172a;
    --text-muted: rgba(30, 41, 59, 0.85);
    --accent: linear-gradient(135deg, #38bdf8, #a78bfa, #f472b6);
    --accent-hover: linear-gradient(135deg, #0ea5e9, #8b5cf6, #ec4899);
    --blur-amount: 24px;
    --card-opacity: 0.12;
}

.app-background {
    min-height: 100vh;
    height: 100vh;
    background: var(--bg-primary, #0f172a);
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

.theme-glass.app-background::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.48), transparent 40%),
        linear-gradient(300deg, rgba(255, 255, 255, 0.34), transparent 46%);
    mix-blend-mode: screen;
    opacity: 0.6;
    z-index: 0;
}

.theme-glass.app-background > * {
    position: relative;
    z-index: 1;
}

.app-background .mud-layout,
.app-background .mud-main-content,
.app-background .mud-container {
    background: transparent !important;
}

.app-background .mud-layout {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-background .mud-main-content {
    min-height: 0;
    overflow-y: hidden;
    overflow-x: hidden;
}

.app-background .mud-main-content.main-shell {
    margin-top: 64px;
    height: calc(100vh - 64px);
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
    scrollbar-gutter: stable both-edges;
    padding-bottom: 16px;
}

.app-background .mud-paper,
.app-background .mud-table-container,
.app-background .mud-drawer,
.app-background .mud-appbar,
.app-background .mud-popover {
    background: var(--bg-surface, #1e293b) !important;
    border: 1px solid var(--border-color, #334155);
    backdrop-filter: blur(var(--blur-amount, 0px));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.app-background .mud-drawer,
.app-background .mud-appbar {
    background: var(--bg-surface-2, #111827) !important;
}

.app-background .custom-drawer .mud-drawer-paper {
    top: 64px !important;
    height: calc(100vh - 64px) !important;
    padding-bottom: 10px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-background .custom-drawer .mud-drawer-paper::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.app-background .custom-drawer .mud-navmenu {
    min-height: 100%;
}

.theme-solid .mud-paper,
.theme-solid .mud-table-container,
.theme-solid .mud-drawer,
.theme-solid .mud-appbar,
.theme-solid .mud-popover {
    box-shadow: none !important;
    background: #111827 !important;
    border-color: #1f2937 !important;
}

.theme-solid-light .mud-paper,
.theme-solid-light .mud-table-container,
.theme-solid-light .mud-drawer,
.theme-solid-light .mud-appbar,
.theme-solid-light .mud-popover {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
    background: #ffffff !important;
    border-color: #dbe4ee !important;
}

.theme-solid .mud-main-content,
.theme-solid .mud-container {
    background: #05070b !important;
}

.theme-solid-light .mud-main-content,
.theme-solid-light .mud-container {
    background: #f5f5f5 !important;
}

.theme-solid .mud-nav-link-text,
.theme-solid .mud-nav-link .mud-nav-link-text,
.theme-solid .mud-typography,
.theme-solid .mud-input,
.theme-solid .mud-input-label {
    color: #f8fafc !important;
}

.theme-solid .mud-input-helper-text,
.theme-solid .mud-caption-text,
.theme-solid .mud-input-slot,
.theme-solid .mud-select-input,
.theme-solid input,
.theme-solid textarea {
    color: #e5e7eb !important;
}

.theme-solid input::placeholder,
.theme-solid textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

.theme-solid .mud-tabs-toolbar,
.theme-solid .mud-tabs-tabbar {
    background: #0f172a !important;
    border-color: #1f2937 !important;
}

.theme-solid .mud-tab {
    color: #cbd5e1 !important;
}

.theme-solid .mud-tab.mud-tab-active {
    color: #f8fafc !important;
}

.theme-solid .mud-table-container,
.theme-solid .mud-simple-table {
    background: #111827 !important;
}

.theme-solid .mud-table-root .mud-table-head .mud-table-cell,
.theme-solid .mud-table-root .mud-table-body .mud-table-cell,
.theme-solid .mud-table-root .mud-table-foot .mud-table-cell,
.theme-solid .mud-simple-table thead th,
.theme-solid .mud-simple-table tbody td {
    color: #e5e7eb !important;
    border-color: #273449 !important;
}

.theme-solid .mud-table-root .mud-table-head .mud-table-cell,
.theme-solid .mud-simple-table thead th {
    color: #f8fafc !important;
    font-weight: 600;
}

.theme-solid .mud-table-root tr:hover td,
.theme-solid .mud-simple-table tbody tr:hover td {
    background: rgba(148, 163, 184, 0.08) !important;
}

.theme-solid .mud-card,
.theme-solid .mud-card-content,
.theme-solid .mud-card-header {
    color: #f8fafc !important;
    background: #0f172a !important;
}

.theme-solid .mud-chip {
    color: #e2e8f0 !important;
    background: #1e293b !important;
}

.theme-solid .mud-icon-root,
.theme-solid .mud-icon-button {
    color: #e5e7eb !important;
}

/* Mud dialogs/popovers are rendered outside layout tree; use :has to style in dark mode */
body:has(.theme-solid) .mud-dialog {
    background: #111827 !important;
    color: #f8fafc !important;
    border: 1px solid #273449 !important;
}

body:has(.theme-solid) .mud-dialog .mud-paper,
body:has(.theme-solid) .mud-dialog .mud-card,
body:has(.theme-solid) .mud-dialog .mud-card-content {
    background: #111827 !important;
    color: #f8fafc !important;
}

body:has(.theme-solid) .mud-popover {
    background: #111827 !important;
    color: #f8fafc !important;
    border: 1px solid #273449 !important;
}

.theme-solid-light .mud-nav-link-text,
.theme-solid-light .mud-nav-link .mud-nav-link-text,
.theme-solid-light .mud-typography,
.theme-solid-light .mud-input,
.theme-solid-light .mud-input-label {
    color: #0f172a !important;
}

/* Force true MudBlazor-like light mode visuals */
.theme-solid-light.app-background {
    background: #f5f5f5 !important;
}

.theme-solid-light .mud-appbar {
    background: #594ae2 !important;
    color: #ffffff !important;
    border: none !important;
}

.theme-solid-light .mud-appbar .mud-typography,
.theme-solid-light .mud-appbar .mud-icon-root,
.theme-solid-light .mud-appbar .mud-button-label {
    color: #ffffff !important;
}

.theme-solid-light .mud-drawer {
    background: #ffffff !important;
    border-right: 1px solid #e5e7eb !important;
}

.theme-solid-light .mud-paper,
.theme-solid-light .mud-table-container,
.theme-solid-light .mud-popover {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
}

.theme-glass .mud-paper,
.theme-glass .mud-table-container,
.theme-glass .mud-drawer,
.theme-glass .mud-appbar,
.theme-glass .mud-popover {
    background: rgba(255, 255, 255, 0.24) !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    backdrop-filter: blur(20px) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(255, 255, 255, 0.28),
        0 10px 28px rgba(15, 23, 42, 0.14) !important;
}

.theme-glass .mud-drawer,
.theme-glass .mud-appbar {
    background: rgba(255, 255, 255, 0.28) !important;
}

.theme-glass .mud-paper,
.theme-glass .mud-table-container {
    border-radius: 14px;
}

.app-background .mud-typography,
.app-background .mud-input,
.app-background .mud-input-label,
.app-background .mud-button-label,
.app-background .mud-nav-link {
    color: var(--text-primary, #e2e8f0) !important;
}

.app-background .mud-nav-link-text,
.app-background .mud-caption-text,
.app-background .mud-input-helper-text {
    color: var(--text-muted, #94a3b8) !important;
}

.app-background .mud-button-filled-primary,
.app-background .mud-button-filled-secondary {
    background: var(--accent) !important;
}

.app-background .mud-button-filled-primary:hover,
.app-background .mud-button-filled-secondary:hover {
    background: var(--accent-hover) !important;
}

.theme-tab-shell {
    background: var(--bg-surface);
    border-color: var(--border-color) !important;
}

.theme-choice {
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-2);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-choice:hover {
    transform: translateY(-2px);
}

.theme-choice.active {
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.35);
}

/* 3D colorful vertical menu icons */
.custom-drawer .mud-nav-link-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-right: 10px;
    background: linear-gradient(145deg, #22d3ee 0%, #6366f1 55%, #ec4899 100%) !important;
    box-shadow:
        0 8px 16px rgba(99, 102, 241, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.26);
    transform: translateZ(0);
}

.custom-drawer .mud-nav-link-icon .mud-icon-root,
.custom-drawer .mud-nav-link-icon .mud-icon-size-medium,
.custom-drawer .mud-nav-link-icon svg {
    color: #ffffff !important;
    fill: currentColor !important;
    font-size: 20px !important;
}

.custom-drawer .mud-nav-link.mud-nav-link-active .mud-nav-link-icon {
    background: linear-gradient(145deg, #38bdf8 0%, #4f46e5 50%, #db2777 100%) !important;
    box-shadow:
        0 10px 20px rgba(79, 70, 229, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(0, 0, 0, 0.26);
}

.custom-drawer .mud-nav-link:hover .mud-nav-link-icon {
    filter: saturate(1.08) brightness(1.03);
    transform: translateY(-1px);
}

.theme-preview {
    border-radius: 10px;
    padding: 12px;
    border: 1px solid transparent;
}

.theme-preview-solid {
    background: #0f172a;
    border-color: #334155;
}

.theme-preview-glass {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.55), rgba(79, 70, 229, 0.55), rgba(236, 72, 153, 0.55));
    border-color: rgba(255, 255, 255, 0.25);
}

.theme-preview-light {
    background: #f8fafc;
    border-color: #dbe2ea;
}

.theme-preview-line {
    height: 10px;
    border-radius: 6px;
    background: var(--accent);
    margin-bottom: 10px;
}

.theme-preview-chip {
    width: 80px;
    height: 20px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
    margin-bottom: 10px;
}

.theme-preview-block {
    height: 44px;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.2);
}

.pos-tile-preview-shell {
    padding: 12px;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-surface-2);
}

.pos-tile-preview {
    min-height: 84px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    color: #fff;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.pos-tile-preview-theme {
    background: var(--accent);
}

.pos-tile-preview-data {
    background: #e91e63;
}

.pos-tile-mode-card {
    border-color: var(--border-color) !important;
    background: var(--bg-surface-2) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pos-tile-mode-card.active {
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.25);
}

.theme-glass .pos-tile-preview-theme {
    background:
        linear-gradient(160deg, rgba(255,255,255,0.78) 0%, rgba(255,255,255,0.28) 34%, rgba(255,255,255,0.10) 100%),
        linear-gradient(135deg, #93e2ff 0%, #b9a6ff 52%, #ffc2e2 100%);
    border: 1px solid rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.92),
        inset 0 -1px 0 rgba(255,255,255,0.25),
        0 10px 22px rgba(79, 70, 229, 0.22);
}

/* Keep POS tile text/icons readable and identical to preview style when Theme colors is selected */
.pos-theme-colored-tile .mud-typography,
.pos-theme-colored-tile .mud-icon-root,
.pos-theme-colored-tile .mud-icon-size-large,
.pos-theme-colored-tile span {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.28);
}

.pos-tile-card {
    transition: transform 0.16s ease, filter 0.16s ease;
}

.pos-tile-card:hover {
    transform: translateY(-3px);
}

.pos-tile-card-theme .pos-theme-colored-tile {
    transition: box-shadow 0.18s ease, filter 0.18s ease, transform 0.18s ease;
}

.pos-tile-card-theme:hover .pos-theme-colored-tile {
    filter: saturate(1.07) brightness(1.04);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(255, 255, 255, 0.3),
        0 12px 24px rgba(79, 70, 229, 0.24) !important;
}

.theme-glass .pos-tile-card-theme:hover .pos-theme-colored-tile {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.98),
        inset 0 -1px 0 rgba(255, 255, 255, 0.35),
        0 14px 28px rgba(99, 102, 241, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.42) !important;
}
