
* {
    box-sizing: border-box;
}

:root {
    --bg: #070b14;
    --bg-soft: #0b1120;
    --panel: rgba(15, 23, 42, .72);
    --panel-solid: #101827;
    --panel-2: rgba(20, 30, 51, .82);
    --line: rgba(148, 163, 184, .14);
    --line-strong: rgba(148, 163, 184, .22);
    --text: #f8fafc;
    --text-soft: #d7dfeb;
    --muted: #8693a8;
    --primary: #6d7cff;
    --primary-2: #8b5cf6;
    --primary-soft: rgba(109, 124, 255, .15);
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, .14);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, .14);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, .14);
    --shadow: 0 24px 80px rgba(0,0,0,.32);
    --radius: 22px;
    --radius-sm: 14px;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(99,102,241,.11), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(139,92,246,.08), transparent 25%),
        linear-gradient(180deg, #070b14 0%, #090e18 52%, #070b14 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.ambient {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: .14;
    pointer-events: none;
    z-index: -1;
}

.ambient-one {
    top: -160px;
    left: -100px;
    background: #5664ff;
}

.ambient-two {
    right: -150px;
    top: 250px;
    background: #7c3aed;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(7, 11, 20, .72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.nav {
    min-height: 76px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -.03em;
    font-size: 18px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
    box-shadow: 0 10px 30px rgba(109,124,255,.28);
    font-size: 16px;
}

.brand-text {
    white-space: nowrap;
}

.navlinks {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.navlinks a {
    position: relative;
    color: var(--muted);
    text-decoration: none;
    padding: 10px 13px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 650;
    transition: .2s ease;
}

.navlinks a:hover {
    color: var(--text);
    background: rgba(255,255,255,.045);
}

.navlinks a.active {
    color: #fff;
    background: rgba(109,124,255,.12);
    box-shadow: inset 0 0 0 1px rgba(109,124,255,.15);
}

.nav-dot {
    width: 6px;
    height: 6px;
    display: inline-block;
    margin-right: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 12px rgba(74,222,128,.8);
}

.user-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.15;
}

.user-meta strong {
    font-size: 13px;
    color: var(--text-soft);
}

.user-meta span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.logout-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--text-soft);
    text-decoration: none;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.06);
    transition: .2s ease;
}

.logout-btn:hover {
    background: rgba(239,68,68,.12);
    color: #fff;
    border-color: rgba(239,68,68,.22);
}

.page {
    padding: 46px 0 62px;
}

h1, h2, h3 {
    color: var(--text);
    letter-spacing: -.035em;
}

h1 {
    font-size: clamp(30px, 4vw, 48px);
    margin: 0 0 26px;
    line-height: 1.05;
}

h2 {
    font-size: 20px;
    margin: 0 0 14px;
}

h3 {
    margin-top: 0;
}

p {
    color: var(--text-soft);
    line-height: 1.65;
}

.muted {
    color: var(--muted);
}

.card {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
        var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}

.card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.auth {
    width: min(470px,100%);
    margin: 8vh auto 0;
    padding: 32px;
}

.auth h1 {
    font-size: 34px;
    margin-bottom: 10px;
}

.grid {
    display: grid;
    gap: 18px;
}

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

.inline {
    display: flex;
    gap: 12px;
    align-items: end;
}

.inline > * {
    flex: 1;
}

label {
    display: block;
    margin: 14px 0 7px;
    color: #c7d0df;
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 13px;
    padding: 13px 14px;
    background: rgba(6,10,18,.66);
    color: var(--text);
    outline: none;
    transition: .18s ease;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

input::placeholder {
    color: #5e6a7c;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(109,124,255,.6);
    box-shadow:
        0 0 0 4px rgba(109,124,255,.10),
        inset 0 1px 0 rgba(255,255,255,.03);
}

button,
.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 0;
    border-radius: 13px;
    padding: 12px 17px;
    background: linear-gradient(135deg, #6574ff, #7c5cff);
    color: white;
    font-weight: 800;
    letter-spacing: -.01em;
    cursor: pointer;
    text-decoration: none;
    box-shadow:
        0 12px 28px rgba(93,92,255,.24),
        inset 0 1px 0 rgba(255,255,255,.18);
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        opacity .16s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 16px 34px rgba(93,92,255,.30),
        inset 0 1px 0 rgba(255,255,255,.18);
}

button:active,
.btn:active {
    transform: translateY(0);
}

button:disabled {
    opacity: .55;
    cursor: default;
    transform: none;
}

button.success,
.btn-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 12px 28px rgba(34,197,94,.18);
}

