.auth-page {
    --auth-ink: #152033;
    --auth-muted: #607089;
    --auth-line: rgba(23, 36, 61, 0.12);
    --auth-blue: #1457d9;
    --auth-teal: #0c9488;
    --auth-gold: #d59b2a;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 14% 16%, rgba(20, 87, 217, 0.22), transparent 28%),
        radial-gradient(circle at 88% 85%, rgba(12, 148, 136, 0.24), transparent 30%),
        linear-gradient(135deg, #eef4fb 0%, #f8fafc 48%, #eaf7f1 100%);
}

.auth-shell {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1.2fr) minmax(340px, 460px);
    gap: 2.5rem;
    align-items: center;
    padding: clamp(1.25rem, 3vw, 3rem);
}

.auth-grid-glow,
.auth-orb {
    position: absolute;
    pointer-events: none;
    z-index: -1;
}

.auth-grid-glow {
    inset: 2rem;
    border-radius: 2rem;
    opacity: .4;
    background-image:
        linear-gradient(rgba(21, 32, 51, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(21, 32, 51, .06) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, #000 0%, transparent 72%);
}

.auth-orb {
    width: 16rem;
    height: 16rem;
    border-radius: 999px;
    filter: blur(4px);
    opacity: .46;
    animation: authFloat 9s ease-in-out infinite;
}

.auth-orb-one {
    top: 6%;
    left: 5%;
    background: radial-gradient(circle, rgba(20, 87, 217, .46), transparent 68%);
}

.auth-orb-two {
    right: 7%;
    bottom: 7%;
    animation-delay: -3s;
    background: radial-gradient(circle, rgba(12, 148, 136, .42), transparent 68%);
}

.auth-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 4vw, 3.8rem);
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 2.1rem;
    color: var(--auth-ink);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(250, 253, 255, 0.74)),
        radial-gradient(circle at top right, rgba(213, 155, 42, .13), transparent 32%);
    box-shadow: 0 32px 80px rgba(21, 32, 51, 0.15);
    backdrop-filter: blur(18px);
    animation: authCardRise .72s ease-out both;
}

.auth-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-115%);
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .52) 45%, transparent 72%);
    animation: authScan 6s ease-in-out infinite;
}

.auth-hero > * {
    position: relative;
    z-index: 1;
}

.auth-hero h1 {
    max-width: 58rem;
    font-size: clamp(2.1rem, 4.4vw, 4.85rem);
    font-weight: 800;
    letter-spacing: -.055em;
    line-height: .98;
    margin-bottom: 1.15rem;
}

.auth-hero p {
    max-width: 46rem;
    font-size: clamp(1rem, 1.25vw, 1.2rem);
    color: var(--auth-muted);
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .62rem .92rem;
    border: 1px solid rgba(20, 87, 217, .14);
    border-radius: 999px;
    background: rgba(20, 87, 217, .09);
    color: var(--auth-blue);
    font-weight: 700;
    margin-bottom: 1.55rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}

.auth-flow-panel {
    max-width: 46rem;
    margin-top: 1.65rem;
    padding: 1rem;
    border: 1px solid var(--auth-line);
    border-radius: 1.4rem;
    background: rgba(255, 255, 255, .68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.auth-flow-track {
    display: grid;
    grid-template-columns: 1fr minmax(42px, .35fr) 1fr minmax(42px, .35fr) 1fr;
    gap: .65rem;
    align-items: center;
}

.auth-flow-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .48rem;
    min-height: 3.1rem;
    border: 1px solid rgba(21, 32, 51, .09);
    border-radius: 1rem;
    color: var(--auth-ink);
    background: linear-gradient(180deg, #ffffff, #f5f8fb);
    box-shadow: 0 10px 28px rgba(21, 32, 51, .08);
}

.auth-flow-step.is-active {
    color: #fff;
    border-color: rgba(20, 87, 217, .32);
    background: linear-gradient(135deg, var(--auth-blue), #1f75ff);
}

.auth-flow-line {
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(20, 87, 217, .55), transparent);
    animation: authFlowLine 2.4s ease-in-out infinite;
}

.auth-pulse-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .55rem;
    margin-top: .75rem;
}

.auth-pulse-row span {
    height: .36rem;
    border-radius: 999px;
    background: rgba(20, 87, 217, .16);
    animation: authPulse 1.8s ease-in-out infinite;
}

.auth-pulse-row span:nth-child(2) {
    animation-delay: .18s;
}

.auth-pulse-row span:nth-child(3) {
    animation-delay: .36s;
}

.auth-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.6rem;
}

