/* StockMirror app shell — global so child components (sidebar/topbar) receive styles */

:root {
    --sm-surface: #f4f6f8;
    --sm-sidebar-w: 256px;
    --sm-sidebar-current: 256px;
    --sm-accent: #0d6efd;
    --sm-card-radius: 0.75rem;
    --sm-text: #0f172a;
    --sm-text-muted: #64748b;
    --sm-link: #475569;
    --sm-link-hover: #0d6efd;
}

html, body {
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    background: var(--sm-surface);
    color: var(--sm-text);
}

/* Modern default links — not 1990s blue underline */
a {
    color: var(--sm-link);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--sm-link-hover);
}

a:focus-visible {
    outline: 2px solid rgba(13, 110, 253, 0.45);
    outline-offset: 2px;
    border-radius: 2px;
}

.sm-link {
    color: var(--sm-link);
    font-weight: 500;
}

.sm-link:hover {
    color: var(--sm-link-hover);
}

.btn-link {
    color: var(--sm-link);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--sm-link-hover);
}

.btn-primary {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.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 rgba(13, 110, 253, 0.35);
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* Global — MainLayout + AuthLayout (layout-scoped CSS does not hide auth banner). */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

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

/* TOTP QR — library SVG has viewBox only; give it an explicit scan size */
.authenticator-qr svg {
    display: block;
    width: 180px;
    height: 180px;
}

/* ——— Shell split (sidebar + resizable divider + main) ——— */

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: var(--sm-surface);
}

.app-shell__sidebar {
    position: relative;
    flex: 0 0 var(--sm-sidebar-current);
    width: var(--sm-sidebar-current);
    max-width: var(--sm-sidebar-current);
    background: #fff;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    transition: flex-basis 0.22s ease, width 0.22s ease, max-width 0.22s ease;
    z-index: 20;
}

.app-shell__sidebar-inner {
    width: var(--sm-sidebar-current);
    min-width: var(--sm-sidebar-current);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-shell__splitter {
    position: absolute;
    top: 0;
    right: -2px;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    z-index: 30;
    background: transparent;
    transition: background 0.15s ease;
}

.app-shell__splitter:hover,
.app-shell--resizing .app-shell__splitter {
    background: rgba(13, 110, 253, 0.35);
}

.app-shell--collapsed .app-shell__sidebar {
    flex-basis: 0 !important;
    width: 0 !important;
    max-width: 0 !important;
    border-right: none;
    overflow: hidden;
}

.app-shell--collapsed .app-shell__splitter {
    display: none;
}

.app-shell__main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-shell__backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 15;
}

.app-shell__backdrop.is-visible {
    display: block;
}

@media (max-width: 991.98px) {
    .app-shell__sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: none;
    }

    .app-shell--mobile-open .app-shell__sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
    }

    .app-shell__splitter {
        display: none;
    }
}

.app-shell__content {
    flex: 1;
    background: var(--sm-surface);
    padding: 1.25rem 1.5rem 2rem;
}

