:root {
    --serinsis-primary: #2117ab;
    --serinsis-primary-dark: #17117f;
    --serinsis-sky: #8fd0f7;
    --serinsis-sky-soft: #d9efff;
    --serinsis-ink: #17314a;
    --serinsis-surface: rgba(255, 255, 255, 0.95);
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top, rgba(196, 221, 255, 0.7), transparent 28%),
        linear-gradient(180deg, #f4f7fb 0%, #e6edf7 100%);
}

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

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--serinsis-primary) 0%, #3144df 100%);
    border-color: var(--serinsis-primary);
}

.btn-outline-secondary {
    color: var(--serinsis-primary-dark);
    border-color: rgba(33, 23, 171, 0.28);
}

.btn-outline-secondary:hover {
    color: #fff;
    background: var(--serinsis-primary-dark);
    border-color: var(--serinsis-primary-dark);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus, .form-select:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(33, 23, 171, 0.22);
}

.form-control,
.form-select {
    border-radius: 16px;
    border-color: rgba(23, 49, 74, 0.12);
}

.content {
    padding-top: 1.1rem;
}

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

.auth-shell {
    min-height: calc(100vh - 3rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: min(100%, 1040px);
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid rgba(143, 208, 247, 0.35);
    box-shadow: 0 30px 80px rgba(23, 49, 74, 0.14);
}

.auth-brand {
    padding: 3rem;
    color: #f6fbff;
}

.serinsis-brand-panel {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(circle at 20% 20%, rgba(143, 208, 247, 0.32), transparent 22%),
        radial-gradient(circle at 80% 30%, rgba(143, 208, 247, 0.18), transparent 26%),
        linear-gradient(150deg, #100b63 0%, #1e18a0 48%, #2632c0 100%);
}

.serinsis-brand-panel::after {
    content: "";
    position: absolute;
    inset: 1.8rem;
    border-radius: 28px;
    border: 1px solid rgba(143, 208, 247, 0.18);
    pointer-events: none;
}

.serinsis-orbit {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 1.5rem;
    border-radius: 50%;
    border: 2px solid rgba(143, 208, 247, 0.35);
    box-shadow:
        inset 0 0 0 2px rgba(143, 208, 247, 0.08),
        0 0 60px rgba(143, 208, 247, 0.12);
}

.serinsis-orbit::before,
.serinsis-orbit::after {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    border: 1px solid rgba(143, 208, 247, 0.4);
}

.serinsis-orbit::after {
    inset: 30px 10px;
    transform: rotate(38deg);
}

.serinsis-core {
    position: absolute;
    inset: 50%;
    width: 38px;
    height: 38px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #dff3ff 0%, var(--serinsis-sky) 45%, #4c9cd6 100%);
    box-shadow: 0 0 24px rgba(143, 208, 247, 0.4);
}

.serinsis-node {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dff3ff;
    box-shadow: 0 0 14px rgba(143, 208, 247, 0.45);
}

.serinsis-node-a { top: 18px; left: 44px; }
.serinsis-node-b { top: 36px; right: 26px; }
.serinsis-node-c { bottom: 30px; left: 22px; }
.serinsis-node-d { bottom: 18px; right: 44px; }

.auth-kicker {
    display: inline-block;
    margin-bottom: 0.8rem;
    letter-spacing: 0.22rem;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--serinsis-sky);
}

.serinsis-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 0.88;
    margin-bottom: 1.3rem;
}

.serinsis-wordmark-main,
.serinsis-wordmark-sub {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.serinsis-wordmark-main {
    font-size: clamp(3rem, 6vw, 5.6rem);
}

.serinsis-wordmark-sub {
    font-size: clamp(2.8rem, 5vw, 4.6rem);
    color: var(--serinsis-sky);
}

.brand-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.5rem;
}

.brand-meta span {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(143, 208, 247, 0.16);
}

.auth-brand h1,
.dashboard-hero h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1;
    margin-bottom: 1rem;
}

.auth-form {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 247, 255, 0.98) 100%);
}

.login-header h2 {
    margin-bottom: 0.35rem;
    color: var(--serinsis-primary-dark);
}

.login-header p {
    margin-bottom: 0;
    color: #5a7190;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-group label {
    font-weight: 700;
    color: var(--serinsis-ink);
}

.status-box {
    padding: 0.9rem 1rem;
    border-radius: 14px;
}

.status-box-info {
    color: #0b4a6f;
    background: #deeffd;
}

