:root {
    --app-gradient: linear-gradient(225deg, rgb(187, 33, 45) 0%, rgb(44, 50, 132) 100%);
    --brand-red: rgb(187, 33, 45);
    --brand-blue: rgb(44, 50, 132);
    --panel-border: rgba(255, 255, 255, 0.18);
}

body {
    min-height: 100vh;
}

.login-body,
.app-body {
    background: var(--app-gradient);
    background-attachment: fixed;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 430px);
    padding: 34px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.login-logo {
    width: min(300px, 85%);
    height: auto;
}

.nav-logo {
    max-height: 46px;
    width: auto;
}

.white-box {
    background: #fff;
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.table td {
    vertical-align: middle;
}

.btn,
.form-control,
.form-select,
.input-group-text,
.alert {
    border-radius: 6px;
}

.btn {
    font-weight: 600;
}

.input-group > .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .input-group-text {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.app-header {
    background: rgba(16, 18, 42, 0.44);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--panel-border);
    padding: 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.16);
}

.header-top {
    padding-bottom: 12px;
}

.header-menu-wrap {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
}

.header-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.menu-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 14px 12px;
    color: #fff;
    text-decoration: none;
    background: transparent;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: background .18s ease, box-shadow .18s ease;
}

.menu-link:last-child {
    border-right: 0;
}

.menu-link:hover,
.menu-link:focus,
.menu-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.92);
}

.logout-btn {
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.delete-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff1f1 0%, #ffdede 100%);
    color: #dc3545;
    font-size: 30px;
    border: 1px solid #ffd0d0;
}

/* Premium modals */
.modal-backdrop.show {
    opacity: .72;
}

.premium-modal .modal-content {
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 34px 100px rgba(4, 7, 32, 0.42);
}

.premium-modal .modal-header {
    min-height: 82px;
    border-bottom: 0;
    color: #fff;
    background: var(--app-gradient);
    padding: 20px 24px;
    position: relative;
}

.premium-modal .modal-header::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.34);
}

.premium-modal .modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.premium-modal .modal-title i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
}

.premium-modal .btn-close {
    filter: invert(1) grayscale(100%);
    opacity: .9;
}

.premium-modal .modal-body {
    padding: 24px;
    background: #f8f9fc;
}

.premium-modal .modal-footer {
    padding: 18px 24px 22px;
    border-top: 1px solid #e9ecf3;
    background: #fff;
}

.premium-modal .form-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 800;
    color: #5e6475;
}

.premium-modal .form-control,
.premium-modal .form-select {
    border: 1px solid #dce1ea;
    background-color: #fff;
    box-shadow: 0 1px 0 rgba(16, 24, 40, .04);
}

.premium-modal .form-control:focus,
.premium-modal .form-select:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 .22rem rgba(44, 50, 132, .14);
}

.premium-delete .modal-content {
    border-radius: 10px;
    border: 0;
    overflow: hidden;
    box-shadow: 0 34px 100px rgba(4, 7, 32, 0.42);
}

