/* U-POS Mobil - mağaza işçiləri üçün mobil tətbiq. Dizayn sistemi Quick TMS ilə eynidir (WMS_NEW/TmsApp/tms.css).
   Rənglər token kimi :root - dadır, qaranlıq rejim sistem ayarından gəlir. Əsas rəng U-POS loqosunun mavisidir. */

:root {
    --bg: #eef1f6;
    --surface: #ffffff;
    --surface-2: #f5f7fb;
    --border: #e3e8f0;
    --text: #0f172a;
    --text-2: #475569;
    --muted: #8a94a6;

    --primary: #1769e0;
    --primary-2: #1fa8f0;
    --primary-soft: #e2edfc;
    --on-primary: #ffffff;

    --success: #15a34a;
    --success-soft: #e3f6ea;
    --warning: #d97706;
    --warning-soft: #fdf1dc;
    --danger: #dc2626;
    --danger-soft: #fde6e6;
    --info: #0284c7;
    --info-soft: #e0f2fe;
    --secondary: #64748b;
    --secondary-soft: #eef1f5;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(15, 23, 42, .06);
    --shadow-lg: 0 10px 40px rgba(15, 23, 42, .18);

    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 10px;

    --app-w: 480px;
    --gutter: 16px;
    --appbar-h: 60px;
    --tabbar-h: 64px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1020;
        --surface: #151b2e;
        --surface-2: #1c2338;
        --border: #262f48;
        --text: #e8ecf5;
        --text-2: #b4bdd0;
        --muted: #7c879e;

        --primary: #5aa2ff;
        --primary-2: #38c5f8;
        --primary-soft: #14284a;
        --on-primary: #0b1020;

        --success: #34d399;
        --success-soft: #11312a;
        --warning: #fbbf24;
        --warning-soft: #352a10;
        --danger: #f87171;
        --danger-soft: #3a1b1f;
        --info: #38bdf8;
        --info-soft: #0f2c3d;
        --secondary: #94a3b8;
        --secondary-soft: #222a3f;

        --shadow-sm: none;
        --shadow: 0 0 0 1px var(--border);
        --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);

        color-scheme: dark;
    }
}

/* ---------- Əsas ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

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

svg {
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

/* boxicons.css ikonu 1.15rem - ə sabitləyir; ölçünü konteyner versin */
.bx {
    font-size: inherit;
    line-height: 1;
}

/* Kompüterdə də telefon eni: tətbiq ortada, kənarlar boş */
.app {
    position: relative;
    max-width: var(--app-w);
    min-height: 100dvh;
    margin: 0 auto;
    background: var(--bg);
}

@media (min-width: 520px) {
    body {
        background: #d9dee8;
    }

    .app {
        box-shadow: 0 0 0 1px rgba(15, 23, 42, .06), 0 20px 60px rgba(15, 23, 42, .12);
    }
}

@media (min-width: 520px) and (prefers-color-scheme: dark) {
    body {
        background: #05070e;
    }
}

/* ---------- Üst panel ---------- */
.appbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding-top: var(--safe-top);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.appbar-inner {
    height: var(--appbar-h);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px 0 var(--gutter);
}

.appbar-inner.has-back {
    padding-left: 6px;
}

.appbar-logo {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--surface);
    padding: 4px;
    box-shadow: var(--shadow-sm);
    object-fit: contain;
    flex-shrink: 0;
}

.appbar-title {
    flex: 1;
    min-width: 0;
}

.appbar-title h1 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appbar-title small {
    display: block;
    color: var(--muted);
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Məzmun ---------- */
.content {
    padding: 4px var(--gutter) calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
}

.has-actions .content {
    padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 96px);
}

.stack {
    display: grid;
    gap: 12px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 22px 4px 10px;
}