.auth-kpis div {
    padding: 1rem;
    border: 1px solid rgba(21, 32, 51, .08);
    border-radius: 1.05rem;
    background: rgba(255, 255, 255, 0.56);
    box-shadow: 0 10px 24px rgba(21, 32, 51, .06);
}

.auth-kpis strong {
    display: block;
    font-size: 1rem;
    margin-bottom: .35rem;
}

.auth-kpis span {
    color: var(--auth-muted);
    font-size: .94rem;
}

.auth-card {
    width: 100%;
    margin: 0;
    animation: authCardRise .72s .12s ease-out both;
}

.auth-login-card {
    overflow: hidden;
    border-radius: 1.45rem;
    background: rgba(255, 255, 255, .91);
    box-shadow: 0 30px 70px rgba(21, 32, 51, .18);
    backdrop-filter: blur(18px);
}

.auth-login-card .card-header {
    padding-top: 2rem;
}

.auth-login-card .card-body {
    padding: 1.5rem 1.35rem 1.35rem;
}

.auth-login-card .h1 {
    color: var(--auth-ink);
    font-weight: 800;
    letter-spacing: -.035em;
}

.auth-logo-mark {
    width: 3.4rem;
    height: 3.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .7rem;
    border-radius: 1.05rem;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-blue), var(--auth-teal));
    box-shadow: 0 14px 30px rgba(20, 87, 217, .28);
}

.auth-login-card .form-label {
    color: #2d3748;
    font-weight: 650;
}

.auth-login-card .form-control,
.auth-login-card .form-select,
.auth-login-card .select2-selection {
    min-height: 48px;
    border-color: rgba(21, 32, 51, .18) !important;
    border-radius: .85rem !important;
    background-color: rgba(248, 250, 252, .86) !important;
}

.auth-login-card .form-control:focus,
.auth-login-card .form-select:focus {
    border-color: rgba(20, 87, 217, .62) !important;
    box-shadow: 0 0 0 .22rem rgba(20, 87, 217, .13) !important;
}

.auth-login-card .btn-primary {
    min-height: 52px;
    border: 0;
    border-radius: .95rem;
    font-weight: 750;
    background: linear-gradient(135deg, #1457d9, #1f75ff);
    box-shadow: 0 16px 28px rgba(20, 87, 217, .28);
}

.auth-secure-note {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    margin-top: 1.15rem;
    padding: .95rem;
    border: 1px solid rgba(12, 148, 136, .14);
    border-radius: 1rem;
    color: #41506a;
    background: rgba(12, 148, 136, .07);
    font-size: .9rem;
}

.auth-secure-note i {
    color: var(--auth-teal);
}

.simple-login-page {
    min-height: 100vh;
    background: #eef1f5;
}

.simple-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.simple-login-box {
    width: min(100%, 430px);
    margin: 0;
}

.simple-login-card {
    border: 0;
    border-radius: .85rem;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .14);
}

.simple-login-card .card-header {
    padding: 1.6rem 1.35rem 1.1rem;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    background: #fff;
}

.simple-login-card .card-body {
    padding: 1.35rem;
}

.simple-login-logo {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .7rem;
    border-radius: .75rem;
    color: #0d6efd;
    background: rgba(13, 110, 253, .1);
    font-size: 1.45rem;
}

.simple-login-title {
    margin: 0;
    color: #1f2937;
    font-size: 1.55rem;
    font-weight: 700;
}

.simple-login-subtitle {
    margin: .25rem 0 0;
    color: #6b7280;
}

.simple-login-card .form-label {
    color: #374151;
    font-weight: 600;
}

.simple-login-card .form-control,
.simple-login-card .form-select,
.simple-login-card .select2-selection {
    min-height: 44px;
    border-radius: .55rem !important;
}

.simple-login-card .btn-primary {
    min-height: 46px;
    border-radius: .55rem;
    font-weight: 600;
}

@keyframes authFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(18px, -18px, 0) scale(1.07);
    }
}

@keyframes authScan {
    0%, 50% {
        transform: translateX(-115%);
    }
    72%, 100% {
        transform: translateX(115%);
    }
}

@keyframes authFlowLine {
    0%, 100% {
        opacity: .38;
        transform: scaleX(.72);
    }
    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes authPulse {
    0%, 100% {
        opacity: .34;
        transform: scaleX(.72);
    }
    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes authCardRise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.global-loader {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.75rem 2rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
}

.session-context-shell {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .45rem .7rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.92);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.session-context-block {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.session-context-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: #64748b;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.session-context-divider {
    width: 1px;
    height: 2rem;
    background: rgba(15, 23, 42, 0.08);
}

.session-context-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: .35rem .8rem;
    border-radius: .8rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    white-space: nowrap;
}

.session-context-select {
    min-width: 13rem;
    border-radius: .8rem;
    border-color: rgba(15, 23, 42, 0.12);
    background-color: #fff;
    color: #0f172a;
    font-weight: 600;
    box-shadow: none;
}

.dashboard-metric-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
}