.premium-delete .modal-body {
    padding: 30px 26px 12px;
    background: radial-gradient(circle at top, #fff 0%, #fff 52%, #f8f9fc 100%);
}

.premium-delete .modal-footer {
    padding: 14px 26px 26px;
    background: #f8f9fc;
}

@media (max-width: 575.98px) {
    .app-header {
        padding-top: 10px;
    }

    .nav-logo {
        max-height: 38px;
    }

    .header-top {
        padding-bottom: 10px;
    }

    .header-menu-wrap .container {
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
    }

    .menu-link {
        min-height: 48px;
        padding: 12px 8px;
        font-size: 0.9rem;
    }

    .logout-btn {
        padding: 7px 10px;
        font-size: 0.86rem;
    }

    .white-box {
        padding: 18px;
        border-radius: 8px;
    }

    .premium-modal .modal-header,
    .premium-modal .modal-body,
    .premium-modal .modal-footer {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* UI refresh v20260519-2 */
.app-control,
.form-control,
.form-select {
    min-height: 46px;
    border: 1px solid #d9deea;
    background-color: #fff;
    box-shadow: 0 1px 0 rgba(16, 24, 40, .03);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.app-control:focus,
.form-control:focus,
.form-select:focus {
    border-color: rgba(44, 50, 132, .78);
    box-shadow: 0 0 0 .2rem rgba(44, 50, 132, .12), 0 10px 24px rgba(16, 24, 40, .06);
}

.premium-modal .modal-dialog {
    max-width: 560px;
}

.premium-modal .modal-content,
.premium-delete .modal-content {
    border-radius: 8px;
    border: 1px solid rgba(225, 229, 239, .95);
    background: #fff;
    box-shadow: 0 36px 110px rgba(8, 12, 40, .45);
}

.premium-modal .modal-content::before,
.premium-delete .modal-content::before {
    content: "";
    display: block;
    height: 4px;
    background: var(--app-gradient);
}

.premium-modal .premium-modal-head {
    min-height: auto;
    color: #111827;
    background: linear-gradient(180deg, #fff 0%, #f8f9fd 100%);
    border-bottom: 1px solid #e8ecf4;
    padding: 22px 26px;
}

.premium-modal .premium-modal-head::after {
    display: none;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 8px;
    background: var(--app-gradient);
    box-shadow: 0 14px 30px rgba(44, 50, 132, .22);
}

.premium-modal .modal-title i,
.premium-modal .modal-title-wrap i {
    background: transparent;
    border: 0;
    border-radius: 0;
    width: auto;
    height: auto;
}

.modal-kicker {
    font-size: .72rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 800;
    color: #6b7280;
}

.premium-modal .btn-close {
    filter: none;
    opacity: .55;
}

.premium-modal .btn-close:hover {
    opacity: .9;
}

.premium-modal .modal-body {
    padding: 26px;
    background: #fff;
}

.premium-modal .modal-footer {
    padding: 18px 26px 24px;
    border-top: 1px solid #edf0f6;
    background: #fafbfe;
}

.form-stack {
    display: grid;
    gap: 18px;
}

.field-shell {
    position: relative;
}

.field-shell > i {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #697086;
    z-index: 2;
    pointer-events: none;
}

.field-shell .form-control,
.field-shell .form-select {
    padding-left: 44px;
}

.textarea-shell > i {
    top: 18px;
    transform: none;
}

.textarea-shell textarea.form-control {
    padding-top: 14px;
}

.form-hint {
    margin-top: 7px;
    color: #7b8192;
    font-size: .82rem;
}

.premium-alert {
    border-radius: 8px;
    border: 1px solid rgba(220, 53, 69, .18);
    background: #fff5f6;
}

.btn-premium {
    color: #fff;
    border: 0;
    background: var(--app-gradient);
    box-shadow: 0 12px 26px rgba(44, 50, 132, .22);
}

.btn-premium:hover,
.btn-premium:focus {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(44, 50, 132, .26);
}

.btn-ghost {
    color: #344054;
    border: 1px solid #d8deeb;
    background: #fff;
}

.btn-ghost:hover,
.btn-ghost:focus {
    color: #111827;
    background: #f5f7fb;
    border-color: #cbd3e3;
}

.premium-delete .modal-dialog {
    max-width: 430px;
}

.premium-delete .modal-body {
    padding: 34px 32px 12px;
    background: #fff;
}

.premium-delete .modal-footer {
    padding: 16px 32px 30px;
    background: #fff;
}

.delete-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    color: #b42318;
    background: radial-gradient(circle at 50% 40%, #fff 0%, #fff 42%, #fff0f0 100%);
    border: 1px solid #ffd7d7;
    box-shadow: 0 16px 34px rgba(180, 35, 24, .13);
}

.btn-danger-soft {
    color: #fff;
    background: #b42318;
    border: 1px solid #b42318;
    box-shadow: 0 12px 26px rgba(180, 35, 24, .18);
}

.btn-danger-soft:hover,
.btn-danger-soft:focus {
    color: #fff;
    background: #931b13;
    border-color: #931b13;
}

@media (max-width: 575.98px) {
    .premium-modal .premium-modal-head,
    .premium-modal .modal-body,
    .premium-modal .modal-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .modal-icon {
        width: 40px;
        height: 40px;
    }

    .premium-delete .modal-body,
    .premium-delete .modal-footer {
        padding-left: 22px;
        padding-right: 22px;
    }
}

/* QR scanner update v20260519-3 */
.section-kicker {
    font-size: .74rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 800;
    color: #6b7280;
    margin-bottom: 8px;
}

.scan-box {
    overflow: hidden;
}

.scanner-shell {
    margin-top: 22px;
    padding: 14px;
    background: linear-gradient(180deg, #f8f9fd 0%, #ffffff 100%);
    border: 1px solid #e5eaf3;
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

#qr-reader {
    width: 100%;
    border: 0 !important;
    overflow: hidden;
    border-radius: 8px;
    background: #0f172a;
}

#qr-reader video {
    border-radius: 8px;
}

#qr-reader__dashboard_section_csr button,
#qr-reader__dashboard button,
#qr-reader__filescan_input + button {
    border: 0 !important;
    border-radius: 6px !important;
    padding: 10px 14px !important;
    color: #fff !important;
    font-weight: 700 !important;
    background: linear-gradient(225deg, rgb(187, 33, 45) 0%, rgb(44, 50, 132) 100%) !important;
}

#qr-reader__camera_selection {
    min-height: 42px;
    border: 1px solid #d9deea !important;
    border-radius: 6px !important;
    padding: 0 10px !important;
    margin-right: 8px !important;
}

#qr-reader__status_span,
#qr-reader__dashboard_section_swaplink {
    color: #5e6475 !important;
    font-weight: 600;
}

.scanner-note {
    color: #ffffff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    padding: 12px 14px;
    border-radius: 8px;
}

.qr-preview {
    padding: 15px 16px;
    border: 1px solid #e4e9f3;
    border-radius: 8px;
    background: #fafbfe;
}

.qr-preview-label {
    display: block;
    margin-bottom: 5px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 800;
    color: #70778a;
}

.qr-preview strong {
    display: block;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: #111827;
}

.qr-code-cell {
    color: #30374a;
    background: #f5f7fb;
    border: 1px solid #e6eaf2;
    padding: 5px 7px;
    border-radius: 6px;
    white-space: normal;
}

@media (max-width: 575.98px) {
    .scanner-shell {
        margin-left: -6px;
        margin-right: -6px;
        padding: 8px;
    }
}

/* UI update v20260519-4 */
.header-menu-wrap {
    background: rgba(255, 255, 255, 0.11);
}
.header-menu {
    gap: 0;
}
.menu-link {
    min-height: 56px;
    border-radius: 0;
}
.white-box,
.login-card,
.scanner-shell,
.premium-modal .modal-content,
.premium-delete .modal-content,
.field-shell,
.qr-preview,
.btn,
.form-control,
.form-select {
    border-radius: 6px !important;
}
.scanner-shell {
    min-height: 440px;
    background: #ffffff;
    border-color: #e2e7f0;
    display: flex;
    align-items: stretch;
}
#qr-reader {
    min-height: 410px;
    background: #ffffff !important;
    color: #1f2937;
}
#qr-reader > div:first-child {
    min-height: 320px;
}
#qr-reader__scan_region {
    min-height: 300px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff !important;
}
#qr-reader__scan_region img {
    opacity: .45;
}
#qr-reader__dashboard {
    padding: 18px !important;
    background: #fff !important;
}
.scanner-note {
    color: #4b5563;
    background: #ffffff;
    border-color: #e5eaf3;
}
.manual-add-wrap {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}
.btn-manual-add {
    min-width: min(100%, 280px);
}
.btn-primary,
.btn-premium {
    border: 0 !important;
    color: #fff !important;
    font-weight: 800;
    background: linear-gradient(225deg, rgb(187, 33, 45) 0%, rgb(44, 50, 132) 100%) !important;
    box-shadow: 0 14px 30px rgba(44, 50, 132, .22);
}
.btn-primary:hover,
.btn-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(44, 50, 132, .28);
}
.premium-modal .premium-modal-head {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
    border-bottom: 1px solid #e8edf5;
}
.modal-icon {
    background: linear-gradient(225deg, rgb(187, 33, 45) 0%, rgb(44, 50, 132) 100%);
    color: #fff;
    box-shadow: 0 12px 26px rgba(44, 50, 132, .22);
}
.field-shell {
    background: #fff;
    border: 1px solid #dfe5ef;
    box-shadow: 0 8px 22px rgba(17, 24, 39, .04);
}
.field-shell:focus-within {
    border-color: rgba(44, 50, 132, .45);
    box-shadow: 0 0 0 4px rgba(44, 50, 132, .08);
}
.field-shell .form-control,
.field-shell .form-select {
    background: transparent !important;
}
.table thead th {
    white-space: nowrap;
}
.premium-toast {
    position: fixed;
    z-index: 2000;
    top: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(-18px);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(92vw, 360px);
    justify-content: center;
    padding: 13px 18px;
    color: #0f5132;
    background: rgba(240, 253, 244, .96);
    border: 1px solid rgba(22, 163, 74, .20);
    box-shadow: 0 18px 50px rgba(16, 24, 40, .18);
    backdrop-filter: blur(14px);
    border-radius: 6px;
    font-weight: 800;
    animation: toastInOut 4.2s ease forwards;
}
.premium-toast i {
    color: #16a34a;
    font-size: 1.15rem;
}
@keyframes toastInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-18px) scale(.98); }
    12%, 78% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-18px) scale(.98); visibility: hidden; }
}
@media (max-width: 575.98px) {
    .scanner-shell {
        min-height: 400px;
        margin-left: 0;
        margin-right: 0;
        padding: 10px;
    }
    #qr-reader {
        min-height: 375px;
    }
    .premium-toast {
        top: 12px;
    }
}