.section-head h2 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.section-head .count {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

/* ---------- Ton (status rəngi) - chip, ikon qutusu, xəbərdarlıq ---------- */
.tone-primary { --tone: var(--primary); --tone-soft: var(--primary-soft); }
.tone-success { --tone: var(--success); --tone-soft: var(--success-soft); }
.tone-warning { --tone: var(--warning); --tone-soft: var(--warning-soft); }
.tone-danger { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.tone-info { --tone: var(--info); --tone-soft: var(--info-soft); }
.tone-secondary { --tone: var(--secondary); --tone-soft: var(--secondary-soft); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--tone-soft, var(--secondary-soft));
    color: var(--tone, var(--secondary));
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.chip::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.chip.plain::before {
    display: none;
}

.chip .bx {
    font-size: 14px;
}

.icon-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--tone-soft, var(--primary-soft));
    color: var(--tone, var(--primary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.icon-box.sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 18px;
}

/* ---------- Kart ---------- */
.card {
    display: block;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-pad {
    padding: 16px;
}

a.card,
.pressable {
    transition: transform .12s ease, box-shadow .12s ease;
}

a.card:active,
.pressable:active {
    transform: scale(.985);
}

.meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: var(--muted);
    font-size: 13px;
}

.meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.meta .bx {
    font-size: 15px;
}

.note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    background: var(--warning-soft);
    color: var(--text);
    font-size: 13.5px;
    display: flex;
    gap: 8px;
}

.note .bx {
    color: var(--warning);
    font-size: 18px;
    flex-shrink: 0;
}

/* Kiçik göstəricilər (çəki, həcm ...) */
.stats {
    display: grid;
    grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
    gap: 8px;
}

.stat {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    min-width: 0;
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.stat strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.3;
}

.stats[style*="--cols:3"] .stat {
    padding: 10px;
}

.stats[style*="--cols:3"] .stat strong {
    font-size: 15px;
}

.stat small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

/* Plitkənin altındakı qeyd (məs. "2 reysdə koordinat çatışmır") */
.stat .stat-note {
    display: block;
    margin-top: 2px;
    font-size: 11px;
}

.stat .stat-note.text-warning {
    color: var(--warning);
}

/* ---------- Sənəd kartı ---------- */
.doc-card {
    padding: 16px;
}

.doc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.doc-code {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.01em;
    overflow-wrap: anywhere;
}

.doc-card .chevron {
    color: var(--muted);
    font-size: 22px;
    margin-right: -6px;
}

.doc-zone {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
}

.doc-zone .bx {
    color: var(--primary);
    font-size: 17px;
}

/* ---------- Siyahı sətirləri ---------- */
.list {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px 16px;
}

.list-row + .list-row {
    border-top: 1px solid var(--border);
}

.list-row .label {
    flex: 1;
    min-width: 0;
    color: var(--text-2);
}

.list-row .value {
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.list-row a.value {
    color: var(--primary);
}

.list-row > .bx {
    width: 22px;
    font-size: 20px;
    color: var(--muted);
    text-align: center;
    flex-shrink: 0;
}

/* ---------- Düymələr ---------- */
.btn {
    --btn-bg: var(--surface-2);
    --btn-fg: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: transform .12s ease, filter .12s ease, opacity .12s ease;
}

.btn:active {
    transform: scale(.97);
}

.btn:disabled {
    opacity: .55;
    pointer-events: none;
}

.btn .bx {
    font-size: 20px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-lg {
    min-height: 54px;
    font-size: 16px;
    border-radius: 16px;
}

.btn-primary {
    --btn-bg: linear-gradient(135deg, var(--primary), var(--primary-2));
    --btn-fg: var(--on-primary);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 30%, transparent);
}

.btn-success {
    --btn-bg: var(--success);
    --btn-fg: #fff;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--success) 30%, transparent);
}

.btn-tonal {
    --btn-bg: var(--primary-soft);
    --btn-fg: var(--primary);
}

.btn-tonal-success {
    --btn-bg: var(--success-soft);
    --btn-fg: var(--success);
}

.btn-ghost {
    --btn-bg: transparent;
    --btn-fg: var(--text-2);
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.icon-btn:active {
    background: var(--surface-2);
}

.btn-row {
    display: grid;
    gap: 10px;
}

/* Seçim (Google / Yandex) */
.segmented {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.segmented button {
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.segmented button.is-active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--border);
}

/* ---------- Forma ---------- */
.field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.input {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 16px; /* iOS 16px - dən kiçikdə zoom edir */
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.input-icon {
    position: relative;
}

.input-icon > .bx {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: var(--muted);
    pointer-events: none;
}

.input-icon .input {
    padding-left: 46px;
}

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

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--muted);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---------- Xəbərdarlıq ---------- */
.notice {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--tone-soft, var(--warning-soft));
    color: var(--text);
    font-size: 13.5px;
}

.notice > .bx {
    color: var(--tone, var(--warning));
    font-size: 20px;
    flex-shrink: 0;
}

.hint {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
}

/* ---------- Boş vəziyyət ---------- */
.empty {
    padding: 36px 24px;
    text-align: center;
}

.empty .icon-box {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    font-size: 30px;
    margin-bottom: 14px;
}

.empty h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.empty p {
    color: var(--muted);
    font-size: 13.5px;
}

/* ---------- Əsas səhifə: hero ---------- */
.hero {
    position: relative;
    padding: 20px;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .22), transparent 55%),
        linear-gradient(140deg, #0f4fc4 0%, #1769e0 55%, #1fa8f0 100%);
    box-shadow: 0 14px 34px rgba(23, 105, 224, .32);
    overflow: hidden;
}

.hero::after {
    content: "\eebd"; /* bxs-store-alt */
    font-family: "boxicons";
    position: absolute;
    right: -12px;
    top: 34px;
    font-size: 120px;
    opacity: .12;
    pointer-events: none;
}

.hero-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.hero-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 17px;
    flex-shrink: 0;
}