.metric-card {
    min-height: 220px;
    border-radius: 1.2rem;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 42px rgba(15, 23, 42, 0.1);
}

.metric-card-day {
    background: linear-gradient(180deg, #dceafe 0%, #cfe0fb 100%);
}

.metric-card-month {
    background: linear-gradient(180deg, #dff5ec 0%, #d1eddf 100%);
}

.metric-card-purchases {
    background: linear-gradient(180deg, #fff3ca 0%, #feeaad 100%);
}

.metric-card-loss {
    background: linear-gradient(180deg, #ffe0e5 0%, #ffd3db 100%);
}

.metric-card-alert {
    background: linear-gradient(180deg, #ffe6ea 0%, #ffd9e0 100%);
}

.metric-card-body {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    height: 100%;
    padding: 1.35rem 1.4rem;
}

.metric-label {
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #334155;
}

.metric-value {
    margin: .1rem 0 .15rem;
    font-size: clamp(2rem, 1.8vw, 2.65rem);
    line-height: 1.02;
    font-weight: 800;
    white-space: nowrap;
    color: #0f172a;
}

.metric-help {
    margin: 0;
    color: #475569;
    font-size: .98rem;
    line-height: 1.55;
    flex: 1 1 auto;
}

.audit-hero {
    background:
        radial-gradient(circle at top right, rgba(15, 23, 42, 0.08), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f5f7fb 48%, #eef4f8 100%);
}

.audit-lock-card {
    min-width: 16rem;
    padding: 1rem 1.15rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
}

.audit-detail {
    display: inline-block;
    max-width: 38rem;
    white-space: normal;
}

.select2-container--bootstrap-5 .select2-selection {
    min-height: 38px;
    border-radius: .5rem;
}

.table .select2-container--bootstrap-5 .select2-selection {
    min-height: 31px;
    border-radius: .45rem;
    font-size: .875rem;
}

.select2-container--open,
.select2-dropdown {
    z-index: 1066;
}

.iti {
    width: 100%;
}

.iti__tel-input {
    width: 100%;
    min-height: 38px;
    border-radius: .5rem;
}

.iti--inline-dropdown .iti__dropdown-content {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: .85rem;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
}

.iti__selected-country-primary {
    border-radius: .5rem 0 0 .5rem;
}

.iti__search-input {
    border-radius: .6rem;
}

.iti input.is-invalid {
    border-color: var(--bs-form-invalid-border-color);
    box-shadow: 0 0 0 .2rem rgba(220, 53, 69, 0.12);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: rgba(25, 135, 84, 0.7);
    box-shadow:
        0 0 0 .22rem rgba(25, 135, 84, 0.12),
        0 .65rem 1.35rem rgba(25, 135, 84, 0.08);
    background-image: none;
}

.form-control.is-invalid,
.form-select.is-invalid,
textarea.form-control.is-invalid {
    border-color: rgba(220, 53, 69, 0.75);
    box-shadow:
        0 0 0 .22rem rgba(220, 53, 69, 0.12),
        0 .65rem 1.35rem rgba(220, 53, 69, 0.08);
    background-image: none;
}

.select2-container--bootstrap-5 .select2-selection.is-valid {
    border-color: rgba(25, 135, 84, 0.7);
    box-shadow:
        0 0 0 .22rem rgba(25, 135, 84, 0.12),
        0 .65rem 1.35rem rgba(25, 135, 84, 0.08);
}

.select2-hidden-accessible.is-valid + .select2 .select2-selection {
    border-color: rgba(25, 135, 84, 0.7);
    box-shadow:
        0 0 0 .22rem rgba(25, 135, 84, 0.12),
        0 .65rem 1.35rem rgba(25, 135, 84, 0.08);
}

.select2-container--bootstrap-5 .select2-selection.is-invalid {
    border-color: rgba(220, 53, 69, 0.75);
    box-shadow:
        0 0 0 .22rem rgba(220, 53, 69, 0.12),
        0 .65rem 1.35rem rgba(220, 53, 69, 0.08);
}

.select2-hidden-accessible.is-invalid + .select2 .select2-selection {
    border-color: rgba(220, 53, 69, 0.75);
    box-shadow:
        0 0 0 .22rem rgba(220, 53, 69, 0.12),
        0 .65rem 1.35rem rgba(220, 53, 69, 0.08);
}

.app-sidebar .sidebar-brand {
    overflow: hidden;
}

.app-sidebar .brand-link {
    width: 100%;
    min-width: 0;
    display: flex !important;
    align-items: center;
    gap: .55rem;
    overflow: hidden;
}

.app-sidebar .brand-image {
    flex: 0 0 auto;
    float: none !important;
    max-width: 34px;
}

.app-sidebar .brand-text {
    display: block;
    min-width: 0;
    max-width: calc(var(--lte-sidebar-width, 250px) - 72px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600 !important;
}

.sidebar-menu .nav-link {
    min-width: 0;
    overflow: hidden;
}

.sidebar-menu .nav-link .nav-icon {
    flex: 0 0 1.35rem;
}

.sidebar-menu .nav-link > p {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    width: 100%;
    gap: .75rem;
}

.sidebar-menu .nav-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-menu .nav-arrow {
    flex: 0 0 auto;
}

.card {
    border: 0;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.swal2-popup {
    border-radius: 1rem;
}

#detailTable {
    table-layout: auto;
}

#detailTable .line-product-cell {
    min-width: 320px;
}

#detailTable .line-product-cell .select2-container {
    min-width: 100%;
}

#detailTable .line-quantity,
#detailTable .line-price,
#detailTable .line-discount,
#detailTable .line-tax-rate {
    min-width: 74px;
}

#detailTable .line-tax-amount,
#detailTable .line-total-display {
    display: inline-block;
    min-width: 72px;
}

#detailTable .line-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}

#wasteDetailTable,
#adjustmentDetailTable {
    table-layout: auto;
}

#wasteDetailTable .line-product-cell,
#adjustmentDetailTable .line-product-cell {
    min-width: 300px;
}

#wasteDetailTable .waste-line-quantity,
#wasteDetailTable .waste-line-cost,
#adjustmentDetailTable .adjustment-line-quantity,
#adjustmentDetailTable .adjustment-line-cost {
    min-width: 88px;
}