/* UI polish v20260519-6 */
#qr-reader__camera_selection {
    width: min(50%, 360px) !important;
    max-width: 360px !important;
    min-width: 220px !important;
    min-height: 40px !important;
    appearance: none;
    -webkit-appearance: none;
    color: #111827 !important;
    background-color: #fff !important;
    background-image: linear-gradient(45deg, transparent 50%, #2c3284 50%), linear-gradient(135deg, #2c3284 50%, transparent 50%), linear-gradient(180deg, #fff 0%, #f8fafc 100%) !important;
    background-position: calc(100% - 18px) 17px, calc(100% - 12px) 17px, 0 0 !important;
    background-size: 6px 6px, 6px 6px, 100% 100% !important;
    background-repeat: no-repeat !important;
    border: 1px solid #d8deeb !important;
    box-shadow: 0 8px 22px rgba(17, 24, 39, .08) !important;
    padding: 0 38px 0 12px !important;
    font-weight: 700 !important;
}
#qr-reader__camera_selection:focus {
    outline: 0 !important;
    border-color: rgba(44, 50, 132, .55) !important;
    box-shadow: 0 0 0 4px rgba(44, 50, 132, .10), 0 10px 24px rgba(17, 24, 39, .08) !important;
}
#qr-reader__dashboard_section_csr span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}
.premium-toast {
    min-width: min(92vw, 420px);
    color: #0f172a;
    background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(245,255,249,.98) 100%);
    border: 1px solid rgba(34, 197, 94, .28);
    box-shadow: 0 24px 70px rgba(3, 7, 18, .22), inset 0 1px 0 rgba(255,255,255,.95);
    padding: 15px 20px 18px 58px;
    border-radius: 10px;
    letter-spacing: -.01em;
    justify-content: flex-start;
    position: fixed;
}
.premium-toast::before {
    content: "";
    position: absolute;
    left: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #dcfce7 0%, #22c55e 72%);
    box-shadow: 0 10px 22px rgba(34, 197, 94, .35);
}
.premium-toast::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 8px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e 0%, rgba(34,197,94,.15) 100%);
    transform-origin: left center;
    animation: toastProgress 4.2s linear forwards;
}
.premium-toast i {
    position: absolute;
    left: 26px;
    color: #fff;
    z-index: 1;
    font-size: 1rem;
}
@keyframes toastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}
.lead-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .78rem;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
    border: 1px solid transparent;
}
.lead-badge-hot { color: #14532d; background: #dcfce7; border-color: #bbf7d0; }
.lead-badge-warm { color: #7c2d12; background: #ffedd5; border-color: #fed7aa; }
.lead-badge-cold { color: #1e3a8a; background: #dbeafe; border-color: #bfdbfe; }
.lead-badge-follow { color: #4c1d95; background: #ede9fe; border-color: #ddd6fe; }
.lead-badge-bad { color: #7f1d1d; background: #fee2e2; border-color: #fecaca; }
.lead-badge-neutral { color: #374151; background: #f3f4f6; border-color: #e5e7eb; }
@media (max-width: 575.98px) {
    #qr-reader__camera_selection {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 10px 0 !important;
    }
    .premium-toast {
        width: calc(100vw - 24px);
        min-width: 0;
    }
}

/* Premium soft UI polish v20260519-8 */
.premium-toast {
    width: auto !important;
    min-width: 0 !important;
    max-width: min(92vw, 380px) !important;
    top: 18px !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(-12px) !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 11px 16px 11px 14px !important;
    color: #14532d !important;
    background: rgba(255, 255, 255, .88) !important;
    border: 1px solid rgba(22, 163, 74, .16) !important;
    border-radius: 8px !important;
    box-shadow: 0 14px 38px rgba(15, 23, 42, .14), inset 0 1px 0 rgba(255,255,255,.9) !important;
    backdrop-filter: blur(16px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(145%) !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    animation: softToastInOut 3.8s cubic-bezier(.2,.8,.2,1) forwards !important;
}
.premium-toast::before,
.premium-toast::after {
    display: none !important;
}
.premium-toast i {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    flex: 0 0 24px !important;
    border-radius: 50% !important;
    color: #16a34a !important;
    background: rgba(22, 163, 74, .10) !important;
    font-size: .9rem !important;
}
.premium-toast span {
    display: block !important;
    font-size: .94rem !important;
    line-height: 1.25 !important;
}
@keyframes softToastInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(.985); }
    14%, 82% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(.985); visibility: hidden; }
}

#qr-reader__dashboard_section_csr,
#qr-reader__dashboard_section_csr span {
    width: 100% !important;
}
#qr-reader__dashboard_section_csr span {
    justify-content: center !important;
}
#qr-reader select#qr-reader__camera_selection,
div#qr-reader select#qr-reader__camera_selection,
.html5-qrcode-element#qr-reader__camera_selection {
    width: min(50%, 280px) !important;
    max-width: 280px !important;
    min-width: 180px !important;
    height: 38px !important;
    min-height: 38px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    color: #182033 !important;
    background-color: #ffffff !important;
    background-image:
        linear-gradient(45deg, transparent 50%, #667085 50%),
        linear-gradient(135deg, #667085 50%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    background-position:
        calc(100% - 17px) 16px,
        calc(100% - 11px) 16px,
        0 0 !important;
    background-size: 6px 6px, 6px 6px, 100% 100% !important;
    background-repeat: no-repeat !important;
    border: 1px solid #d7deeb !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .07) !important;
    padding: 0 36px 0 12px !important;
    font-size: .9rem !important;
    font-weight: 650 !important;
    line-height: 38px !important;
    cursor: pointer !important;
}
#qr-reader select#qr-reader__camera_selection:hover,
div#qr-reader select#qr-reader__camera_selection:hover {
    border-color: #c4ccdc !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .09) !important;
}
#qr-reader select#qr-reader__camera_selection:focus,
div#qr-reader select#qr-reader__camera_selection:focus {
    outline: 0 !important;
    border-color: rgba(44, 50, 132, .55) !important;
    box-shadow: 0 0 0 4px rgba(44, 50, 132, .10), 0 10px 24px rgba(15, 23, 42, .09) !important;
}

#qr-reader__dashboard_section_csr button,
#qr-reader__dashboard button {
    min-height: 38px !important;
    padding: 9px 14px !important;
}

@media (max-width: 575.98px) {
    #qr-reader select#qr-reader__camera_selection,
    div#qr-reader select#qr-reader__camera_selection {
        width: min(100%, 260px) !important;
        max-width: 260px !important;
        min-width: 0 !important;
        margin: 0 auto 10px !important;
        display: block !important;
    }
    .premium-toast {
        top: 12px !important;
        max-width: calc(100vw - 24px) !important;
    }
}