.status-box-error {
    color: #7c1f1f;
    background: #fde7e7;
}

.summary-box {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #eef5ff 0%, #dff0ff 100%);
    color: var(--serinsis-ink);
}

.button-row {
    display: flex;
    gap: 1rem;
}

.dashboard-shell {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.5rem 0 2rem;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 2rem;
    border-radius: 24px;
    color: #f3f8ff;
    background: linear-gradient(145deg, var(--serinsis-primary-dark) 0%, var(--serinsis-primary) 55%, #76bce9 100%);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.module-card {
    padding: 1.4rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(143, 208, 247, 0.3);
    box-shadow: 0 12px 28px rgba(32, 64, 95, 0.08);
}

.module-card h2 {
    font-size: 1.2rem;
    margin-bottom: 0.65rem;
    color: var(--serinsis-primary-dark);
}

@media (max-width: 900px) {
    .auth-card {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        flex-direction: column;
    }

    .auth-brand,
    .auth-form {
        padding: 2rem;
    }
}

.serinsis-swal-popup {
    border-radius: 24px !important;
}

.desktop-menu-shell {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0 2rem;
}

.desktop-menu-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 28px;
    color: #f6fbff;
    background:
        radial-gradient(circle at top right, rgba(143, 208, 247, 0.24), transparent 28%),
        linear-gradient(145deg, #17117f 0%, #2117ab 56%, #6fbbe9 100%);
    box-shadow: 0 18px 48px rgba(23, 49, 74, 0.18);
}

.desktop-menu-kicker {
    display: inline-block;
    margin-bottom: 0.9rem;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #c8e9ff;
    font-weight: 800;
}

.desktop-menu-hero h1 {
    margin-bottom: 0.9rem;
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.desktop-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
}

.menu-panel {
    padding: 1.35rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(143, 208, 247, 0.34);
    box-shadow: 0 12px 28px rgba(23, 49, 74, 0.08);
}

.menu-panel h2 {
    margin-bottom: 1rem;
    color: #17117f;
    font-size: 1.2rem;
}

.menu-button-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.menu-action-button {
    min-height: 72px;
    border: 0;
    border-radius: 18px;
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: #17314a;
    background: linear-gradient(180deg, #f6fbff 0%, #e7f3ff 100%);
    box-shadow: inset 0 0 0 1px rgba(143, 208, 247, 0.34);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.menu-action-button:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(33, 23, 171, 0.2), 0 10px 24px rgba(33, 23, 171, 0.1);
    background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
}

.menu-action-button-primary {
    color: #fff;
    background: linear-gradient(135deg, #17117f 0%, #2117ab 65%, #3455e5 100%);
    box-shadow: none;
}

.menu-action-button-primary:hover {
    background: linear-gradient(135deg, #130d67 0%, #1c1494 65%, #2f4cce 100%);
}

@media (max-width: 980px) {
    .desktop-menu-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .desktop-menu-hero {
        flex-direction: column;
    }

    .menu-button-grid {
        grid-template-columns: 1fr;
    }
}

.desktop-home-shell {
    display: grid;
    grid-template-rows: 34px 1fr 60px;
    min-height: 100vh;
    background: #dcdcdc;
}

.desktop-home-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0.55rem 0 0.5rem;
    background: #ffffff;
    border-bottom: 1px solid #cfcfcf;
    color: #000000;
}

.desktop-home-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #000000;
    letter-spacing: 0.01em;
}

.desktop-home-actions {
    display: flex;
    align-items: center;
    gap: 0.22rem;
    color: #111111;
}

.desktop-home-counter {
    min-width: 18px;
    text-align: center;
    font-weight: 700;
}

.chrome-icon-button {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #141414;
    font-size: 1rem;
}

.chrome-icon-button:hover {
    background: rgba(0, 0, 0, 0.07);
}

.chrome-icon-button-close:hover {
    background: rgba(193, 35, 35, 0.12);
    color: #8b1111;
}

.desktop-home-canvas {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.desktop-home-watermark {
    position: relative;
    display: grid;
    place-items: center;
}

.desktop-watermark-orbit {
    width: min(34vw, 420px);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid rgba(121, 177, 212, 0.36);
    box-shadow:
        inset 0 0 0 24px rgba(255, 255, 255, 0.16),
        0 0 0 36px rgba(255, 255, 255, 0.08);
    opacity: 0.9;
}

.desktop-watermark-orbit::before,
.desktop-watermark-orbit::after {
    content: "";
    position: absolute;
    inset: 9%;
    border-radius: 50%;
    border: 2px solid rgba(121, 177, 212, 0.26);
    transform: rotate(24deg);
}

.desktop-watermark-orbit::after {
    inset: 16% 8%;
    transform: rotate(-28deg);
}

.desktop-watermark-card {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
    padding: 1.75rem 2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 18px 32px rgba(35, 45, 78, 0.08);
}

.desktop-watermark-kicker {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #6e88a1;
}

.desktop-watermark-card strong {
    font-size: clamp(2rem, 4.6vw, 3.8rem);
    line-height: 0.92;
    color: #64111a;
    font-family: Georgia, 'Times New Roman', serif;
}

.desktop-watermark-card small {
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #1e2b58;
    font-weight: 700;
}

.desktop-home-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.4rem;
    color: #ffffff;
    background: linear-gradient(90deg, #1b2741 0%, #1f2d4e 100%);
}

.desktop-home-userbox,
.desktop-home-clock {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.desktop-home-userbox strong,
.desktop-home-clock strong {
    font-size: 0.95rem;
    font-weight: 500;
}

.desktop-home-userbox span,
.desktop-home-clock span {
    margin-top: 0.28rem;
    font-size: 0.88rem;
}

.desktop-home-clock {
    text-align: right;
}

@media (max-width: 900px) {
    .desktop-home-shell {
        grid-template-rows: auto 1fr auto;
    }

    .desktop-home-topbar,
    .desktop-home-footer {
        padding: 0.8rem 1rem;
    }

    .desktop-home-topbar,
    .desktop-home-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .desktop-home-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .desktop-home-clock {
        text-align: left;
    }

    .desktop-watermark-orbit {
        width: min(64vw, 320px);
    }

    .desktop-watermark-card {
        padding: 1.2rem 1.3rem;
    }
}

@media (max-width: 640px) {
    .desktop-home-topbar {
        padding-left: 5.4rem;
        min-height: 92px;
    }

    .desktop-home-title {
        width: 100%;
        padding-right: 0.5rem;
        font-size: 0.86rem;
        line-height: 1.25;
        word-break: break-word;
    }

    .desktop-home-actions {
        padding-left: 0;
    }
}

.sales-history-shell {
    display: grid;
    gap: 1.1rem;
    padding: 1rem;
    min-height: calc(100vh - 8.5rem);
}

.sales-history-filters {
    display: block;
}

.sales-history-filter-card {
    background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(245,247,252,.95));
    border: 1px solid rgba(22, 37, 92, 0.08);
    border-radius: 1.15rem;
    box-shadow: 0 14px 30px rgba(18, 31, 77, 0.10);
    padding: 1rem 1.1rem;
}

.sales-history-filter-title {
    color: #15255c;
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.95rem;
}

.sales-history-filter-grid {
    align-items: end;
    display: grid;
    gap: 0.9rem;
    grid-template-columns: 160px auto 180px minmax(220px, 1fr) auto auto;
}

.sales-history-field {
    display: grid;
    gap: 0.35rem;
}

.sales-history-field label {
    color: #31456f;
    font-size: 0.88rem;
    font-weight: 700;
}

.sales-history-field .form-control {
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(37, 55, 126, .16);
    border-radius: 1rem;
    box-shadow: none;
    min-height: 44px;
}

.sales-history-field .form-control:focus {
    border-color: #4d7cff;
    box-shadow: 0 0 0 3px rgba(77, 124, 255, 0.16);
}

.sales-history-field-grow {
    min-width: 0;
}

.sales-history-period-buttons {
    display: flex;
    gap: 0.55rem;
}

.sales-history-period-button {
    background: rgba(33, 49, 115, 0.08);
    border: 1px solid rgba(31, 53, 123, 0.12);
    border-radius: 1rem;
    color: #19305f;
    font-weight: 800;
    min-height: 44px;
    min-width: 82px;
    transition: .18s ease;
}

.sales-history-period-button:hover {
    transform: translateY(-1px);
}

.sales-history-period-button-active {
    background: linear-gradient(135deg, #213373, #3f57a8);
    border-color: transparent;
    box-shadow: 0 10px 18px rgba(33, 51, 115, 0.22);
    color: #fff;
}

.sales-history-checks {
    display: grid;
    gap: 0.45rem;
    padding-bottom: 0.2rem;
}

.sales-history-check {
    align-items: center;
    color: #32456d;
    display: flex;
    font-size: 0.95rem;
    gap: 0.45rem;
    white-space: nowrap;
}

.sales-history-clear-button {
    align-self: end;
    background: rgba(18, 37, 92, 0.06);
    border: 1px solid rgba(18, 37, 92, 0.08);
    border-radius: 1rem;
    color: #192a61;
    font-weight: 800;
    min-height: 44px;
    padding: 0 1.2rem;
}

.sales-history-overview {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sales-history-stat-card {
    background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(239,243,251,.96));
    border: 1px solid rgba(22, 37, 92, 0.08);
    border-radius: 1rem;
    box-shadow: 0 12px 24px rgba(18, 31, 77, 0.08);
    display: grid;
    gap: 0.2rem;
    padding: 0.95rem 1rem;
}

.sales-history-stat-card span {
    color: #506287;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.sales-history-stat-card strong {
    color: #13275a;
    font-size: 1.5rem;
    font-weight: 900;
}

.sales-history-stat-card small {
    color: #6f7c96;
    font-size: 0.85rem;
}

.sales-history-stat-card-warning strong {
    color: #b87400;
}

.sales-history-stat-card-danger strong {
    color: #a72d38;
}

.sales-history-content {
    display: grid;
    gap: 1rem;
    min-height: 0;
}

.sales-history-content-single {
    grid-template-columns: 1fr;
}

.sales-history-table-card {
    background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(240,243,248,.92));
    border: 1px solid rgba(22, 37, 92, 0.08);
    border-radius: 1.15rem;
    box-shadow: 0 14px 28px rgba(18, 31, 77, 0.08);
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
    overflow: hidden;
}

.sales-history-table-wrap {
    min-height: 520px;
    overflow: auto;
}

.sales-history-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1180px;
    width: 100%;
}

.sales-history-table thead th {
    background: #f7f9fc;
    border-bottom: 1px solid rgba(21, 37, 92, 0.10);
    color: #112554;
    font-size: 0.85rem;
    font-weight: 900;
    padding: 0.9rem 0.7rem;
    position: sticky;
    text-align: left;
    top: 0;
    z-index: 1;
}

.sales-history-table tbody td {
    border-bottom: 1px solid rgba(19, 38, 91, 0.08);
    color: #172a57;
    font-size: 0.91rem;
    padding: 0.85rem 0.7rem;
    vertical-align: middle;
}

.sales-history-table tbody tr {
    cursor: pointer;
    transition: background-color .15s ease;
}

.sales-history-table tbody tr:hover td {
    background: rgba(109, 147, 238, 0.08);
}

.sales-history-row-selected td {
    background: rgba(77, 124, 255, 0.12);
}

.sales-history-row-cancelled td {
    color: #8a3240;
}

.sales-history-row-pending td {
    color: #8a5a00;
}

.sales-history-doc-main {
    font-weight: 900;
}

.sales-history-doc-sub {
    color: #7582a1;
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

.sales-history-status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    padding: 0.34rem 0.6rem;
    text-transform: uppercase;
}

.sales-history-status-success {
    background: rgba(45, 167, 92, 0.14);
    color: #1b7f46;
}

.sales-history-status-warning {
    background: rgba(223, 151, 0, 0.16);
    color: #9b6200;
}

.sales-history-status-danger {
    background: rgba(202, 70, 88, 0.14);
    color: #9f2434;
}

.sales-history-strong-cell {
    font-weight: 900;
}

.sales-history-row-action {
    background: linear-gradient(135deg, #213373, #4e66bc);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 10px 20px rgba(33, 51, 115, 0.20);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    min-height: 38px;
    padding: 0 0.95rem;
    white-space: nowrap;
}

.sales-history-row-action:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.sales-history-empty {
    color: #65738f;
    padding: 2.2rem 1rem;
    text-align: center;
}

.sales-history-footer-bar {
    align-items: center;
    background: #f5f7fb;
    border-top: 1px solid rgba(18, 37, 92, 0.08);
    color: #12275e;
    display: flex;
    font-size: 1rem;
    font-weight: 900;
    justify-content: space-between;
    padding: 0.9rem 1rem;
}

.sales-history-modal-backdrop {
    align-items: flex-start;
    backdrop-filter: blur(6px);
    background: rgba(10, 18, 45, 0.44);
    display: flex;
    inset: 0;
    justify-content: center;
    overflow-y: auto;
    padding: 1rem;
    position: fixed;
    z-index: 2000;
}

.sales-history-modal {
    background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(241,245,252,.98));
    border: 1px solid rgba(23, 38, 89, 0.09);
    border-radius: 1.4rem;
    box-shadow: 0 30px 60px rgba(7, 15, 40, 0.28);
    margin: auto;
    max-height: calc(100vh - 2rem);
    max-width: 760px;
    overflow: auto;
    padding: 1.1rem;
    width: min(100%, 760px);
}

.sales-history-modal-head {
    align-items: start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.sales-history-modal-kicker {
    color: #6b7ba0;
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sales-history-modal-head h3 {
    color: #13275a;
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0.15rem 0;
}

.sales-history-modal-head p {
    color: #5f6f90;
    margin: 0;
}

.sales-history-modal-close {
    align-items: center;
    background: rgba(18, 37, 92, 0.06);
    border: 0;
    border-radius: 999px;
    color: #213373;
    display: inline-flex;
    font-size: 1.5rem;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.sales-history-modal-summary {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.sales-history-modal-summary div {
    background: rgba(255,255,255,.75);
    border: 1px solid rgba(21, 37, 92, 0.07);
    border-radius: 1rem;
    display: grid;
    gap: 0.1rem;
    padding: 0.85rem 0.9rem;
}

.sales-history-modal-summary span {
    color: #7281a0;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.sales-history-modal-summary strong {
    color: #182c63;
    font-size: 0.96rem;
    font-weight: 800;
}

.sales-history-modal-sections {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sales-history-modal-group {
    background: rgba(255,255,255,.58);
    border: 1px solid rgba(20, 36, 92, 0.08);
    border-radius: 1.2rem;
    padding: 0.9rem;
}

.sales-history-modal-group-danger {
    background: rgba(255, 245, 246, 0.75);
}

.sales-history-modal-group-title {
    color: #1a2d63;
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.sales-history-modal-actions {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sales-history-modal-action {
    align-items: center;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(236,241,250,.98));
    border: 1px solid rgba(22, 37, 92, 0.08);
    border-radius: 1.1rem;
    box-shadow: 0 10px 20px rgba(15, 26, 62, 0.08);
    color: #172b63;
    display: flex;
    font-size: 0.95rem;
    font-weight: 800;
    gap: 0.75rem;
    min-height: 58px;
    padding: 0.95rem 1rem;
    text-align: left;
    transition: .18s ease;
}

.sales-history-modal-action:hover {
    transform: translateY(-1px);
}

.sales-history-modal-action-primary {
    background: linear-gradient(135deg, #213373, #4962b5);
    border-color: transparent;
    color: #fff;
}

.sales-history-modal-action-danger {
    color: #9e2537;
}

.sales-history-modal-icon {
    align-items: center;
    background: rgba(25, 47, 111, 0.08);
    border-radius: 0.85rem;
    display: inline-flex;
    font-size: 1.05rem;
    height: 2.25rem;
    justify-content: center;
    min-width: 2.25rem;
}

.sales-history-modal-action-primary .sales-history-modal-icon {
    background: rgba(255,255,255,.18);
}

.sales-history-modal-foot {
    align-items: end;
    display: flex;
    gap: 0.9rem;
    justify-content: space-between;
}

.sales-history-modal-date {
    display: grid;
    flex: 1;
    gap: 0.35rem;
}

.sales-history-modal-date label {
    color: #31456f;
    font-size: 0.88rem;
    font-weight: 700;
}

.sales-history-modal-done {
    background: linear-gradient(135deg, #182a62, #263b82);
    border: 0;
    border-radius: 1rem;
    color: #fff;
    font-weight: 900;
    min-height: 46px;
    padding: 0 1.4rem;
}

@media (max-width: 1280px) {
    .sales-history-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sales-history-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .sales-history-shell {
        padding: 0.85rem;
    }

    .sales-history-filter-grid,
    .sales-history-overview,
    .sales-history-modal-summary,
    .sales-history-modal-actions {
        grid-template-columns: 1fr;
    }

    .sales-history-period-buttons {
        flex-wrap: wrap;
    }

    .sales-history-table-wrap {
        min-height: 420px;
    }

    .sales-history-modal-foot {
        align-items: stretch;
        flex-direction: column;
    }
}


.sales-history-page-footer {
    margin-top: auto;
}

.sales-history-account-cell {
    color: #13275a;
    font-weight: 900;
    white-space: nowrap;
}