#wasteDetailTable .waste-line-remove,
#adjustmentDetailTable .adjustment-line-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}

.line-remove-text {
    display: none;
}

.preview-card {
    overflow: hidden;
}

.preview-panel-sticky {
    position: sticky;
    top: 1rem;
}

.preview-toolbar .btn.active {
    box-shadow: none;
}

.preview-status {
    position: absolute;
    top: .9rem;
    left: .9rem;
    right: .9rem;
    z-index: 2;
    padding: .55rem .85rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
    color: #fff;
    font-size: .8rem;
    line-height: 1.3;
    backdrop-filter: blur(10px);
    pointer-events: none;
}

.preview-frame {
    display: block;
    width: 100%;
    height: clamp(560px, 76vh, 980px);
    border: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 247, 251, 0.98)),
        linear-gradient(135deg, rgba(13, 110, 253, 0.04), rgba(25, 135, 84, 0.04));
}

@media (max-width: 1399.98px) {
    .dashboard-metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .app-content-header .row {
        gap: .6rem;
    }

    .app-content-header .breadcrumb {
        float: none !important;
        margin-bottom: 0;
    }

    .app-content-header h3 {
        font-size: 1.35rem;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .auth-hero {
        padding: 2rem;
    }

    .auth-kpis {
        grid-template-columns: 1fr;
    }

    .preview-panel-sticky {
        position: static;
    }

    .preview-frame {
        height: 68vh;
        min-height: 440px;
    }

    .dashboard-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-value {
        white-space: normal;
    }

    .card-header.d-flex {
        align-items: flex-start !important;
        flex-wrap: wrap;
        gap: .85rem;
    }

    .dataTables_wrapper .row {
        row-gap: .75rem;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: left !important;
    }

    .dataTables_wrapper .dataTables_filter label,
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-left: 0 !important;
    }
}