/* Final QR polish v20260519-9 */
.scanner-shell {
    min-height: 250px !important;
    padding: 10px !important;
    background: #fff !important;
    align-items: center !important;
}
#qr-reader {
    min-height: 250px !important;
    height: 250px !important;
    background: #fff !important;
    border: 1px solid #edf0f6 !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05) !important;
}
#qr-reader > div:first-child,
#qr-reader__scan_region {
    min-height: 150px !important;
    height: 150px !important;
    background: #fff !important;
}
#qr-reader video {
    max-height: 150px !important;
    object-fit: cover !important;
}
#qr-reader__dashboard {
    padding: 10px 12px !important;
    background: #fff !important;
}
#qr-reader__dashboard_section_csr,
#qr-reader__dashboard_section_csr span,
#qr-reader__dashboard_section_csr div {
    text-align: center !important;
}
#qr-reader select,
#qr-reader select.html5-qrcode-element,
#qr-reader__camera_selection,
.premium-camera-select {
    display: inline-block !important;
    width: min(50%, 240px) !important;
    max-width: 240px !important;
    min-width: 160px !important;
    height: 36px !important;
    min-height: 36px !important;
    margin: 0 8px 8px 0 !important;
    padding: 0 34px 0 12px !important;
    color: #20283a !important;
    font-size: .86rem !important;
    font-weight: 700 !important;
    line-height: 36px !important;
    border: 1px solid #d7deeb !important;
    border-radius: 7px !important;
    outline: 0 !important;
    box-shadow: 0 7px 18px rgba(15, 23, 42, .07) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
    background-color: #fff !important;
    background-image:
        linear-gradient(45deg, transparent 50%, #667085 50%),
        linear-gradient(135deg, #667085 50%, transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%) !important;
    background-position:
        calc(100% - 16px) 15px,
        calc(100% - 10px) 15px,
        0 0 !important;
    background-size: 6px 6px, 6px 6px, 100% 100% !important;
    background-repeat: no-repeat !important;
}
#qr-reader select:focus,
#qr-reader__camera_selection:focus,
.premium-camera-select:focus {
    border-color: rgba(44, 50, 132, .48) !important;
    box-shadow: 0 0 0 4px rgba(44, 50, 132, .08), 0 9px 22px rgba(15, 23, 42, .08) !important;
}
#qr-reader__dashboard_section_csr button,
#qr-reader__dashboard button {
    min-height: 36px !important;
    padding: 8px 13px !important;
    border-radius: 7px !important;
    box-shadow: 0 9px 22px rgba(44, 50, 132, .16) !important;
}
.premium-toast {
    max-width: min(92vw, 340px) !important;
    padding: 10px 14px !important;
    gap: 9px !important;
    color: #1f2937 !important;
    background: rgba(255, 255, 255, .82) !important;
    border: 1px solid rgba(255,255,255,.62) !important;
    border-left: 3px solid rgba(22, 163, 74, .65) !important;
    border-radius: 9px !important;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .13) !important;
    backdrop-filter: blur(18px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
    font-weight: 650 !important;
}
.premium-toast i {
    width: 22px !important;
    height: 22px !important;
    flex-basis: 22px !important;
    color: #15803d !important;
    background: rgba(22, 163, 74, .08) !important;
    font-size: .82rem !important;
}
.premium-toast span {
    font-size: .9rem !important;
    line-height: 1.22 !important;
}
@media (max-width: 575.98px) {
    .scanner-shell { min-height: 250px !important; padding: 8px !important; }
    #qr-reader { min-height: 250px !important; height: 250px !important; }
    #qr-reader > div:first-child,
    #qr-reader__scan_region { min-height: 145px !important; height: 145px !important; }
    #qr-reader select,
    #qr-reader select.html5-qrcode-element,
    #qr-reader__camera_selection,
    .premium-camera-select {
        width: min(100%, 230px) !important;
        max-width: 230px !important;
        min-width: 0 !important;
        margin: 0 auto 8px !important;
        display: block !important;
    }
}

/* Scanner compact fix v20260519-10 */
.scanner-shell {
    min-height: 250px !important;
    height: auto !important;
    padding: 8px !important;
    overflow: visible !important;
    align-items: stretch !important;
}
#qr-reader {
    min-height: 250px !important;
    height: auto !important;
    overflow: visible !important;
}
#qr-reader > div:first-child {
    min-height: 108px !important;
    height: 108px !important;
    padding: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
#qr-reader__scan_region {
    min-height: 104px !important;
    height: 104px !important;
    padding: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}
#qr-reader__scan_region img {
    width: 68px !important;
    height: 68px !important;
    max-width: 68px !important;
    max-height: 68px !important;
    object-fit: contain !important;
}
#qr-reader video {
    max-height: 104px !important;
    width: 100% !important;
    object-fit: cover !important;
}
#qr-reader__dashboard {
    min-height: 118px !important;
    height: auto !important;
    padding: 8px 10px 10px !important;
    overflow: visible !important;
}
#qr-reader__dashboard_section_csr,
#qr-reader__dashboard_section_csr > div,
#qr-reader__dashboard_section_csr span {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
}
#qr-reader__dashboard_section_csr {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
}
#qr-reader__dashboard_section_csr button,
#qr-reader__dashboard button {
    min-height: 34px !important;
    height: 34px !important;
    padding: 7px 12px !important;
    font-size: .82rem !important;
    white-space: nowrap !important;
}
#qr-reader__dashboard_section_csr select,
#qr-reader select,
#qr-reader select.html5-qrcode-element,
#qr-reader__camera_selection,
.premium-camera-select {
    height: 34px !important;
    min-height: 34px !important;
    line-height: 34px !important;
    font-size: .82rem !important;
    margin-bottom: 6px !important;
}
@media (max-width: 575.98px) {
    .scanner-shell {
        min-height: 250px !important;
        padding: 7px !important;
    }
    #qr-reader {
        min-height: 250px !important;
    }
    #qr-reader > div:first-child,
    #qr-reader__scan_region {
        min-height: 96px !important;
        height: 96px !important;
    }
    #qr-reader__scan_region img {
        width: 58px !important;
        height: 58px !important;
        max-width: 58px !important;
        max-height: 58px !important;
    }
    #qr-reader video {
        max-height: 96px !important;
    }
    #qr-reader__dashboard {
        min-height: 122px !important;
        padding: 7px 8px 9px !important;
    }
}

/* Scanner icon/read area balance v20260519-11 */
.scanner-shell {
    min-height: 250px !important;
    padding: 8px !important;
}
#qr-reader {
    min-height: 250px !important;
}
#qr-reader > div:first-child,
#qr-reader__scan_region {
    min-height: 150px !important;
    height: 150px !important;
    padding: 6px !important;
}
#qr-reader__scan_region img {
    width: 112px !important;
    height: 112px !important;
    max-width: 112px !important;
    max-height: 112px !important;
    opacity: .92 !important;
}
#qr-reader video,
#qr-reader__scan_region video {
    min-height: 150px !important;
    max-height: 150px !important;
    height: 150px !important;
    width: 100% !important;
    object-fit: cover !important;
    border-radius: 14px !important;
}
#qr-reader__dashboard {
    min-height: 82px !important;
    padding: 7px 10px 9px !important;
}
#qr-reader__dashboard_section_csr {
    gap: 6px !important;
}
#qr-reader__dashboard_section_csr button,
#qr-reader__dashboard button {
    min-height: 32px !important;
    height: 32px !important;
    padding: 6px 12px !important;
}
@media (max-width: 575.98px) {
    #qr-reader > div:first-child,
    #qr-reader__scan_region {
        min-height: 142px !important;
        height: 142px !important;
    }
    #qr-reader__scan_region img {
        width: 104px !important;
        height: 104px !important;
        max-width: 104px !important;
        max-height: 104px !important;
    }
    #qr-reader video,
    #qr-reader__scan_region video {
        min-height: 142px !important;
        max-height: 142px !important;
        height: 142px !important;
    }
    #qr-reader__dashboard {
        min-height: 86px !important;
        padding: 7px 8px 8px !important;
    }
}