button.danger,
.btn-danger {
    background: rgba(239,68,68,.12);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,.18);
    box-shadow: none;
}

button.danger:hover {
    background: rgba(239,68,68,.18);
    box-shadow: none;
}

.big-action {
    width: 100%;
    margin-top: 18px;
    min-height: 54px;
    font-size: 15px;
    border-radius: 15px;
}

.flash {
    border: 1px solid rgba(148,163,184,.14);
    border-radius: 15px;
    padding: 13px 15px;
    margin-bottom: 18px;
    background: rgba(148,163,184,.08);
    color: var(--text-soft);
}

.flash.success {
    background: var(--success-soft);
    border-color: rgba(34,197,94,.18);
    color: #86efac;
}

.flash.error {
    background: var(--danger-soft);
    border-color: rgba(239,68,68,.18);
    color: #fca5a5;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th {
    color: #8f9bad;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 800;
    padding: 11px 13px;
    border-bottom: 1px solid var(--line);
}

td {
    color: #d7dfeb;
    padding: 15px 13px;
    border-bottom: 1px solid rgba(148,163,184,.09);
    vertical-align: middle;
}

tbody tr {
    transition: .15s ease;
}

tbody tr:hover {
    background: rgba(255,255,255,.024);
}

code.qr {
    display: block;
    padding: 11px 12px;
    border-radius: 11px;
    border: 1px solid rgba(148,163,184,.13);
    background: rgba(4,8,15,.72);
    color: #b9c5ff;
    word-break: break-all;
    font-size: 12px;
}

.camera-shell {
    position: relative;
    width: 100%;
    max-width: 780px;
    margin: 14px auto 0;
    border-radius: 22px;
    overflow: hidden;
    background: #02050a;
    min-height: 330px;
    border: 1px solid rgba(148,163,184,.15);
    box-shadow:
        0 30px 80px rgba(0,0,0,.45),
        inset 0 0 0 1px rgba(255,255,255,.025);
}

#cameraVideo {
    width: 100%;
    min-height: 330px;
    max-height: 620px;
    object-fit: cover;
    background: #02050a;
    display: block;
}

.scan-frame {
    pointer-events: none;
    position: absolute;
    inset: 16%;
    z-index: 10;
}

.scan-frame::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(109,124,255,.85), transparent);
    box-shadow: 0 0 18px rgba(109,124,255,.55);
}

.corner {
    position: absolute;
    width: 54px;
    height: 54px;
    border-color: #aab4ff;
    border-style: solid;
    filter: drop-shadow(0 0 8px rgba(109,124,255,.45));
}

.c1 {
    left: 0;
    top: 0;
    border-width: 3px 0 0 3px;
    border-radius: 8px 0 0 0;
}

.c2 {
    right: 0;
    top: 0;
    border-width: 3px 3px 0 0;
    border-radius: 0 8px 0 0;
}

.c3 {
    left: 0;
    bottom: 0;
    border-width: 0 0 3px 3px;
    border-radius: 0 0 0 8px;
}

.c4 {
    right: 0;
    bottom: 0;
    border-width: 0 3px 3px 0;
    border-radius: 0 0 8px 0;
}

.last-qr {
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(109,124,255,.07);
    border: 1px solid rgba(109,124,255,.16);
    font-family: "SFMono-Regular", Consolas, monospace;
    color: #c7ceff;
    font-size: clamp(15px, 2.2vw, 22px);
    font-weight: 700;
    word-break: break-all;
}

.found-banner,
.not-found-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 11px;
    font-size: 11px;
    letter-spacing: .04em;
    font-weight: 900;
    margin-bottom: 18px;
}

.found-banner {
    background: var(--success-soft);
    border: 1px solid rgba(34,197,94,.16);
    color: #86efac;
}