.sm-page {
    width: 100%;
    padding-inline: 0.25rem;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.app-topbar__actions {
    --sm-topbar-control-h: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.app-topbar__actions > .dropdown {
    display: flex;
    align-items: center;
    height: var(--sm-topbar-control-h);
}

.app-lang {
    display: flex;
    align-items: center;
    height: var(--sm-topbar-control-h);
}

.app-lang__form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    margin: 0;
    height: var(--sm-topbar-control-h);
    padding: 0 0.3rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-sizing: border-box;
}

.app-lang__btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0.15rem;
    border-radius: 0.3rem;
    line-height: 0;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.app-lang__btn:hover {
    opacity: 0.9;
    background: rgba(13, 110, 253, 0.06);
}

.app-lang__btn.is-active {
    opacity: 1;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.app-lang__flag {
    display: block;
    width: 1.25rem;
    height: 0.84rem;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.app-lang__flag svg {
    display: block;
    width: 100%;
    height: 100%;
}

.app-topbar__notify.e-btn,
.app-topbar__notify.e-btn.e-flat {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--sm-topbar-control-h) !important;
    height: var(--sm-topbar-control-h) !important;
    min-height: var(--sm-topbar-control-h) !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    border-radius: 0.5rem !important;
    box-sizing: border-box !important;
    vertical-align: middle;
}

.app-topbar__notify .e-btn-content,
.app-topbar__notify .e-btn-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.app-topbar__notify .e-icons {
    display: block;
    line-height: 1;
    margin: 0;
    font-size: 1.1rem !important;
}

.app-topbar__user {
    display: inline-flex !important;
    align-items: center;
    height: var(--sm-topbar-control-h) !important;
    min-height: var(--sm-topbar-control-h) !important;
    max-width: 220px;
    padding: 0 0.7rem !important;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1 !important;
    border-radius: 0.5rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

.app-topbar__title {
    font-size: 1.125rem;
    font-weight: 650;
    color: var(--sm-text);
    line-height: 1.3;
}

.app-topbar__menu {
    border: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* Desktop: hide control is in the sidebar; topbar hamburger only when collapsed */
@media (min-width: 992px) {
    .app-shell:not(.app-shell--collapsed) .app-topbar__menu {
        display: none;
    }
}

.app-sidebar__collapse {
    flex: 0 0 auto;
    width: var(--sm-control-h, 2rem);
    height: var(--sm-control-h, 2rem);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.uikit-sidebar-brand img {
    flex: 0 0 auto;
}

.uikit-sidebar-brand .app-shell__brand-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    margin-top: 0.2rem;
}

.app-crumb__sep {
    display: inline-flex;
    align-items: center;
    color: #cbd5e1;
    user-select: none;
    margin-inline: 0.05rem;
}

.app-crumb__link {
    color: var(--sm-text-muted);
    font-weight: 500;
    padding: 0.1rem 0.35rem;
    border-radius: 0.35rem;
    transition: color 0.15s ease, background 0.15s ease;
}

.app-crumb__link:hover {
    color: var(--sm-link-hover);
    background: rgba(13, 110, 253, 0.06);
}

.app-crumb__link.active {
    color: var(--sm-text-muted);
    background: transparent;
}

.app-crumb__current {
    color: var(--sm-text);
    font-weight: 600;
    padding: 0.1rem 0.35rem;
}

.uikit-topbar-badge {
    font-size: 0.65rem;
}

/* ——— Sidebar nav ——— */

.uikit-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem 1rem;
    width: 100%;
    box-sizing: border-box;
}

.uikit-sidebar-nav__link {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.6rem 0.85rem;
    border-radius: 0.5rem;
    color: #475569 !important;
    text-decoration: none !important;
    white-space: nowrap;
    border-left: 3px solid transparent;
    box-sizing: border-box;
}

.uikit-sidebar-nav__link:hover {
    background: #f1f5f9;
    color: #0f172a !important;
}

.uikit-sidebar-nav__link.active {
    background: #eff6ff;
    color: #0d6efd !important;
    font-weight: 600;
    border-left-color: #0d6efd;
}

.uikit-sidebar-nav__link .e-icons {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
}

.uikit-sidebar-nav__section {
    margin: 0.85rem 0.85rem 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.app-shell--collapsed .uikit-sidebar-nav__section {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
}

.app-shell--collapsed .app-shell__brand-text,
.app-shell--collapsed .app-shell__nav-label {
    opacity: 0;
}

.uikit-sidebar-brand {
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.uikit-sidebar-brand img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.uikit-sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Auth — split: mirror feature panel + form */
.uikit-auth-layout {
    display: flex;
    flex-wrap: wrap;
    min-height: 100vh;
    min-height: 100dvh;
    background: #fff;
}

.uikit-auth-feature {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 38%;
    min-width: 0;
    overflow: hidden;
    background: #05070c;
    box-sizing: border-box;
    padding: 2.5rem 1.75rem;
}

.uikit-auth-feature__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 55% at 30% 35%, rgba(56, 189, 248, 0.28), transparent 62%),
        radial-gradient(ellipse 65% 50% at 72% 68%, rgba(74, 222, 128, 0.22), transparent 60%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(34, 211, 238, 0.12), transparent 70%),
        linear-gradient(160deg, rgba(14, 165, 233, 0.14) 0%, transparent 42%, rgba(34, 197, 94, 0.12) 100%);
}

.uikit-auth-feature__slogan {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: 16.5rem;
    text-align: center;
    font-size: clamp(0.92rem, 1.15vw, 1.05rem);
    font-weight: 450;
    line-height: 1.55;
    letter-spacing: 0.01em;
    color: rgba(226, 232, 240, 0.82);
    text-shadow: 0 1px 18px rgba(0, 0, 0, 0.45);
}

.uikit-auth-form-col {
    flex: 1 1 52%;
    min-width: 0;
    background: #fff;
}

.uikit-auth-form-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    min-height: 100%;
    padding: clamp(2.75rem, 10vh, 5.5rem) 1.5rem 4.5rem;
}

.uikit-auth-form-panel {
    width: 100%;
    max-width: 24rem;
}

.uikit-auth-form-footer {
    margin-top: 1.5rem !important;
}

.uikit-auth-lang {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}

.app-brand-mark {
    display: block;
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    flex: 0 0 auto;
}

.uikit-sidebar-brand .app-brand-mark {
    width: 2rem;
    height: 2rem;
}

@media (min-width: 992px) {
    .uikit-auth-layout {
        flex-wrap: nowrap;
        align-items: stretch;
    }

    .uikit-auth-feature {
        flex: 0 0 40%;
        max-width: 40%;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .uikit-auth-form-col {
        flex: 1 1 auto;
    }

    .uikit-auth-form-stage {
        min-height: 100vh;
        min-height: 100dvh;
        padding: clamp(3rem, 11vh, 6rem) 2rem 5rem;
    }
}

@media (max-width: 991.98px) {
    .uikit-auth-feature {
        order: 2;
        flex: 1 1 100%;
        min-height: 11rem;
        padding: 2rem 1.5rem;
    }

    .uikit-auth-form-col {
        order: 1;
        flex: 1 1 100%;
    }

    .uikit-auth-form-stage {
        min-height: auto;
        padding: 3rem 1.15rem 3.5rem;
    }

    .uikit-auth-feature__slogan {
        max-width: 22rem;
    }
}

/* Account manage sub-nav — match app link style */
.nav-pills .nav-link {
    color: var(--sm-link);
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.5rem 0.85rem;
}

.nav-pills .nav-link:hover {
    color: var(--sm-link-hover);
    background: rgba(13, 110, 253, 0.06);
}

.nav-pills .nav-link.active {
    color: #0d6efd;
    background: #eff6ff;
    font-weight: 600;
}


.sm-welcome__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.sm-welcome__meta {
    font-size: 0.9rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-header__title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    color: #0f172a;
}

.page-header__subtitle {
    font-size: 0.95rem;
    max-width: 42rem;
}

.stat-card {
    border-radius: var(--sm-card-radius) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.stat-cards > :nth-child(1) .stat-card {
    background: #eef3f8;
    border-color: rgba(70, 100, 130, 0.12) !important;
}

.stat-cards > :nth-child(2) .stat-card {
    background: #f4f1ea;
    border-color: rgba(120, 100, 70, 0.14) !important;
}

.stat-cards > :nth-child(3) .stat-card {
    background: #eef6f1;
    border-color: rgba(60, 100, 80, 0.14) !important;
}

.stat-cards > :nth-child(4) .stat-card {
    background: #f7f0e8;
    border-color: rgba(150, 110, 60, 0.16) !important;
}

.stat-cards > :nth-child(5) .stat-card {
    background: #f1f2f4;
    border-color: rgba(80, 90, 100, 0.12) !important;
}

.stat-card .card-body {
    padding: 1.15rem 1.25rem;
    min-height: 6.75rem;
}

.stat-cards {
    --bs-gutter-x: 1rem;
}

.stat-card__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b !important;
    font-weight: 600;
}

.stat-card__value {
    font-size: 1.65rem;
    font-weight: 700;
    margin-top: 0.35rem;
    color: #0f172a;
    line-height: 1.2;
}

.stat-card__sub {
    margin-top: 0.35rem;
}

/* Shared SfGrid chrome: compact rows + zebra (inventura, catalogue, …) */
.sm-data-grid {
    width: 100%;
}

.sm-data-grid .e-grid {
    width: 100%;
}

/*
 * Intentional grid sizing (Inventory + Catalogue). Do not remove casually.
 * GridColumn Width is omitted so Syncfusion natively equal-fills visible columns.
 * 128px is the shared responsive readability floor on generated colgroups.
 * When n × 128px no longer fits, overflow is Syncfusion's native horizontal scrollbar.
 */
.sm-data-grid .e-grid .e-content col,
.sm-data-grid .e-grid .e-headercontent col {
    min-width: 128px;
}

.sm-data-grid .e-grid .e-rowcell,
.sm-data-grid .e-grid .e-headercell {
    padding-top: 0.28rem;
    padding-bottom: 0.28rem;
}

.sm-data-grid .e-grid .e-row:not(.e-altrow) .e-rowcell {
    background-color: #fff;
}

.sm-data-grid .e-grid .e-altrow .e-rowcell {
    background-color: #f3f4f6;
}

.sm-data-grid .e-grid .e-rowcell,
.sm-data-grid .e-grid .e-headercell .e-headercelldiv {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sm-cash-panel {
    background: #f4f1ea !important;
    border: 1px solid rgba(120, 100, 70, 0.12) !important;
}

.sm-cash-panel .card-body {
    background: transparent;
}

.sm-cash-panel__expected {
    background: rgba(255, 248, 220, 0.65);
    margin: 0 -0.35rem;
    padding: 0.35rem;
    border-radius: 0.35rem;
}

.sm-cash-tracks {
    display: grid;
    grid-template-columns: max-content 10rem;
    column-gap: 1rem;
    row-gap: 0.55rem;
    align-items: center;
    width: max-content;
    max-width: 100%;
}

.sm-cash-row {
    display: contents;
}

.sm-cash-label {
    min-width: 0;
}

.sm-cash-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sm-cash-value .form-control {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sm-category-sales {
    background: #eef6f1 !important;
    border: 1px solid rgba(60, 100, 80, 0.12) !important;
}

.sm-category-sales .card-body {
    background: transparent;
}

.sm-category-sales__title {
    color: #3d5a4c;
}

.sm-category-sales thead th {
    font-weight: 600;
    color: #4a5c54;
    border-bottom-color: rgba(60, 100, 80, 0.15);
}

.sm-category-sales__total {
    background: rgba(255, 255, 255, 0.45);
    font-weight: 650;
}

.sm-category-sales td,
.sm-category-sales th {
    border-color: rgba(60, 100, 80, 0.1);
}

.sm-panel {
    border-radius: var(--sm-card-radius) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    background: #fff;
}

.sm-panel .card-body {
    padding: 1.25rem 1.35rem;
}

.sm-panel__title {
    font-size: 0.95rem;
    font-weight: 650;
    color: #0f172a;
    margin-bottom: 1rem;
}

.sm-demo-banner {
    font-size: 0.8rem;
    color: #64748b;
    background: #eef2f7;
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem;
    margin-top: 1rem;
}

.sm-chart-wrap {
    min-height: 280px;
    margin: 0 -0.25rem;
}

.sm-panel {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

/* Live Serilog console */
.log-console {
    display: flex;
    flex-direction: column;
    min-height: 28rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #0d1117;
    border: 1px solid #21262d;
    color: #e6edf3;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.log-console__levels {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 1rem;
    padding: 0.65rem 0.85rem;
    background: #161b22;
    border-bottom: 1px solid #21262d;
}

.log-console__level {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 8.25rem;
    margin: 0;
    color: #8b949e;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.log-console__level .form-select {
    min-width: 8.25rem;
    background: #0d1117;
    border-color: #30363d;
    color: #e6edf3;
    font-size: 0.8rem;
}

.log-console__level .form-select:focus {
    border-color: #388bfd;
    box-shadow: 0 0 0 0.15rem rgba(56, 139, 253, 0.25);
}

.log-console__levels-hint {
    flex: 1 1 14rem;
    margin: 0;
    align-self: center;
    color: #8b949e;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.35;
}

.log-console__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 0.55rem 0.85rem;
    background: #161b22;
    border-bottom: 1px solid #21262d;
}

.log-console__check {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    margin: 0;
    color: #c9d1d9;
    user-select: none;
}

.log-console__meta {
    margin-left: auto;
    color: #8b949e;
    font-size: 0.75rem;
}

.log-console__screen {
    flex: 1;
    min-height: 22rem;
    max-height: min(70vh, 40rem);
    overflow: auto;
    padding: 0.65rem 0.85rem 1rem;
    scroll-behavior: smooth;
}

.log-console__empty {
    color: #8b949e;
    padding: 1rem 0;
}

.log-console__line {
    display: grid;
    grid-template-columns: 6.5rem 2.2rem minmax(4rem, 10rem) 1fr;
    gap: 0.55rem;
    padding: 0.12rem 0;
    border-bottom: 1px solid transparent;
}

.log-console__line:hover {
    background: rgba(255, 255, 255, 0.03);
}

.log-console__ts { color: #8b949e; }
.log-console__lvl { font-weight: 700; }
.log-console__src {
    color: #79c0ff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.log-console__msg { color: #e6edf3; word-break: break-word; }
.log-console__ex {
    grid-column: 1 / -1;
    margin: 0.25rem 0 0.5rem;
    padding: 0.5rem 0.65rem;
    background: #1c1214;
    border-left: 3px solid #f85149;
    color: #ffa198;
    white-space: pre-wrap;
    font-size: 0.75rem;
}

.log-console__line--verbose .log-console__lvl,
.log-console__line--debug .log-console__lvl { color: #8b949e; }
.log-console__line--information .log-console__lvl { color: #3fb950; }
.log-console__line--warning .log-console__lvl { color: #d29922; }
.log-console__line--error .log-console__lvl,
.log-console__line--fatal .log-console__lvl { color: #f85149; }

@media (max-width: 991.98px) {
    .log-console__line {
        grid-template-columns: 5.2rem 2rem 1fr;
    }
    .log-console__src { display: none; }

    .app-shell__content {
        padding: 1rem;
    }

    .app-topbar {
        padding: 0.75rem 1rem;
    }

    .app-topbar__user {
        max-width: 140px;
    }

    .stat-card__value {
        font-size: 1.45rem;
    }
}

.ui-help-btn {
    line-height: 1;
    vertical-align: baseline;
    text-decoration: none !important;
    color: var(--bs-secondary-color);
}

.ui-help-btn:hover,
.ui-help-btn:focus-visible {
    color: var(--bs-primary);
}

.ui-help-icon {
    font-size: 0.85rem;
}

/* Inventory grid workspace — actions above filters inside the same card. */
.sm-inventory-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.sm-inventory-actions__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
}

@media (min-width: 768px) {
    .sm-inventory-actions__toolbar {
        justify-content: flex-end;
    }
}

/* Shared inventura / catalogue filter row — full workspace width. */
.sm-grid-filter-bar {
    width: 100%;
}

.sm-grid-filter-bar__fields {
    display: grid;
    gap: 0.75rem 1rem;
    width: 100%;
    align-items: end;
}

.sm-grid-filter-bar__fields--1 {
    grid-template-columns: minmax(16rem, 1fr);
}

.sm-grid-filter-bar__fields--2 {
    grid-template-columns: minmax(16rem, 2fr) minmax(12rem, 1fr);
}

.sm-grid-filter-bar__fields--3 {
    grid-template-columns: minmax(16rem, 2fr) minmax(11rem, 1fr) minmax(11rem, 1fr);
}

.sm-grid-filter-bar__fields--3-clear {
    grid-template-columns: minmax(14rem, 2fr) minmax(10rem, 1fr) minmax(10rem, 1fr) auto;
}

.sm-grid-filter-bar__search,
.sm-grid-filter-bar__field {
    min-width: 0;
}

.sm-grid-filter-bar__clear {
    display: flex;
    align-items: flex-end;
}

.sm-grid-filter-bar__clear .btn {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .sm-grid-filter-bar__fields--2,
    .sm-grid-filter-bar__fields--3,
    .sm-grid-filter-bar__fields--3-clear {
        grid-template-columns: 1fr 1fr;
    }

    .sm-grid-filter-bar__search {
        grid-column: 1 / -1;
    }

    .sm-grid-filter-bar__fields--3-clear .sm-grid-filter-bar__clear {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 575.98px) {
    .sm-grid-filter-bar__fields--1,
    .sm-grid-filter-bar__fields--2,
    .sm-grid-filter-bar__fields--3,
    .sm-grid-filter-bar__fields--3-clear {
        grid-template-columns: 1fr;
    }

    .sm-grid-filter-bar__search {
        grid-column: auto;
    }

    .sm-grid-filter-bar__fields--3-clear .sm-grid-filter-bar__clear {
        grid-column: auto;
        justify-content: stretch;
    }

    .sm-grid-filter-bar__fields--3-clear .sm-grid-filter-bar__clear .btn {
        width: 100%;
    }
}

.sm-inventory-add-product {
    padding: 0.85rem 1rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: var(--sm-card-radius);
    background: rgba(15, 23, 42, 0.02);
}

.sm-inventory-entry .card-body {
    display: flex;
    flex-direction: column;
    min-height: min(70vh, calc(100vh - 14rem));
}

.sm-entry-workspace {
    flex: 0 1 auto;
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
    margin-block: auto;
}

/* Inventura entry mode — one shared track definition for Item | Received | Closing. */
.sm-entry-list {
    display: grid;
    grid-template-columns:
        minmax(0, min(var(--sm-entry-item-ch, 12ch), 28rem))
        110px
        110px;
    column-gap: 0.75rem;
    row-gap: 0.45rem;
    align-items: center;
    width: max-content;
    max-width: 100%;
}

.sm-entry-head {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    padding: 0 0.25rem 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--sm-text-muted);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.sm-entry-row {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    padding: 0.45rem 0.65rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--sm-card-radius);
    align-items: center;
}

.sm-entry-row--alt {
    background: #f3f4f6;
}

.sm-dash-period__field {
    min-width: 10.5rem;
}

.sm-dash-period__picker {
    min-width: 10.5rem;
}

.sm-entry-item {
    min-width: 0;
}

.sm-entry-h-item {
    text-align: left;
}

.sm-entry-h-qty {
    text-align: center;
}

.sm-entry-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}

.sm-entry-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
}

.sm-entry-field-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--sm-text-muted);
}

.sm-entry-input,
.sm-entry-input.form-control-lg {
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-height: 2.35rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    font-size: 0.95rem;
}

.sm-entry-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding: 0.85rem 0 0.15rem;
    background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0));
}

@media (min-width: 576px) {
    .sm-entry-head {
        display: grid;
    }
}

@media (max-width: 575.98px) {
    .sm-entry-list {
        width: 100%;
        grid-template-columns: 1fr 1fr;
    }

    .sm-entry-row {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "item item"
            "in close";
        gap: 0.45rem;
        padding: 0.5rem 0.55rem;
    }

    .sm-entry-item {
        grid-area: item;
    }

    .sm-entry-row .sm-entry-field:nth-of-type(1) {
        grid-area: in;
    }

    .sm-entry-row .sm-entry-field:nth-of-type(2) {
        grid-area: close;
    }

    .sm-entry-input {
        min-height: 2.5rem;
        font-size: 1rem;
    }

    .sm-entry-actions {
        flex-direction: column;
        padding-bottom: 0.5rem;
    }
}

/* App toast severity — high-contrast text on solid backgrounds (Syncfusion content/title/icons). */
.e-toast-container .e-toast.sm-toast-success {
    background-color: #0f5132 !important;
    border-color: #0a3622 !important;
    color: #ffffff !important;
}

.e-toast-container .e-toast.sm-toast-info {
    background-color: #084298 !important;
    border-color: #052c65 !important;
    color: #ffffff !important;
}

.e-toast-container .e-toast.sm-toast-warning {
    background-color: #ffc107 !important;
    border-color: #997404 !important;
    color: #1a1a1a !important;
}

.e-toast-container .e-toast.sm-toast-error {
    background-color: #842029 !important;
    border-color: #6a1a21 !important;
    color: #ffffff !important;
}

.e-toast-container .e-toast.sm-toast-success .e-toast-title,
.e-toast-container .e-toast.sm-toast-success .e-toast-content,
.e-toast-container .e-toast.sm-toast-success .e-toast-message,
.e-toast-container .e-toast.sm-toast-success .e-toast-icon,
.e-toast-container .e-toast.sm-toast-success .e-toast-close-icon,
.e-toast-container .e-toast.sm-toast-info .e-toast-title,
.e-toast-container .e-toast.sm-toast-info .e-toast-content,
.e-toast-container .e-toast.sm-toast-info .e-toast-message,
.e-toast-container .e-toast.sm-toast-info .e-toast-icon,
.e-toast-container .e-toast.sm-toast-info .e-toast-close-icon,
.e-toast-container .e-toast.sm-toast-error .e-toast-title,
.e-toast-container .e-toast.sm-toast-error .e-toast-content,
.e-toast-container .e-toast.sm-toast-error .e-toast-message,
.e-toast-container .e-toast.sm-toast-error .e-toast-icon,
.e-toast-container .e-toast.sm-toast-error .e-toast-close-icon {
    color: #ffffff !important;
}

.e-toast-container .e-toast.sm-toast-warning .e-toast-title,
.e-toast-container .e-toast.sm-toast-warning .e-toast-content,
.e-toast-container .e-toast.sm-toast-warning .e-toast-message,
.e-toast-container .e-toast.sm-toast-warning .e-toast-icon,
.e-toast-container .e-toast.sm-toast-warning .e-toast-close-icon {
    color: #1a1a1a !important;
}

.e-toast-container .e-toast.sm-toast-success .e-toast-progress,
.e-toast-container .e-toast.sm-toast-info .e-toast-progress,
.e-toast-container .e-toast.sm-toast-error .e-toast-progress {
    background-color: rgba(255, 255, 255, 0.55) !important;
}

.e-toast-container .e-toast.sm-toast-warning .e-toast-progress {
    background-color: rgba(0, 0, 0, 0.35) !important;
}