@media (max-width: 767.98px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-content-header {
        padding-block: .85rem;
    }

    .app-content-header .container-fluid,
    .app-content .container-fluid {
        padding-inline: .8rem;
    }

    .card {
        border-radius: 1rem;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    }

    .card-header,
    .card-body,
    .card-footer {
        padding: 1rem;
    }

    .card-header.d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }

    .card-header.d-flex .btn,
    .card-footer.d-flex .btn,
    #editorSection > .d-flex.justify-content-end .btn {
        width: 100%;
    }

    #editorSection > .d-flex.justify-content-end {
        flex-direction: column;
    }

    .modal-dialog {
        margin: .65rem;
    }

    .modal-content {
        border-radius: 1rem;
    }

    .table-responsive {
        border-radius: 1rem;
    }

    .dashboard-metric-grid {
        grid-template-columns: 1fr;
    }

    .dataTables_wrapper .dt-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .preview-frame {
        height: 58vh;
        min-height: 360px;
    }

    .preview-status {
        font-size: .74rem;
    }

    #quickProductSearch {
        font-size: 1rem;
        min-height: 48px;
    }

    #quickProductSearchResults {
        position: fixed !important;
        left: .8rem !important;
        right: .8rem !important;
        top: auto !important;
        max-height: 45vh !important;
        z-index: 1070 !important;
    }

    #detailTable {
        display: block;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        margin-bottom: 0;
    }

    #detailTable thead {
        display: none;
    }

    #detailTable tbody {
        display: grid;
        gap: .9rem;
    }

    #detailTable tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .85rem;
        padding: 1rem;
        border: 1px solid rgba(15, 23, 42, 0.08);
        border-radius: 1rem;
        background: #fff;
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
    }

    #detailTable tbody td {
        display: flex;
        flex-direction: column;
        gap: .35rem;
        padding: 0 !important;
        border: 0 !important;
        text-align: left !important;
        min-width: 0;
    }

    #detailTable tbody td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: .74rem;
        font-weight: 800;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    #detailTable .line-product-cell,
    #detailTable .line-action-cell {
        grid-column: 1 / -1;
        min-width: 0;
    }

    #detailTable .line-product-cell .select2-container {
        width: 100% !important;
    }

    #detailTable .line-stock {
        line-height: 1.35;
    }

    #detailTable .line-quantity,
    #detailTable .line-price,
    #detailTable .line-discount,
    #detailTable .line-tax-rate {
        min-width: 0;
        min-height: 42px;
        font-size: 1rem;
    }

    #detailTable .line-tax-amount,
    #detailTable .line-total-display {
        min-width: 0;
        padding: .55rem .7rem;
        border-radius: .75rem;
        background: rgba(15, 23, 42, 0.04);
        text-align: right;
        font-size: 1.05rem;
    }

    #detailTable .line-remove {
        width: 100%;
        min-height: 42px;
    }

    .line-remove-text {
        display: inline;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: .35rem;
    }
}

@media (max-width: 575.98px) {
    #detailTable tbody tr {
        grid-template-columns: 1fr;
    }

    .dataTables_wrapper .dt-buttons {
        width: 100%;
    }

    .dataTables_wrapper .dt-buttons .btn,
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        width: 100%;
        justify-content: center;
    }

    .btn-group.preview-toolbar {
        width: 100%;
    }

    .btn-group.preview-toolbar .btn {
        flex: 1 1 0;
    }
}

.tracking-public-page {
    min-height: 100vh;
    margin: 0;
    color: #172033;
    background:
        radial-gradient(circle at 14% 10%, rgba(20, 87, 217, .14), transparent 30%),
        radial-gradient(circle at 86% 80%, rgba(12, 148, 136, .16), transparent 32%),
        linear-gradient(135deg, #f4f7fb 0%, #ffffff 50%, #eef7f2 100%);
}

.tracking-public-shell {
    width: min(980px, calc(100% - 2rem));
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 4.5rem) 0;
}

.tracking-card {
    overflow: hidden;
    border: 1px solid rgba(23, 32, 51, .09);
    border-radius: 28px;
    background: rgba(255, 255, 255, .93);
    box-shadow: 0 26px 80px rgba(23, 32, 51, .13);
}

.tracking-card-header {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    padding: clamp(1.4rem, 4vw, 2.5rem);
    border-bottom: 1px solid rgba(23, 32, 51, .08);
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(238,247,242,.7));
}

.tracking-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
    padding: .65rem;
    border: 1px solid rgba(23, 32, 51, .08);
    border-radius: 22px;
    background: #fff;
}