.hero-top small {
    display: block;
    opacity: .78;
    font-size: 13px;
}

.hero h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.02em;
    overflow-wrap: anywhere;
}

.hero-model {
    margin-top: 8px;
    opacity: .85;
    font-size: 13.5px;
}

.hero .stats {
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.hero .stat {
    background: rgba(255, 255, 255, .16);
}

.hero .stat span,
.hero .stat small {
    color: rgba(255, 255, 255, .78);
}

/* ---------- Alt panel: əsas əməliyyat (yola çıxdım / reysi bitir) ---------- */
.actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom));
    z-index: 45;
    max-width: var(--app-w);
    margin: 0 auto;
    padding: 12px var(--gutter);
    background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.actionbar form {
    margin: 0;
}

/* ---------- Alt naviqasiya ---------- */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    max-width: var(--app-w);
    margin: 0 auto;
    padding-bottom: var(--safe-bottom);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--border);
}

.tabbar-inner {
    height: var(--tabbar-h);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}

.tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
}

.tabbar a .tab-icon {
    width: 56px;
    height: 30px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    transition: background .2s ease, color .2s ease;
}

.tabbar a.active {
    color: var(--primary);
}

.tabbar a.active .tab-icon {
    background: var(--primary-soft);
}

/* ---------- Yüklənmə ---------- */
.loading {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--bg) 45%, transparent);
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease, visibility .15s ease;
}

.loading.show {
    opacity: 1;
    visibility: visible;
    transition-delay: .12s; /* tez açılan səhifədə yanıb-sönməsin */
}

.loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 40%;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    animation: pos-bar 1s ease-in-out infinite;
}

.spinner {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner::after {
    content: "";
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid var(--primary-soft);
    border-top-color: var(--primary);
    animation: pos-spin .7s linear infinite;
}

@keyframes pos-spin {
    to { transform: rotate(360deg); }
}

@keyframes pos-bar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(260%); }
}

/* ---------- Bildirişlər ---------- */
.toasts {
    position: fixed;
    top: calc(var(--safe-top) + 10px);
    left: 0;
    right: 0;
    z-index: 3000;
    max-width: var(--app-w);
    margin: 0 auto;
    padding: 0 12px;
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--border);
    pointer-events: auto;
    cursor: pointer;
    animation: pos-toast-in .25s cubic-bezier(.2, .9, .3, 1.2);
}

.toast.hide {
    animation: pos-toast-out .2s ease forwards;
}

.toast > .bx {
    font-size: 24px;
    color: var(--tone, var(--primary));
    flex-shrink: 0;
}

.toast strong {
    display: block;
    font-size: 14.5px;
}