.not-found-banner {
    background: var(--warning-soft);
    border: 1px solid rgba(245,158,11,.18);
    color: #fcd34d;
}

.product-info-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 12px;
    margin: 18px 0;
}

.product-info-grid > div {
    background: rgba(255,255,255,.028);
    border: 1px solid rgba(148,163,184,.11);
    padding: 16px;
    border-radius: 15px;
}

.product-info-grid span,
.product-info-grid strong {
    display: block;
}

.product-info-grid span {
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.product-info-grid strong {
    color: var(--text);
    font-size: 16px;
}

.stock-value {
    font-size: 28px !important;
    letter-spacing: -.04em;
}

.scanner-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.scanner-buttons {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.camera-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .03em;
}

.camera-on {
    background: var(--success-soft);
    color: #86efac;
}

.camera-off {
    background: var(--danger-soft);
    color: #fca5a5;
}

.camera-wait,
.camera-paused {
    background: var(--warning-soft);
    color: #fcd34d;
}

.issue-success {
    text-align: center;
    padding: 28px 14px;
}

.issue-check {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #bbf7d0;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,.15), transparent 45%),
        rgba(34,197,94,.12);
    border: 1px solid rgba(34,197,94,.22);
    box-shadow: 0 15px 40px rgba(34,197,94,.12);
    font-size: 38px;
    font-weight: 900;
}

.footer {
    padding: 26px 0 44px;
    color: #667285;
    font-size: 12px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(148,163,184,.08);
    padding-top: 20px;
}

.footer-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.footer-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34,197,94,.75);
}

a {
    color: #aeb7ff;
}

a:hover {
    color: #d3d8ff;
}