.tracking-eyebrow {
    margin-bottom: .25rem;
    color: #1457d9;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.tracking-card h1 {
    margin: 0;
    font-size: clamp(1.65rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -.04em;
}

.tracking-card p {
    max-width: 54rem;
    margin: .45rem 0 0;
    color: #607089;
}

.tracking-search,
.tracking-result {
    padding: clamp(1.4rem, 4vw, 2.5rem);
}

.tracking-search .form-control {
    min-height: 3.35rem;
    font-weight: 700;
    letter-spacing: .03em;
}

.tracking-result {
    border-top: 1px solid rgba(23, 32, 51, .08);
    background: #fff;
}

.tracking-alert {
    margin-inline: clamp(1.4rem, 4vw, 2.5rem);
}

.tracking-result-top {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.tracking-result-top strong {
    display: block;
    font-size: clamp(1.25rem, 3vw, 2rem);
    letter-spacing: -.02em;
}

.tracking-label,
.tracking-grid span,
.tracking-money span {
    display: block;
    margin-bottom: .28rem;
    color: #607089;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tracking-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: .45rem .85rem;
    border-radius: 999px;
    font-weight: 800;
    color: #172033;
    background: #eef2f7;
}

.tracking-status-badge.is-success {
    color: #05603a;
    background: #dcfae6;
}

.tracking-status-badge.is-warning {
    color: #8a4b00;
    background: #fff1c6;
}

.tracking-status-badge.is-danger {
    color: #981b1f;
    background: #ffe1e3;
}

.tracking-grid,
.tracking-money {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}

.tracking-grid > div,
.tracking-money > div {
    padding: 1rem;
    border: 1px solid rgba(23, 32, 51, .08);
    border-radius: 18px;
    background: #f8fafc;
}

.tracking-money {
    margin-top: .85rem;
}

.tracking-money strong {
    font-size: 1.2rem;
}

.tracking-note {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    margin-top: 1rem;
    padding: .95rem;
    border: 1px solid rgba(20, 87, 217, .12);
    border-radius: 18px;
    color: #465873;
    background: rgba(20, 87, 217, .06);
}

.tracking-note i {
    color: #1457d9;
    font-size: 1.15rem;
}

@media (max-width: 767.98px) {
    .tracking-card-header,
    .tracking-result-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .tracking-grid,
    .tracking-money {
        grid-template-columns: 1fr;
    }

    .tracking-search .input-group {
        display: grid;
        gap: .75rem;
    }

    .tracking-search .input-group > .form-control,
    .tracking-search .input-group > .btn {
        width: 100%;
        border-radius: .75rem !important;
    }
}

@media (max-width: 767.98px) {
    #wasteDetailTable,
    #adjustmentDetailTable {
        display: block;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        margin-bottom: 0;
    }

    #wasteDetailTable thead,
    #adjustmentDetailTable thead {
        display: none;
    }

    #wasteDetailTable tbody,
    #adjustmentDetailTable tbody {
        display: grid;
        gap: .9rem;
    }

    #wasteDetailTable tbody tr,
    #adjustmentDetailTable tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .85rem;
        padding: 1rem;
        border: 1px solid rgba(15, 23, 42, 0.08);
        border-radius: 1rem;
        background: #fff;
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
    }

    #wasteDetailTable tbody td,
    #adjustmentDetailTable tbody td {
        display: flex;
        flex-direction: column;
        gap: .35rem;
        padding: 0 !important;
        border: 0 !important;
        text-align: left !important;
        min-width: 0;
    }

    #wasteDetailTable tbody td::before,
    #adjustmentDetailTable tbody td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: .74rem;
        font-weight: 800;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    #wasteDetailTable .line-product-cell,
    #wasteDetailTable .line-action-cell,
    #adjustmentDetailTable .line-product-cell,
    #adjustmentDetailTable .line-action-cell {
        grid-column: 1 / -1;
        min-width: 0;
    }

    #wasteDetailTable .select2-container,
    #adjustmentDetailTable .select2-container {
        width: 100% !important;
    }

    #wasteDetailTable .waste-line-quantity,
    #wasteDetailTable .waste-line-cost,
    #adjustmentDetailTable .adjustment-line-quantity,
    #adjustmentDetailTable .adjustment-line-cost {
        min-width: 0;
        min-height: 42px;
        font-size: 1rem;
    }

    #wasteDetailTable .waste-line-total-display,
    #adjustmentDetailTable .adjustment-line-stock-system,
    #adjustmentDetailTable .adjustment-line-net-display,
    #adjustmentDetailTable .adjustment-line-result-display {
        min-width: 0;
        padding: .55rem .7rem;
        border-radius: .75rem;
        background: rgba(15, 23, 42, 0.04);
        text-align: right;
        font-size: 1.05rem;
    }

    #wasteDetailTable .waste-line-remove,
    #adjustmentDetailTable .adjustment-line-remove {
        width: 100%;
        min-height: 42px;
    }
}

@media (max-width: 575.98px) {
    #wasteDetailTable tbody tr,
    #adjustmentDetailTable tbody tr {
        grid-template-columns: 1fr;
    }
}

.security-tabs .nav-link {
    border-radius: 999px;
    padding-inline: 1rem;
}

.security-summary-card {
    min-width: 220px;
    padding: 1rem 1.15rem;
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(13, 110, 253, 0.08), rgba(25, 135, 84, 0.08));
}

.permission-grid-shell {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    padding: 1rem;
    background: rgba(248, 250, 252, 0.78);
}