.toast p {
    color: var(--text-2);
    font-size: 13.5px;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

@keyframes pos-toast-in {
    from { opacity: 0; transform: translateY(-16px) scale(.97); }
}

@keyframes pos-toast-out {
    to { opacity: 0; transform: translateY(-12px) scale(.97); }
}

/* ---------- SweetAlert sualı ---------- */
.swal2-popup.pos-swal {
    width: min(92vw, 380px);
    padding: 22px 20px 20px;
    border-radius: 24px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
}

.pos-swal .swal2-title {
    padding: 4px 0 0;
    color: var(--text);
    font-size: 19px;
    font-weight: 700;
}

.pos-swal .swal2-html-container {
    margin: 8px 4px 0;
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.5;
}

.pos-swal .swal2-icon {
    margin: 6px auto 8px;
    transform: scale(.75);
}

/* SweetAlert öz stilini sonra yükləyir - seçicilər onu üstələsin deyə gücləndirilib */
.swal2-popup.pos-swal .swal2-actions {
    width: 100%;
    margin: 20px 0 0;
    display: grid !important; /* SweetAlert inline display:flex yazır */
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.swal2-popup.pos-swal .swal2-actions .btn {
    margin: 0;
    width: 100%;
    min-height: 50px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.swal2-popup.pos-swal .swal2-actions .btn:focus,
.swal2-popup.pos-swal .swal2-actions .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

div:where(.swal2-container).swal2-backdrop-show {
    background: rgba(8, 12, 24, .5);
}

/* ---------- Giriş (lisenziya) səhifəsi ---------- */
.auth {
    min-height: 100dvh;
    padding: calc(var(--safe-top) + 32px) var(--gutter) calc(var(--safe-bottom) + 24px);
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(110% 50% at 50% 0%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 70%),
        var(--bg);
}

.auth-brand {
    text-align: center;
    margin: 8px 0 28px;
}

.auth-brand img {
    width: 76px;
    height: 76px;
    padding: 10px;
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    object-fit: contain;
}

.auth-brand h1 {
    margin-top: 16px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.03em;
}

.auth-brand p {
    color: var(--muted);
    font-size: 14px;
}

.auth .card-pad {
    padding: 22px 18px;
}

.auth h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth .lead {
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 20px;
}

.scanner {
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
}

.scanner video {
    display: block;
    width: 100% !important;
}

.center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.mb-2 { margin-bottom: 12px; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--muted); }

/* Tarix sahəsinin daxili eni kartdan çıxmasın */
input[type="date"].input {
    display: block;
    min-width: 0;
    padding: 0 10px;
    font-size: 15px;
}

/* ---------- Üst panel menyusu ---------- */
.menu {
    position: relative;
}

.menu-pop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 60;
    min-width: 220px;
    padding: 6px;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--border);
    transform-origin: top right;
    animation: pos-menu-in .16s ease;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.menu-item .bx {
    font-size: 21px;
    color: var(--muted);
}

.menu-item:active {
    background: var(--surface-2);
}

.menu-item.is-primary {
    color: var(--primary);
}

.menu-item.is-primary .bx {
    color: var(--primary);
}

.menu-item + .menu-item {
    margin-top: 2px;
}

@keyframes pos-menu-in {
    from { opacity: 0; transform: scale(.92); }
}

/* ---------- Aşağıdan açılan pəncərə (sheet) ---------- */
.sheet {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 24, .5);
    animation: pos-fade-in .2s ease;
}

.sheet-panel {
    position: relative;
    width: 100%;
    max-width: var(--app-w);
    max-height: 92dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px var(--gutter) calc(var(--safe-bottom) + 20px);
    border-radius: 26px 26px 0 0;
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    animation: pos-sheet-in .28s cubic-bezier(.2, .9, .3, 1);
}

.sheet-handle {
    width: 40px;
    height: 5px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: var(--border);
}

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

.sheet-head h3 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.sheet-head small {
    color: var(--muted);
    font-size: 13px;
}

.sheet .input {
    background: var(--surface);
}

.sheet-list:empty {
    display: none;
}

body.sheet-open {
    overflow: hidden;
}

@keyframes pos-sheet-in {
    from { transform: translateY(100%); }
}

@keyframes pos-fade-in {
    from { opacity: 0; }
}

/* Sekmə düyməsindəki say */
.seg-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--secondary-soft);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
}

.segmented button.is-active .seg-count {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Uzun status ("Yüklənmə davam edir") sənəd kodunu bölməsin - yer çatmasa nişan alt sətrə keçir */
.doc-head {
    flex-wrap: wrap;
}

.doc-head > :first-child {
    flex: 1 0 auto;
    max-width: 100%;
}

.doc-code {
    overflow-wrap: normal;
}

.status-history .doc-head {
    margin-bottom: 0;
}

.reason-option {
    cursor: pointer;
}

.reason-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.reason-option:has(input:checked) {
    background: var(--primary-soft);
}

.input.textarea {
    min-height: 90px;
    padding: 12px 14px;
    font-family: inherit;
    line-height: 1.4;
    resize: vertical;
}

/* ---------- Yük doluluğu (çəki / həcm - maşının tutumunun faizi) ---------- */
.meters {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.meter-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    color: var(--text-2);
}

.meter-head strong {
    flex: 1;
    color: var(--text);
    font-size: 14px;
}

.meter-head em {
    font-style: normal;
    font-weight: 800;
    font-size: 13px;
}

.text-danger { color: var(--danger); }

.meter-track {
    height: 8px;
    margin-top: 5px;
    border-radius: 999px;
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1px var(--border);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .4s ease;
}

.meter-fill.tone-success { background: var(--success); }
.meter-fill.tone-warning { background: var(--warning); }
.meter-fill.tone-danger { background: var(--danger); }