@media (max-width: 900px) {
    .nav {
        grid-template-columns: 1fr auto;
        gap: 12px;
        padding: 12px 0;
    }

    .navlinks {
        grid-column: 1 / -1;
        justify-content: flex-start;
        order: 3;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .user-meta {
        display: none;
    }
}

@media (max-width: 720px) {
    .container {
        width: min(100% - 20px, 1180px);
    }

    .page {
        padding: 28px 0 48px;
    }

    h1 {
        font-size: 34px;
    }

    .card {
        padding: 18px;
        border-radius: 18px;
    }

    .grid-2,
    .product-info-grid {
        grid-template-columns: 1fr;
    }

    .inline,
    .scanner-head {
        flex-direction: column;
        align-items: stretch;
    }

    .camera-shell,
    #cameraVideo {
        min-height: 250px;
    }

    .scan-frame {
        inset: 13%;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .brand-text {
        display: none;
    }

    .navlinks a {
        padding: 9px 10px;
        font-size: 13px;
    }

    .auth {
        padding: 22px;
    }

    button,
    .btn {
        width: 100%;
    }

    .scanner-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .scanner-buttons button {
        width: auto;
    }
}


/* ===== iOS / Mobile v5 ===== */

.mobile-bottom-nav {
    display: none;
}

.scanner-title-row {
    margin-bottom: 22px;
}

.eyebrow {
    color: #8996ff;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: .15em;
    margin-bottom: 9px;
}

.scanner-subtitle {
    margin-top: -14px;
    margin-bottom: 0;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.section-heading > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-heading h2 {
    margin: 0;
}

.section-heading.compact {
    margin-bottom: 8px;
}

.step-badge {
    flex: 0 0 auto;
    width: 29px;
    height: 29px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 900;
    color: white;
    background: linear-gradient(135deg, #6574ff, #7c5cff);
    box-shadow: 0 7px 20px rgba(101,116,255,.22);
}

.secondary-step {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.tertiary-step {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.camera-pill {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(148,163,184,.10);
    border: 1px solid rgba(148,163,184,.13);
    color: #9aa6b8;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.camera-pill.ok {
    background: rgba(34,197,94,.12);
    color: #86efac;
    border-color: rgba(34,197,94,.18);
}

.camera-pill.wait {
    background: rgba(245,158,11,.12);
    color: #fcd34d;
    border-color: rgba(245,158,11,.18);
}

.camera-pill.bad {
    background: rgba(239,68,68,.12);
    color: #fca5a5;
    border-color: rgba(239,68,68,.18);
}

.ios-reader {
    min-height: 360px;
    width: 100%;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(148,163,184,.14);
    background: #02050a;
    position: relative;
}

.ios-reader video {
    width: 100% !important;
    height: auto !important;
    min-height: 360px !important;
    object-fit: cover !important;
    border-radius: 18px;
}

.ios-reader #qr-shaded-region {
    border-width: 45px !important;
}

.ios-reader img {
    max-width: 100%;
}

.camera-placeholder {
    min-height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 28px;
    text-align: center;
    color: #8b97aa;
    gap: 8px;
}

.camera-placeholder strong {
    color: #e4e9f2;
    font-size: 17px;
}

.camera-placeholder span {
    max-width: 380px;
    line-height: 1.5;
    font-size: 13px;
}

.camera-placeholder-icon {
    width: 62px;
    height: 62px;
    margin-bottom: 8px;
    display: grid;
    place-items: center;
    border-radius: 19px;
    background: rgba(109,124,255,.11);
    border: 1px solid rgba(109,124,255,.17);
    color: #aeb7ff;
    font-size: 30px;
}

.mobile-action-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 13px;
}

.camera-main-btn {
    min-height: 52px;
}

.camera-stop-btn {
    min-width: 110px;
}

.ios-help {
    margin-top: 13px;
    padding: 12px 13px;
    border-radius: 12px;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(148,163,184,.09);
    color: #8693a8;
    font-size: 12px;
    line-height: 1.5;
}

.ios-help strong,
.ios-help b {
    color: #cbd5e1;
}

.photo-input-button {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 15px;
    margin-top: 12px;
    border-radius: 15px;
    background: rgba(139,92,246,.08);
    border: 1px solid rgba(139,92,246,.15);
    cursor: pointer;
}

.photo-input-button:hover {
    background: rgba(139,92,246,.12);
}

.photo-input-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.photo-input-button > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.photo-input-button strong {
    color: #e8e9ff;
    font-size: 14px;
}

.photo-input-button small {
    color: #818da0;
}

.photo-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #ddd6fe;
    background: rgba(139,92,246,.14);
    font-size: 23px;
}

.mini-status {
    margin-top: 10px;
    font-size: 12px;
    color: #8994a7;
}

.mini-status.success {
    color: #86efac;
}

.mini-status.error {
    color: #fca5a5;
}

.mini-status.working {
    color: #fcd34d;
}

.qr-search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.qr-search-row input {
    min-width: 0;
    font-family: "SFMono-Regular", Consolas, monospace;
}

.qr-check-btn {
    min-width: 130px;
}

.hardware-hint {
    margin-top: 9px;
    color: #667387;
    font-size: 11px;
}

.result-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 8px 11px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 16px;
}

.success-result {
    color: #86efac;
    background: rgba(34,197,94,.11);
    border: 1px solid rgba(34,197,94,.17);
}

.warning-result {
    color: #fcd34d;
    background: rgba(245,158,11,.11);
    border: 1px solid rgba(245,158,11,.17);
}

.result-product-name {
    font-size: clamp(26px, 5vw, 38px);
    margin-bottom: 20px;
}

.mobile-product-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mobile-product-stats > div {
    padding: 15px;
    border-radius: 15px;
    background: rgba(255,255,255,.026);
    border: 1px solid rgba(148,163,184,.10);
}

.mobile-product-stats span,
.mobile-product-stats strong {
    display: block;
}

.mobile-product-stats span {
    color: #78869a;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 6px;
}

.mobile-product-stats strong {
    color: #f8fafc;
    font-size: 16px;
}

.stock-tile strong {
    color: #86efac;
    font-size: 25px;
}

.result-qr-label {
    margin-top: 17px;
    margin-bottom: 6px;
    color: #78869a;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.mobile-issue-button {
    min-height: 58px;
    font-size: 16px;
}

.mobile-form-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 720px) {
    body {
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }

    .topbar {
        position: sticky;
    }

    .nav {
        min-height: 60px;
        grid-template-columns: 1fr auto;
        padding: 8px 0;
    }

    .navlinks {
        display: none;
    }

    .user-menu {
        gap: 7px;
    }

    .brand-text {
        display: inline;
        font-size: 15px;
    }

    .page {
        padding: 24px 0 30px;
    }

    h1 {
        font-size: 32px;
        margin-bottom: 18px;
    }

    .scanner-subtitle {
        margin-top: -10px;
    }

    .card {
        padding: 16px;
        margin-bottom: 14px;
        border-radius: 18px;
    }

    .ios-reader,
    .ios-reader video,
    .camera-placeholder {
        min-height: 310px !important;
    }

    .mobile-action-grid {
        grid-template-columns: 1fr 105px;
    }

    .qr-search-row {
        grid-template-columns: 1fr;
    }

    .qr-check-btn {
        width: 100%;
        min-height: 52px;
    }

    input,
    select,
    textarea {
        min-height: 50px;
        font-size: 16px; /* prevents iOS Safari zoom */
    }

    button,
    .btn {
        min-height: 50px;
        font-size: 15px;
    }

    .mobile-product-stats {
        grid-template-columns: 1fr 1fr;
    }

    .stock-tile {
        grid-column: 1 / -1;
    }

    .mobile-form-two {
        grid-template-columns: 1fr 1fr;
    }

    table {
        min-width: 620px;
    }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 100;
        left: 10px;
        right: 10px;
        bottom: calc(9px + env(safe-area-inset-bottom));
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        padding: 6px;
        border-radius: 19px;
        background: rgba(11,17,32,.88);
        border: 1px solid rgba(148,163,184,.15);
        box-shadow: 0 18px 55px rgba(0,0,0,.55);
        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);
    }

    .mobile-bottom-nav a {
        min-width: 0;
        padding: 7px 4px 6px;
        border-radius: 14px;
        color: #78869a;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        font-size: 10px;
        font-weight: 700;
    }

    .mobile-bottom-nav a.active {
        color: #e7e9ff;
        background: rgba(109,124,255,.11);
    }

    .mobile-nav-icon {
        font-size: 20px;
        line-height: 1;
    }

    .footer {
        display: none;
    }
}