/* v10 scanner stability fix: keep Html5Qrcode internal video/canvas usable */
.scanner-shell {
    background: #fff !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
    border-radius: 12px !important;
    padding: 12px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08) !important;
    overflow: visible !important;
}

#qr-reader {
    width: 100% !important;
    min-height: 360px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: #fff !important;
    border: 0 !important;
}

#qr-reader > div:first-child,
#qr-reader__scan_region {
    min-height: 280px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: #fff !important;
}

#qr-reader__scan_region img {
    width: 118px !important;
    height: 118px !important;
    max-width: 118px !important;
    max-height: 118px !important;
    object-fit: contain !important;
    margin: 52px auto 28px !important;
    opacity: .82 !important;
    transform: none !important;
}

#qr-reader video,
#qr-reader canvas,
#qr-reader__scan_region video,
#qr-reader__scan_region canvas {
    width: 100% !important;
    min-height: 280px !important;
    height: 280px !important;
    max-height: none !important;
    object-fit: cover !important;
    display: block !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#qr-reader__dashboard {
    padding: 10px 0 0 !important;
    background: transparent !important;
    overflow: visible !important;
}

#qr-reader__dashboard_section_csr,
#qr-reader__dashboard_section_csr > div,
#qr-reader__dashboard_section_csr span {
    overflow: visible !important;
    max-height: none !important;
}

#qr-reader__dashboard_section_csr button,
#qr-reader__dashboard button {
    margin-top: 8px !important;
    white-space: normal !important;
}

#qr-reader select,
#qr-reader select.html5-qrcode-element,
#qr-reader__camera_selection,
.premium-camera-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: min(50%, 240px) !important;
    max-width: 240px !important;
    min-width: 160px !important;
    height: 36px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(15, 23, 42, .14) !important;
    background-color: #fff !important;
    background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%) !important;
    background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px !important;
    background-size: 5px 5px, 5px 5px !important;
    background-repeat: no-repeat !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06) !important;
    padding: 0 34px 0 12px !important;
    font-size: .86rem !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    outline: 0 !important;
}

.premium-toast {
    background: rgba(255, 255, 255, .92) !important;
    border: 1px solid rgba(34, 197, 94, .18) !important;
    color: #14532d !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .14) !important;
    backdrop-filter: blur(18px) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
}

.premium-toast i {
    color: #16a34a !important;
    background: rgba(34, 197, 94, .10) !important;
    border-radius: 999px !important;
    padding: 5px !important;
}

@media (max-width: 576px) {
    #qr-reader { min-height: 330px !important; }
    #qr-reader > div:first-child,
    #qr-reader__scan_region { min-height: 250px !important; }
    #qr-reader video,
    #qr-reader canvas,
    #qr-reader__scan_region video,
    #qr-reader__scan_region canvas { min-height: 250px !important; height: 250px !important; }
    #qr-reader__scan_region img {
        width: 100px !important;
        height: 100px !important;
        max-width: 100px !important;
        max-height: 100px !important;
        margin-top: 48px !important;
    }
}


/* v10 scanner stability fix: keep Html5Qrcode internal video/canvas usable */
.scanner-shell {
    background: #fff !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
    border-radius: 12px !important;
    padding: 12px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08) !important;
    overflow: visible !important;
}

#qr-reader {
    width: 100% !important;
    min-height: 360px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: #fff !important;
    border: 0 !important;
}

#qr-reader > div:first-child,
#qr-reader__scan_region {
    min-height: 280px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: #fff !important;
}

#qr-reader__scan_region img {
    width: 118px !important;
    height: 118px !important;
    max-width: 118px !important;
    max-height: 118px !important;
    object-fit: contain !important;
    margin: 52px auto 28px !important;
    opacity: .82 !important;
    transform: none !important;
}

#qr-reader video,
#qr-reader canvas,
#qr-reader__scan_region video,
#qr-reader__scan_region canvas {
    width: 100% !important;
    min-height: 280px !important;
    height: 280px !important;
    max-height: none !important;
    object-fit: cover !important;
    display: block !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#qr-reader__dashboard {
    padding: 10px 0 0 !important;
    background: transparent !important;
    overflow: visible !important;
}

#qr-reader__dashboard_section_csr,
#qr-reader__dashboard_section_csr > div,
#qr-reader__dashboard_section_csr span {
    overflow: visible !important;
    max-height: none !important;
}

#qr-reader__dashboard_section_csr button,
#qr-reader__dashboard button {
    margin-top: 8px !important;
    white-space: normal !important;
}

#qr-reader select,
#qr-reader select.html5-qrcode-element,
#qr-reader__camera_selection,
.premium-camera-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: min(50%, 240px) !important;
    max-width: 240px !important;
    min-width: 160px !important;
    height: 36px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(15, 23, 42, .14) !important;
    background-color: #fff !important;
    background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%) !important;
    background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px !important;
    background-size: 5px 5px, 5px 5px !important;
    background-repeat: no-repeat !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06) !important;
    padding: 0 34px 0 12px !important;
    font-size: .86rem !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    outline: 0 !important;
}

.premium-toast {
    background: rgba(255, 255, 255, .92) !important;
    border: 1px solid rgba(34, 197, 94, .18) !important;
    color: #14532d !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .14) !important;
    backdrop-filter: blur(18px) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
}

.premium-toast i {
    color: #16a34a !important;
    background: rgba(34, 197, 94, .10) !important;
    border-radius: 999px !important;
    padding: 5px !important;
}

@media (max-width: 576px) {
    #qr-reader { min-height: 330px !important; }
    #qr-reader > div:first-child,
    #qr-reader__scan_region { min-height: 250px !important; }
    #qr-reader video,
    #qr-reader canvas,
    #qr-reader__scan_region video,
    #qr-reader__scan_region canvas { min-height: 250px !important; height: 250px !important; }
    #qr-reader__scan_region img {
        width: 100px !important;
        height: 100px !important;
        max-width: 100px !important;
        max-height: 100px !important;
        margin-top: 48px !important;
    }
}


/* v11 camera clarity fix: do not style internal QR decoding layers */
#qr-reader,
#qr-reader__scan_region {
    background: #fff !important;
    overflow: visible !important;
}

#qr-reader video,
#qr-reader__scan_region video {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 260px !important;
    max-height: none !important;
    object-fit: contain !important;
    filter: none !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
    transform: none !important;
    box-shadow: none !important;
    background: #000 !important;
}

#qr-reader canvas,
#qr-reader__scan_region canvas {
    display: none !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#qr-reader__scan_region > div {
    filter: none !important;
    backdrop-filter: none !important;
}