.permission-toggle-cell .form-check-input {
    float: none;
}

.cash-status-card {
    background:
        radial-gradient(circle at top right, rgba(25, 135, 84, 0.16), transparent 34%),
        linear-gradient(160deg, #ffffff 0%, #f8fbfd 100%);
}

.cash-report-card {
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.12), transparent 32%),
        linear-gradient(160deg, #ffffff 0%, #f7fbff 100%);
}

.cash-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.cash-metric-tile {
    padding: .9rem 1rem;
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.04);
}

.cash-metric-tile span {
    display: block;
    margin-bottom: .35rem;
    color: #64748b;
    font-size: .85rem;
}

.cash-metric-tile strong {
    font-size: 1.15rem;
}

.cash-metric-strong {
    background: rgba(13, 110, 253, 0.08);
}

.cash-note-block {
    padding: .9rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.cash-close-summary {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(220, 53, 69, 0.08);
}

.configuration-hero-card {
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.14), transparent 32%),
        linear-gradient(160deg, #ffffff 0%, #f7fbff 100%);
}

.configuration-context-card {
    padding: 1rem 1.15rem;
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.04);
}

.company-brand-card {
    background:
        radial-gradient(circle at top left, rgba(25, 135, 84, 0.12), transparent 28%),
        linear-gradient(155deg, #ffffff 0%, #fbfcfd 100%);
}

.company-logo-preview-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 1rem;
    border-radius: 1.25rem;
    border: 1px dashed rgba(15, 23, 42, 0.12);
    background:
        linear-gradient(135deg, rgba(13, 110, 253, 0.04), rgba(25, 135, 84, 0.04)),
        #fff;
}

.company-logo-preview {
    max-width: 100%;
    max-height: 170px;
    object-fit: contain;
}

.company-logo-preview.is-empty {
    opacity: .35;
}

.configuration-preview-actions {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.04);
}

.configuration-role-list {
    display: grid;
    gap: .75rem;
}

.configuration-role-item {
    padding: .9rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(248, 250, 252, 0.78);
}

.organization-admin-card {
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.08), transparent 28%),
        linear-gradient(160deg, #ffffff 0%, #fbfcfe 100%);
}

.organization-selected-shell,
.organization-bootstrap-block {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(248, 250, 252, 0.78);
}

.organization-panel-shell {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.08), transparent 32%),
        rgba(255, 255, 255, 0.82);
}

.organization-hierarchy-banner {
    padding: 1rem 1.15rem;
    border-radius: 1.15rem;
    border: 1px dashed rgba(15, 23, 42, 0.12);
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.08), transparent 28%),
        linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.96));
}

.organization-hierarchy-flow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .85rem;
}

.organization-hierarchy-pill {
    display: inline-flex;
    align-items: center;
    padding: .65rem 1rem;
    border-radius: 999px;
    background: #0d6efd;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(13, 110, 253, 0.18);
}

.organization-hierarchy-pill-child {
    background: #198754;
    box-shadow: 0 12px 24px rgba(25, 135, 84, 0.18);
}

.organization-hierarchy-separator {
    color: #64748b;
    font-size: 1rem;
}

.organization-company-list,
.organization-branch-list {
    display: grid;
    gap: 1rem;
}

.organization-company-card,
.organization-branch-card {
    padding: 1rem 1.05rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.organization-company-card.is-selected {
    border-color: rgba(13, 110, 253, 0.28);
    box-shadow: 0 18px 36px rgba(13, 110, 253, 0.12);
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.08), transparent 34%),
        rgba(255, 255, 255, 0.98);
}

.organization-company-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
    color: #475569;
    font-size: .88rem;
}

.organization-selected-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.organization-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .9rem;
}

.organization-summary-item {
    padding: .95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.72);
}

.organization-summary-label {
    color: #64748b;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .35rem;
}

.organization-summary-value {
    color: #0f172a;
    font-weight: 700;
}

.organization-child-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.metric-card .metric-actions {
    margin-top: 0;
}

.metric-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .7rem;
    margin-top: auto;
}

.metric-chip-stack {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.metric-inline-stat {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #334155;
    font-size: .82rem;
    font-weight: 600;
}

.btn-metric-action {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: .85rem;
    padding: .55rem .95rem;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.btn-metric-action:hover,
.btn-metric-action:focus {
    color: #0f172a;
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.2);
}

.dataTables_wrapper .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.dataTables_wrapper .dt-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 46px;
    padding: .72rem 1rem;
    border-radius: .9rem;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.btn-create-record {
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.2);
}