@media (max-width: 390px) {
    .container {
        width: calc(100% - 16px);
    }

    .brand-text {
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-action-grid {
        grid-template-columns: 1fr;
    }

    .camera-stop-btn {
        width: 100%;
    }

    .ios-reader,
    .ios-reader video,
    .camera-placeholder {
        min-height: 270px !important;
    }

    .mobile-product-stats,
    .mobile-form-two {
        grid-template-columns: 1fr;
    }

    .stock-tile {
        grid-column: auto;
    }
}


/* v6 universal scanner */
.ios-reader {
    min-height: 420px;
}

.ios-reader video {
    min-height: 420px !important;
    object-fit: cover !important;
}

@media (max-width: 720px) {
    .ios-reader,
    .ios-reader video,
    .camera-placeholder {
        min-height: 360px !important;
    }
}

@media (max-width: 390px) {
    .ios-reader,
    .ios-reader video,
    .camera-placeholder {
        min-height: 320px !important;
    }
}


/* ===== V7 CACHE-SAFE FINAL OVERRIDES ===== */

html,
body {
    background: #070b14 !important;
    color: #f8fafc !important;
}

body {
    min-height: 100vh;
}

.topbar {
    display: block !important;
}

.card {
    background:
        linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
        rgba(15,23,42,.78) !important;
    color: #f8fafc !important;
}

input,
select,
textarea {
    background: rgba(5,10,18,.86) !important;
    color: #f8fafc !important;
}

input[type="file"] {
    color: #cbd5e1 !important;
}

.photo-input-button input[type="file"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
}

.mobile-bottom-nav {
    color: #f8fafc;
}

@media (min-width: 721px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* Нормальный логотип в шапке */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-mark.brand-logo {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    flex: 0 0 38px;

    border-radius: 11px;
    overflow: hidden;

    background: transparent !important;
    box-shadow: 0 6px 18px rgba(80, 90, 255, .25);
}

.brand-mark.brand-logo img {
    width: 100% !important;
    height: 100% !important;

    object-fit: cover;

    /* немного увеличиваем картинку,
       чтобы скрыть чёрные поля */
    transform: scale(1.12);

    display: block;
}

.brand-text {
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}