#qr-reader__scan_region img {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    max-height: 120px !important;
    object-fit: contain !important;
    filter: none !important;
    opacity: .86 !important;
}

@media (max-width: 576px) {
    #qr-reader video,
    #qr-reader__scan_region video {
        min-height: 260px !important;
    }
}

/* QR direct scanner v20260519-14: remove Html5QrcodeScanner gaps and keep camera persistent */
.scanner-shell-direct {
    min-height: 0 !important;
    height: auto !important;
    padding: 12px !important;
    display: block !important;
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .075) !important;
    overflow: hidden !important;
}
.camera-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.camera-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #475467;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
    white-space: nowrap;
}
.camera-label i { color: rgb(44, 50, 132); }
.camera-select {
    width: min(50%, 250px) !important;
    max-width: 250px !important;
    min-width: 170px !important;
    height: 38px !important;
    border-radius: 9px !important;
    border: 1px solid #d8dfeb !important;
    padding: 0 36px 0 13px !important;
    color: #172033 !important;
    font-size: .86rem !important;
    font-weight: 700 !important;
    line-height: 38px !important;
    background-color: #fff !important;
    background-image: linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%), linear-gradient(180deg, #ffffff 0%, #f8fafd 100%) !important;
    background-position: calc(100% - 17px) 16px, calc(100% - 11px) 16px, 0 0 !important;
    background-size: 6px 6px, 6px 6px, 100% 100% !important;
    background-repeat: no-repeat !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .055) !important;
    outline: none !important;
}
.camera-select:disabled {
    opacity: .7;
    cursor: not-allowed;
}
.camera-select:focus {
    border-color: rgba(44, 50, 132, .45) !important;
    box-shadow: 0 0 0 4px rgba(44, 50, 132, .08), 0 10px 22px rgba(15, 23, 42, .075) !important;
}
.qr-reader-direct,
#qr-reader.qr-reader-direct {
    width: 100% !important;
    min-height: 285px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #eef2f7 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    overflow: hidden !important;
    position: relative !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.85) !important;
}
#qr-reader.qr-reader-direct > div,
#qr-reader.qr-reader-direct > div:first-child,
#qr-reader.qr-reader-direct #qr-reader__scan_region {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    background: transparent !important;
    border: 0 !important;
    overflow: visible !important;
}
#qr-reader.qr-reader-direct video,
#qr-reader.qr-reader-direct #qr-reader__scan_region video {
    display: block !important;
    width: 100% !important;
    height: 285px !important;
    min-height: 285px !important;
    max-height: 285px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
}
#qr-reader.qr-reader-direct canvas {
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
}
#qr-reader.qr-reader-direct img,
#qr-reader.qr-reader-direct [title="Info"],
#qr-reader.qr-reader-direct [aria-label="Info"],
#qr-reader.qr-reader-direct #qr-reader__dashboard,
#qr-reader.qr-reader-direct #qr-reader__header_message,
#qr-reader.qr-reader-direct #qr-reader__status_span,
#qr-reader.qr-reader-direct .html5-qrcode-element {
    display: none !important;
}
.camera-fallback {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    text-align: center;
    color: #475467;
    border: 1px dashed #d8dfeb;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafd 100%);
}
.camera-fallback-icon {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: rgb(44, 50, 132);
    background: rgba(44, 50, 132, .08);
    font-size: 1.25rem;
}
.camera-fallback p { margin: 0; font-weight: 650; }
@media (max-width: 575.98px) {
    .scanner-shell-direct { padding: 10px !important; }
    .camera-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
    .camera-select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .qr-reader-direct,
    #qr-reader.qr-reader-direct {
        min-height: 255px !important;
    }
    #qr-reader.qr-reader-direct video,
    #qr-reader.qr-reader-direct #qr-reader__scan_region video {
        height: 255px !important;
        min-height: 255px !important;
        max-height: 255px !important;
    }
    .camera-fallback { min-height: 230px; }
}


/* v20260519-16 login + camera fix */
.login-card .input-group.input-group-lg > .form-control {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.login-card .input-group.input-group-lg > .input-group-text {
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
}

.camera-select,
select#cameraSelect {
    display: block !important;
    width: min(50%, 250px) !important;
    max-width: 250px !important;
    min-width: 170px !important;
}
.camera-select:not(:disabled),
select#cameraSelect:not(:disabled) {
    cursor: pointer !important;
}
@media (max-width: 575.98px) {
    .camera-select,
    select#cameraSelect {
        width: 100% !important;
        max-width: 100% !important;
    }
}



.login-card .input-group > .form-control,
.login-card .input-group.input-group-lg > .form-control {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 14px !important;
    border-bottom-right-radius: 14px !important;
}





/* v20260519-23 ultra premium global toast */
.premium-toast{
    position:fixed !important;
    top:20px !important;
    left:50% !important;
    transform:translateX(-50%) translateY(-14px);
    z-index:99999 !important;
    display:flex;
    align-items:center;
    gap:12px;
    width:auto;
    min-width:340px;
    max-width:min(92vw,520px);
    padding:14px 18px;
    border-radius:18px;
    backdrop-filter:blur(22px) saturate(180%);
    -webkit-backdrop-filter:blur(22px) saturate(180%);
    animation:premiumToastAnim 4.6s cubic-bezier(.22,1,.36,1) forwards;
    font-size:.95rem;
    font-weight:700;
    line-height:1.45;
    letter-spacing:.01em;
}

.premium-toast i{
    width:32px;
    height:32px;
    min-width:32px;
    border-radius:999px;
    display:flex !important;
    align-items:center;
    justify-content:center;
    font-size:1rem;
}

.premium-toast.success{
    color:#14532d !important;
    background:linear-gradient(180deg, rgba(255,255,255,.88), rgba(240,253,244,.96));
    border:1px solid rgba(34,197,94,.16);
    box-shadow:
        0 24px 60px rgba(22,163,74,.16),
        0 8px 24px rgba(15,23,42,.10),
        inset 0 1px 0 rgba(255,255,255,.95);
}

.premium-toast.success i{
    color:#16a34a;
    background:rgba(34,197,94,.10);
    border:1px solid rgba(34,197,94,.16);
}

.premium-toast.error{
    color:#7f1d1d !important;
    background:linear-gradient(180deg, rgba(255,255,255,.90), rgba(254,242,242,.97));
    border:1px solid rgba(239,68,68,.16);
    box-shadow:
        0 24px 60px rgba(239,68,68,.14),
        0 8px 24px rgba(15,23,42,.10),
        inset 0 1px 0 rgba(255,255,255,.95);
}

.premium-toast.error i{
    color:#dc2626;
    background:rgba(239,68,68,.10);
    border:1px solid rgba(239,68,68,.16);
}

@keyframes premiumToastAnim{
    0%{
        opacity:0;
        transform:translateX(-50%) translateY(-16px) scale(.98);
    }
    10%,84%{
        opacity:1;
        transform:translateX(-50%) translateY(0) scale(1);
    }
    100%{
        opacity:0;
        transform:translateX(-50%) translateY(-10px) scale(.985);
        visibility:hidden;
    }
}