.btn-create-record:hover,
.btn-create-record:focus {
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    border-color: #1e40af;
}

.btn-export-excel {
    color: #fff;
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    border-color: #157347;
    box-shadow: 0 10px 24px rgba(25, 135, 84, 0.18);
}

.btn-export-excel:hover,
.btn-export-excel:focus {
    color: #fff;
    background: linear-gradient(135deg, #157347 0%, #146c43 100%);
    border-color: #146c43;
}

.btn-report-pdf {
    box-shadow: 0 10px 24px rgba(220, 53, 69, 0.18);
}

.report-hero-card {
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.14), transparent 34%),
        linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
}

.report-action-card {
    background:
        radial-gradient(circle at top right, rgba(15, 23, 42, 0.05), transparent 30%),
        linear-gradient(165deg, #ffffff 0%, #fbfcfe 100%);
}

.executive-utility-card {
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.12), transparent 34%),
        radial-gradient(circle at bottom right, rgba(25, 135, 84, 0.12), transparent 34%),
        linear-gradient(155deg, #ffffff 0%, #f8fbfd 100%);
}

.dashboard-card-header .card-title {
    float: none;
    margin: 0 0 .35rem;
}

.dashboard-card-subtitle {
    display: block;
    color: #64748b;
    font-size: .9rem;
    line-height: 1.45;
}

.profitability-hero-card {
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.14), transparent 32%),
        radial-gradient(circle at bottom left, rgba(25, 135, 84, 0.12), transparent 30%),
        linear-gradient(160deg, #ffffff 0%, #f9fbfd 100%);
}

.profitability-metric-card {
    background:
        radial-gradient(circle at top right, rgba(15, 23, 42, 0.05), transparent 30%),
        linear-gradient(165deg, #ffffff 0%, #fbfcfd 100%);
}

.profit-trend-chart-shell {
    position: relative;
    height: 340px;
    min-height: 340px;
}

.profit-category-chart-shell {
    position: relative;
    height: 240px;
    min-height: 240px;
}

.loss-chart-shell {
    position: relative;
    height: 220px;
    min-height: 220px;
}

.profit-alert-item {
    padding: 1rem 1.05rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(248, 250, 252, 0.82);
}

.waste-summary-card {
    background:
        radial-gradient(circle at top right, rgba(220, 53, 69, 0.12), transparent 28%),
        linear-gradient(160deg, #ffffff 0%, #fff8f8 100%);
}

.inventory-adjustment-summary-card {
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(25, 135, 84, 0.08), transparent 26%),
        linear-gradient(160deg, #ffffff 0%, #f7fbff 100%);
}

.expense-insight-card {
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.12), transparent 30%),
        linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
}

.expense-insight-item {
    padding: 1rem 1.05rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(248, 250, 252, 0.82);
}

.expense-switch-shell {
    padding: 1rem 1.05rem;
    border-radius: 1rem;
    background: rgba(13, 110, 253, 0.05);
}

@media (max-width: 767.98px) {
    .organization-summary-grid {
        grid-template-columns: 1fr;
    }

    .cash-metrics-grid {
        grid-template-columns: 1fr;
    }

    .profit-trend-chart-shell {
        height: 280px;
        min-height: 280px;
    }

    .profit-category-chart-shell {
        height: 220px;
        min-height: 220px;
    }

    .loss-chart-shell {
        height: 200px;
        min-height: 200px;
    }
}

@media (max-width: 767.98px) {
    .auth-shell {
        gap: 1rem;
        padding: .85rem;
    }

    .auth-grid-glow {
        inset: 0;
    }

    .auth-orb {
        width: 10rem;
        height: 10rem;
    }

    .auth-hero {
        padding: 1.35rem;
        border-radius: 1.35rem;
    }

    .auth-hero h1 {
        font-size: clamp(2rem, 12vw, 3rem);
        letter-spacing: -.045em;
    }

    .auth-flow-panel {
        padding: .85rem;
    }

    .auth-flow-track {
        grid-template-columns: 1fr;
    }

    .auth-flow-line {
        width: 2px;
        height: 1.25rem;
        justify-self: center;
        background: linear-gradient(180deg, transparent, rgba(20, 87, 217, .55), transparent);
    }

    .auth-login-card {
        border-radius: 1.25rem;
    }

    .auth-login-card .card-header {
        padding-top: 1.35rem;
    }

    .auth-login-card .card-body {
        padding: 1.15rem;
    }

    .auth-secure-note {
        font-size: .85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-orb,
    .auth-hero,
    .auth-hero::after,
    .auth-card,
    .auth-flow-line,
    .auth-pulse-row span {
        animation: none !important;
    }
}