@media(max-width:576px){
    .premium-toast{
        top:12px !important;
        min-width:calc(100vw - 24px);
        max-width:calc(100vw - 24px);
        padding:13px 14px;
        border-radius:16px;
    }
}


/* v20260519-24 toast visibility fix */
body > .premium-toast {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    z-index: 2147483647 !important;
    pointer-events: none;
}


/* v20260519-25 force correct error toast colors */
body > .premium-toast.error,
.premium-toast.error {
    color: #7f1d1d !important;
    background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(254,242,242,.98)) !important;
    border-color: rgba(239, 68, 68, .34) !important;
    box-shadow:
        0 24px 60px rgba(239,68,68,.16),
        0 8px 24px rgba(15,23,42,.10),
        inset 0 1px 0 rgba(255,255,255,.96) !important;
}

body > .premium-toast.error i,
.premium-toast.error i {
    color: #dc2626 !important;
    background: rgba(239,68,68,.12) !important;
    border: 1px solid rgba(239,68,68,.24) !important;
    box-shadow: none !important;
}

body > .premium-toast.error::before,
.premium-toast.error::before {
    background: #ef4444 !important;
    box-shadow: 0 0 0 5px rgba(239,68,68,.11) !important;
}

body > .premium-toast.success,
.premium-toast.success {
    color: #14532d !important;
    background: linear-gradient(180deg, rgba(255,255,255,.90), rgba(240,253,244,.96)) !important;
    border-color: rgba(34,197,94,.28) !important;
}

body > .premium-toast.success i,
.premium-toast.success i {
    color: #16a34a !important;
    background: rgba(34,197,94,.10) !important;
    border: 1px solid rgba(34,197,94,.18) !important;
}




/* v20260519-26 minimal premium pill toast */
.premium-toast{
    position:fixed !important;
    top:18px !important;
    left:50% !important;
    transform:translateX(-50%) translateY(-10px);
    z-index:999999 !important;
    display:flex !important;
    align-items:center;
    gap:10px;
    min-width:320px;
    max-width:min(92vw,460px);
    padding:12px 16px 12px 14px !important;
    border-radius:999px !important;
    background:rgba(255,255,255,.96) !important;
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
    border:1px solid rgba(15,23,42,.06) !important;
    box-shadow:
        0 10px 30px rgba(15,23,42,.10),
        0 2px 10px rgba(15,23,42,.06) !important;
    animation:pillToastAnim 4s cubic-bezier(.22,1,.36,1) forwards;
    font-size:.93rem;
    font-weight:600;
    letter-spacing:.01em;
    line-height:1.4;
}

.premium-toast::before{
    content:"";
    width:4px;
    align-self:stretch;
    border-radius:999px;
    background:#22c55e;
    flex:0 0 4px;
}

.premium-toast.success::before{
    background:#22c55e;
}

.premium-toast.error::before{
    background:#ef4444;
}

.premium-toast i{
    width:auto !important;
    height:auto !important;
    min-width:auto !important;
    border:none !important;
    background:transparent !important;
    box-shadow:none !important;
    border-radius:0 !important;
    font-size:1rem;
}

.premium-toast.success{
    color:#166534 !important;
}

.premium-toast.success i{
    color:#22c55e !important;
}

.premium-toast.error{
    color:#991b1b !important;
}

.premium-toast.error i{
    color:#ef4444 !important;
}

@keyframes pillToastAnim{
    0%{
        opacity:0;
        transform:translateX(-50%) translateY(-12px) scale(.98);
    }
    10%,84%{
        opacity:1;
        transform:translateX(-50%) translateY(0) scale(1);
    }
    100%{
        opacity:0;
        transform:translateX(-50%) translateY(-8px) scale(.985);
        visibility:hidden;
    }
}

@media(max-width:576px){
    .premium-toast{
        min-width:calc(100vw - 24px);
        max-width:calc(100vw - 24px);
        border-radius:18px !important;
        padding:12px 14px 12px 12px !important;
    }
}



/* v20260519-27 softer toast typography */
.premium-toast{
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

.premium-toast i{
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}



/* v20260519-28 remove icon backgrounds completely */
.premium-toast i,
.premium-toast.success i,
.premium-toast.error i{
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}


/* v20260519-29 final clean toast icons and one-line text */
.premium-toast,
body > .premium-toast {
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    padding: 11px 18px 11px 14px !important;
    gap: 10px !important;
}

.premium-toast span {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.premium-toast i,
.premium-toast.success i,
.premium-toast.error i,
body > .premium-toast i,
body > .premium-toast.success i,
body > .premium-toast.error i {
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    font-size: 1.25rem !important;
    line-height: 1 !important;
}

.premium-toast.success i,
body > .premium-toast.success i {
    color: #16a34a !important;
}

.premium-toast.error i,
body > .premium-toast.error i {
    color: #dc2626 !important;
}

.premium-toast::after,
.premium-toast i::before,
body > .premium-toast i::before {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}

/* keep only the left accent bar */
.premium-toast::before,
body > .premium-toast::before {
    width: 4px !important;
    min-width: 4px !important;
    flex: 0 0 4px !important;
    border-radius: 999px !important;
}

@media(max-width:576px){
    .premium-toast,
    body > .premium-toast{
        max-width: calc(100vw - 24px) !important;
        white-space: nowrap !important;
    }
}


/* v20260519-30 mobile history info column + export */
.lead-mobile-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lead-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lead-info-label {
    display: none;
    color: #64748b;
    font-size: .74rem;
    font-weight: 600;
    line-height: 1.2;
}

.lead-info-value {
    font-weight: 700;
    color: #111827;
}

.lead-info-date {
    color: #475569;
    font-size: .92rem;
}

@media (max-width: 767.98px) {
    #leadsTable thead th:first-child {
        width: 100%;
    }

    #leadsTable td {
        vertical-align: top;
    }

    .lead-info-cell {
        min-width: 0;
    }

    .lead-mobile-info {
        gap: 10px;
    }

    .lead-info-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .lead-info-label {
        display: block;
    }

    .lead-actions-cell {
        width: 74px;
    }

    .lead-actions-cell .btn {
        margin-bottom: 5px;
    }
}


/* v20260519-31 mobile-only history info layout; desktop table restored */
@media (min-width: 768px) {
    .lead-mobile-info {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    #leadsTable thead th:nth-child(1) {
        font-size: 0;
    }

    #leadsTable thead th:nth-child(1)::before {
        content: "Informacje";
        font-size: .875rem;
    }

    #leadsTable thead th:nth-child(2),
    #leadsTable thead th:nth-child(3),
    #leadsTable thead th:nth-child(4) {
        display: none;
    }

    .lead-mobile-info {
        display: flex;
        flex-direction: column;
        gap: 10px;
        text-align: left;
    }

    .lead-info-row {
        display: flex;
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    .lead-info-label {
        display: block;
        color: #64748b;
        font-size: .72rem;
        line-height: 1.15;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .02em;
    }

    .lead-info-value {
        font-weight: 700;
        color: #111827;
    }

    .lead-info-date {
        color: #475569;
        font-size: .92rem;
    }

    .lead-info-content {
        color: #334155;
        font-weight: 400;
        line-height: 1.45;
    }

    .lead-actions-cell {
        width: 78px;
        vertical-align: top;
    }

    .lead-actions-cell .btn {
        margin-bottom: 5px;
    }
}



/* v20260519-32 compact mobile lead cards */
@media (max-width: 767.98px) {
    #leadsTable {
        border-collapse: separate;
        border-spacing: 0 10px;
    }

    #leadsTable thead th:nth-child(1) {
        font-size: 0;
    }

    #leadsTable thead th:nth-child(1)::before {
        content: "Informacje";
        font-size: .875rem;
    }

    #leadsTable thead th:nth-child(2),
    #leadsTable thead th:nth-child(3),
    #leadsTable thead th:nth-child(4),
    #leadsTable thead th:nth-child(5) {
        display: none;
    }

    #leadsTable tbody tr {
        background: transparent;
    }

    #leadsTable tbody td.lead-mobile-card-cell {
        display: table-cell;
        width: 100%;
        padding: 0;
        border: 0;
    }

    .lead-card-mobile {
        position: relative;
        background: #fff;
        border: 1px solid rgba(15, 23, 42, .08);
        border-radius: 12px;
        padding: 13px 92px 13px 14px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
        text-align: left;
    }

    .lead-card-mobile-top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 6px;
    }

    .lead-card-mobile-title {
        min-width: 0;
        color: #111827;
        font-weight: 700;
        line-height: 1.25;
        word-break: break-word;
    }

    .lead-card-mobile-top .lead-badge {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .lead-card-mobile-date {
        color: #64748b;
        font-size: .8rem;
        font-weight: 500;
        margin-bottom: 8px;
    }

    .lead-card-mobile-comment {
        color: #334155;
        font-size: .9rem;
        line-height: 1.42;
        font-weight: 400;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        word-break: break-word;
    }

    .lead-card-mobile-comment.is-expanded {
        display: block;
        -webkit-line-clamp: unset;
        overflow: visible;
    }

    .lead-comment-toggle {
        margin-top: 5px;
        color: var(--brand-blue);
        font-weight: 700;
        font-size: .82rem;
        text-decoration: none;
    }

    .lead-comment-toggle:hover {
        text-decoration: underline;
    }

    .lead-card-mobile-actions {
        position: absolute;
        right: 12px;
        bottom: 12px;
        display: flex;
        gap: 6px;
    }

    .lead-card-mobile-actions .btn {
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }
}


/* v20260519-33 mobile card badge right + shorter history buttons */
@media (max-width: 767.98px) {
    .lead-card-mobile-top {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 10px;
    }

    .lead-card-mobile-title {
        padding-right: 4px;
    }

    .lead-card-mobile-badge,
    .lead-card-mobile-top .lead-badge {
        justify-self: end;
        text-align: center;
        white-space: nowrap;
    }
}


/* v20260519-34 force mobile badge to far right */
@media (max-width: 767.98px) {
    .lead-card-mobile-top {
        position: relative !important;
        display: block !important;
        padding-right: 108px !important;
        min-height: 32px;
    }

    .lead-card-mobile-badge,
    .lead-card-mobile-top .lead-badge,
    .lead-card-mobile-top span[class*="badge"] {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        margin-left: auto !important;
        white-space: nowrap !important;
    }

    .lead-card-mobile-title {
        display: block;
        width: 100%;
    }
}


/* v20260519-35 align mobile badge with edit/delete icons */
@media (max-width: 767.98px) {
    .lead-card-mobile {
        position: relative !important;
        padding-right: 112px !important;
    }

    .lead-card-mobile-top {
        position: static !important;
        display: block !important;
        padding-right: 0 !important;
        min-height: 32px;
    }

    .lead-card-mobile-badge,
    .lead-card-mobile-top .lead-badge,
    .lead-card-mobile-top span[class*="lead-badge"] {
        position: absolute !important;
        top: 13px !important;
        right: 12px !important;
        margin: 0 !important;
        transform: none !important;
        white-space: nowrap !important;
        z-index: 2;
    }

    .lead-card-mobile-title {
        max-width: 100% !important;
        padding-right: 0 !important;
        word-break: break-word;
    }
}

/* PPV Stream: granat, grafit i czerwone akcenty */
:root { --app-gradient: linear-gradient(145deg,#0a1225 0%,#132443 55%,#251b32 100%); --brand-red:#e3374c; --brand-blue:#193d70; }
.btn-premium, .btn-primary { background:linear-gradient(110deg,#dc2846,#b91e43)!important; border-color:#c82646!important; }
.btn-outline-primary { color:#c82646!important; border-color:#c82646!important; }
.btn-outline-primary:hover { color:white!important; background:#c82646!important; }
.language-switch { min-width:138px; margin-left:auto; }
.language-switch select { background-color:#fff; color:#17243b; border:1px solid #d7dce6; font-weight:600; }
.login-language { position:absolute;top:20px;right:24px;z-index:10; }
.nav-logo,.login-logo { object-fit:contain; }
@media(max-width:575px) { .language-switch {min-width:112px;} .login-language {top:12px;right:12px;} }

/* Graphical language selector: Poland / United Kingdom */
.language-switch { display:flex; align-items:center; justify-content:flex-end; gap:9px; min-width:0; margin-left:auto; }
.language-flag { display:inline-flex; align-items:center; justify-content:center; padding:4px; border:2px solid transparent; border-radius:7px; opacity:.65; transition:opacity .15s, border-color .15s, background-color .15s; }
.language-flag img { display:block; width:30px; height:20px; object-fit:cover; border-radius:2px; box-shadow:0 1px 4px rgba(0,0,0,.25); }
.language-flag:hover, .language-flag:focus-visible { opacity:1; background:rgba(204,28,48,.1); outline:none; }
.language-flag.is-active { opacity:1; border-color:#d51f36; background:rgba(213,31,54,.1); }
@media(max-width:575px) { .language-switch { min-width:0; gap:3px; } .language-flag { padding:3px; } }

/* Flag controls: consistent in authenticated header and login screen */
.app-header .language-switch .language-flag,
.login-language .language-switch .language-flag {
  display:inline-flex; align-items:center; justify-content:center;
  flex:0 0 auto; padding:4px; border:2px solid transparent;
  border-radius:7px; text-decoration:none; line-height:1;
  opacity:.7; transition:opacity .15s ease, border-color .15s ease, background-color .15s ease;
}
.app-header .language-switch .language-flag img,
.login-language .language-switch .language-flag img {
  display:block; width:30px; height:20px; max-width:none; object-fit:cover;
  border-radius:2px; box-shadow:0 1px 4px rgba(0,0,0,.25);
}
.app-header .language-switch .language-flag.is-active,
.login-language .language-switch .language-flag.is-active {
  opacity:1; border-color:#d51f36; background-color:rgba(213,31,54,.12);
}
.app-header .language-switch .language-flag:hover,
.login-language .language-switch .language-flag:hover {opacity:1;background-color:rgba(213,31,54,.12);}
