/* ============================================================
   Do'kon paneli — dizayn tizimi
   Shriftlar: Manrope (matn), Space Grotesk (raqamlar/brend)
   ============================================================ */

@font-face {
    font-family: 'Manrope';
    src: url('fonts/manrope.woff2') format('woff2');
    font-weight: 200 800;
    font-display: swap;
}
@font-face {
    font-family: 'Space Grotesk';
    src: url('fonts/space-grotesk.woff2') format('woff2');
    font-weight: 300 700;
    font-display: swap;
}

:root {
    /* Yuzalar */
    --bg: #f5f4ef;
    --surface: #ffffff;
    --surface-2: #faf9f5;
    --line: #e8e6dc;
    --line-soft: #f0eee5;

    /* Matn */
    --ink: #1a1914;
    --ink-2: #52504a;
    --muted: #8c897d;

    /* Brend (interfeys) */
    --accent: #0e8f66;
    --accent-deep: #0a6e4f;
    --accent-soft: #e2f3ec;
    --danger: #cf3d3d;
    --danger-soft: #fbecec;

    /* Ma'lumot ranglari (grafiklar bilan bir xil) */
    --data-blue: #2a78d6;
    --data-blue-soft: #e9f1fb;
    --data-orange: #d05a22;
    --data-orange-soft: #fcefe8;
    --data-green: #14855f;
    --data-green-soft: #e3f5ee;
    --violet: #6d4fc4;
    --violet-soft: #efeafb;

    /* Yon panel */
    --side: #0f1d17;
    --side-2: #14261e;
    --side-ink: #9db3a7;
    --side-line: rgba(255, 255, 255, .08);

    --radius: 16px;
    --shadow: 0 1px 2px rgba(26, 25, 20, .04), 0 10px 28px -14px rgba(26, 25, 20, .12);
    --font: 'Manrope', 'Segoe UI', system-ui, sans-serif;
    --font-num: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; }

::selection { background: #cdeadd; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.025em; margin: 0; }
h2 { font-size: .98rem; font-weight: 750; letter-spacing: -.01em; margin: 0 0 14px; }
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.ico { flex: none; vertical-align: -3px; }

/* ============ Joylashuv ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 236px;
    background:
        radial-gradient(420px 260px at -30% -10%, rgba(23, 178, 126, .16), transparent 65%),
        linear-gradient(175deg, var(--side-2), var(--side) 55%);
    color: var(--side-ink);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
}

.brand {
    display: flex; align-items: center; gap: 11px;
    padding: 22px 20px 18px;
}
.brand-mark {
    width: 36px; height: 36px; flex: none;
    border-radius: 11px;
    background: linear-gradient(140deg, #19b57f, #0a6e4f);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px -2px rgba(14, 143, 102, .5), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-name {
    font-family: var(--font-num);
    font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em;
    color: #fff;
}
.brand-name small { display: block; font-family: var(--font); font-size: .68rem; font-weight: 500; color: var(--side-ink); letter-spacing: .02em; margin-top: -2px; }

/* Menyu ekranga sig'masa (past ekran yoki kattalashtirilgan brauzer) — faqat menyu aylanadi, brend va foydalanuvchi joyida qoladi */
.nav {
    display: flex; flex-direction: column; gap: 2px; padding: 4px 12px; flex: 1;
    min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 3px; }
.nav-label {
    font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: rgba(157, 179, 167, .6);
    padding: 14px 12px 6px;
}
.nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px;
    border-radius: 11px;
    color: var(--side-ink);
    font-weight: 600; font-size: .9rem;
    transition: background .14s, color .14s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #eef4f0; text-decoration: none; }
.nav a.active {
    background: linear-gradient(140deg, #14a273, #0c7c58);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(16, 156, 110, .55), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.nav a .ico { opacity: .85; }
.nav a.active .ico { opacity: 1; }

.sidebar-user {
    margin: 12px 12px 14px;
    padding: 11px 12px;
    border: 1px solid var(--side-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    display: flex; align-items: center; gap: 10px;
}
.avatar {
    width: 34px; height: 34px; flex: none;
    border-radius: 50%;
    background: linear-gradient(140deg, #2c4a3c, #1b3129);
    border: 1px solid rgba(255, 255, 255, .12);
    color: #d7e5dd;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-num); font-weight: 700; font-size: .92rem;
}
.sidebar-user .who { min-width: 0; flex: 1; }
.u-name { color: #f2f6f3; font-weight: 700; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-role { font-size: .7rem; color: var(--side-ink); }
.logout {
    color: var(--side-ink);
    display: flex; padding: 7px; border-radius: 9px;
    transition: background .14s, color .14s;
}
.logout:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }

.main {
    flex: 1 1 auto;
    min-width: 0; /* keng jadval/filtr bo'lsa ham sahifa ekrandan toshmasin (flex elementi o'z mazmunidan torayishi uchun) */
    margin-left: 236px;
    padding: 30px 36px 52px;
    max-width: 1280px;
}

/* ============ Sahifa boshi ============ */
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-head .sub { color: var(--muted); font-size: .86rem; margin-top: 3px; }

/* ============ Kartochkalar ============ */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    margin-bottom: 20px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
@media (max-width: 1080px) and (min-width: 641px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards { grid-template-columns: minmax(0, 1fr); gap: 10px; } }
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    display: flex; align-items: center; gap: 13px;
}
.stat-ico {
    width: 42px; height: 42px; flex: none;
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
}
.stat-ico.blue   { background: var(--data-blue-soft);   color: var(--data-blue); }
.stat-ico.orange { background: var(--data-orange-soft); color: var(--data-orange); }
.stat-ico.green  { background: var(--data-green-soft);  color: var(--data-green); }
.stat-ico.red    { background: var(--danger-soft);      color: var(--danger); }
.stat-label { color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .01em; }
.stat-value {
    font-family: var(--font-num);
    font-size: 1.28rem; font-weight: 700; letter-spacing: -.01em;
    white-space: nowrap; margin-top: 1px;
}
.stat-value .cur { font-family: var(--font); font-size: .72rem; font-weight: 600; color: var(--muted); }
.stat-value.neg { color: var(--danger); }

/* Bugungi tushum qatori */
.pay-strip {
    display: flex; gap: 8px 26px; flex-wrap: wrap; align-items: center;
    padding: 14px 22px;
}
.pay-strip .lead { color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.pay-item { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ink-2); font-weight: 600; }
.pay-item strong { font-family: var(--font-num); font-weight: 700; color: var(--ink); }
.pay-chip {
    width: 28px; height: 28px; border-radius: 9px; flex: none;
    display: flex; align-items: center; justify-content: center;
}
.pay-chip.green  { background: var(--data-green-soft);  color: var(--data-green); }
.pay-chip.blue   { background: var(--data-blue-soft);   color: var(--data-blue); }
.pay-chip.violet { background: var(--violet-soft);      color: var(--violet); }
.pay-chip.orange { background: var(--data-orange-soft); color: var(--data-orange); }

/* ============ Ikki ustun ============ */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.chart-box { height: 300px; position: relative; }
.chart-box-sm { height: 250px; position: relative; }

/* ============ Formalar ============ */
.field { margin-bottom: 12px; }
.field label {
    display: block;
    font-size: .76rem; font-weight: 700; letter-spacing: .01em;
    color: var(--ink-2);
    margin-bottom: 6px;
}
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    font: inherit;
    font-size: .9rem;
    color: var(--ink);
    transition: border-color .14s, box-shadow .14s;
}
input:hover, select:hover { border-color: #d5d2c4; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 143, 102, .16);
}
input::placeholder { color: #b4b1a4; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { margin-bottom: 0; flex: 1 1 150px; }
.form-row .field.wide { flex: 2 1 220px; }
.form-row .actions { flex: none; display: flex; gap: 8px; }

/* ============ Tugmalar ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    font: inherit; font-size: .88rem; font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: filter .14s, background .14s, border-color .14s, box-shadow .14s;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: linear-gradient(180deg, #12a273, var(--accent-deep));
    color: #fff;
    box-shadow: 0 4px 10px -3px rgba(14, 143, 102, .5), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--ink-2);
}
.btn-ghost:hover { background: var(--surface-2); border-color: #d5d2c4; color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: .8rem; border-radius: 9px; }
.btn-block { width: 100%; }

/* Ikonka-tugmalar (jadval amallari) */
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    transition: all .14s;
}
.btn-icon:hover { color: var(--ink); border-color: #d5d2c4; background: var(--surface-2); text-decoration: none; }
.btn-icon.fav-on { color: #c98500; border-color: #f0d9a8; background: #fdf6e6; }
.btn-icon.fav-on svg { fill: currentColor; }
.btn-icon.danger:hover { color: var(--danger); border-color: #ecc7c7; background: var(--danger-soft); }

/* ============ Jadval ============ */
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted);
    padding: 8px 11px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
td { padding: 10px 11px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: .88rem; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--surface-2); }
tfoot td { font-weight: 800; border-top: 2px solid var(--line); border-bottom: none; }
.num {
    text-align: right;
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline-block; margin-left: 4px; }
.muted { color: var(--muted); }
.pos { color: var(--data-green); font-weight: 600; }
.neg { color: var(--danger); font-weight: 600; }

/* ============ Nishonlar ============ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: .74rem; font-weight: 700; letter-spacing: .01em;
    background: #efede5; color: var(--ink-2);
}
.badge.blue   { background: var(--data-blue-soft);  color: #1c5cab; }
.badge.green  { background: var(--data-green-soft); color: var(--data-green); }
.badge.violet { background: var(--violet-soft);     color: var(--violet); }
.badge.orange { background: var(--data-orange-soft); color: var(--data-orange); }
.badge.red    { background: var(--danger-soft);      color: var(--danger); }

/* ============ Xabarlar ============ */
.flash {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-weight: 600; font-size: .88rem;
    border: 1px solid transparent;
}
.flash-success { background: var(--accent-soft); color: var(--accent-deep); border-color: #c8e8da; }
.flash-error   { background: var(--danger-soft); color: var(--danger); border-color: #f0d2d2; }

/* ============ Filtrlar ============ */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; }

.seg {
    display: inline-flex;
    background: #eceae0;
    border-radius: 12px;
    padding: 3px; gap: 2px;
}
.seg a {
    padding: 6px 15px;
    border-radius: 9px;
    color: var(--ink-2); font-weight: 700; font-size: .84rem;
    transition: all .14s;
}
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(26, 25, 20, .14); }

/* ============ Chek (POS) ============ */
.pos-search { position: relative; }
.pos-list {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-height: 290px; overflow: auto;
    margin-top: 4px;
}
.pos-item {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: .88rem;
}
.pos-item:hover, .pos-item.sel { background: var(--surface-2); }
.pos-item .pi-price { font-family: var(--font-num); font-weight: 700; white-space: nowrap; }
.pos-item .pi-qty { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.cart-table input.qty { width: 86px; text-align: right; }
.cart-table input.price { width: 130px; text-align: right; }
.cart-total {
    font-family: var(--font-num);
    font-size: 1.3rem; font-weight: 700;
}
.pos-foot {
    display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap;
    margin-top: 14px; padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}

/* ============ Kassa (alohida sotuv oynasi) ============ */
.pos-body { background: var(--bg); overscroll-behavior: none; } /* planshetda chetdan surib orqaga ketish va pastga tortib yangilashni o'chiradi */
html:has(.pos-body) { overscroll-behavior: none; }
.pos-top {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 22px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.pos-top-title { font-family: var(--font-num); font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.pos-top-title small { display: block; font-family: var(--font); font-size: .74rem; font-weight: 500; color: var(--muted); }
.pos-top-user { margin-left: auto; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.pos-main { max-width: 1320px; margin: 0 auto; padding: 20px 22px 44px; }
.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.pos-grid .card { margin-bottom: 20px; }
.pos-left { min-height: 340px; }
.pos-left .pos-q { font-size: 1.05rem; padding: 13px 16px; }
.pos-right { position: sticky; top: 16px; }
.pos-total { font-family: var(--font-num); font-size: 2.3rem; font-weight: 700; line-height: 1.15; margin: 2px 0 16px; }
.pos-total small { font-family: var(--font); font-size: .9rem; font-weight: 600; color: var(--muted); }
.pay-opts { display: grid; gap: 8px; margin-bottom: 12px; }
.pay-opts label { cursor: pointer; }
.pay-opts input { position: absolute; opacity: 0; pointer-events: none; }
.pay-opts span {
    display: flex; align-items: center; gap: 9px;
    padding: 11px 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-weight: 700; font-size: .92rem; color: var(--ink-2);
    transition: all .14s;
}
.pay-opts input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.pay-opts input:focus-visible + span { box-shadow: 0 0 0 3px rgba(14, 143, 102, .16); }
.btn.pos-pay { padding: 15px 18px; font-size: 1.05rem; }
.cart-table input[readonly] { background: var(--surface-2); color: var(--ink-2); border-color: transparent; }
@media (max-width: 900px) {
    .pos-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .pos-right { position: static; }
    /* Bir ustunda: chek -> to'lov va «Sotish» -> tez tugmalar (aks holda «Sotish» uzun tugmalar ro'yxatining ostida qolib ketadi) */
    .pos-left { display: contents; }
    .pos-tabs { order: 1; }
    .pos-scan { order: 2; }
    #posLast { order: 3; }
    .pos-cart { order: 4; }
    .pos-right { order: 5; }
    #posTilesCard { order: 6; }
    .pos-main { padding: 14px 12px 36px; }
    .pos-top { padding: 10px 12px; }
    .pos-top-user { margin-left: 0; width: 100%; order: 5; }
}

/* ---- Kassa: skanerlash qatori, oxirgi tovar, savat, tez tugmalar ---- */
.pos-scan { display: flex; gap: 10px; align-items: stretch; }
.pos-scan .pos-search { flex: 1; }
.pos-scan .pos-q { font-size: 1.05rem; padding: 13px 16px; height: 100%; }
.card.pos-scan { padding: 12px; margin-bottom: 12px; }
.pos-mode { white-space: nowrap; }
.pos-mode.rec { background: var(--danger); border-color: var(--danger); color: #fff; animation: recPulse 1.2s ease-in-out infinite; }
@keyframes recPulse { 50% { box-shadow: 0 0 0 6px rgba(207, 61, 61, .22); } }

.pos-last {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 14px 20px; margin-bottom: 12px;
    border-radius: var(--radius);
    background: var(--accent-soft); border: 1px solid #c8e8da;
}
.pos-last[hidden] { display: none; }
.pos-last.miss { background: var(--danger-soft); border-color: #f0d2d2; color: var(--danger); }
.pos-last.pos-which { background: var(--data-blue-soft); border-color: #c9dcf3; display: block; }
.pl-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pl-choices .btn { font-weight: 700; }
.pl-name { font-weight: 800; font-size: 1.08rem; }
.pl-sub { font-size: .8rem; color: var(--ink-2); }
.pl-price { margin-left: auto; font-family: var(--font-num); font-weight: 700; font-size: 1.7rem; white-space: nowrap; }

.card.pos-cart { padding: 6px 14px; min-height: 220px; }
.ci {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 6px;
    border-bottom: 1px solid var(--line-soft);
}
.ci:last-child { border-bottom: none; }
.ci-new { animation: ciFlash .9s ease-out; }
@keyframes ciFlash { from { background: #d6f0e4; } to { background: transparent; } }
.ci-main { flex: 1; min-width: 0; text-align: left; }
button.ci-main { background: none; border: none; font: inherit; color: inherit; cursor: pointer; padding: 0; }
.ci-name { font-weight: 700; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; }
.ci-price { font-size: .8rem; color: var(--muted); }
button.ci-price { background: none; border: none; padding: 2px 0; font: inherit; font-size: .8rem; color: var(--muted); cursor: pointer; text-decoration: underline dotted; }
.ci-step { display: flex; align-items: center; gap: 4px; flex: none; }
.ci-btn, .ci-qty, .ci-del {
    height: 44px; min-width: 44px;
    border: 1px solid var(--line); border-radius: 11px;
    background: #fff; color: var(--ink);
    font: inherit; font-size: 1.25rem; font-weight: 700;
    cursor: pointer;
}
.ci-btn:active, .ci-qty:active, .pos-tile:active, .np-key:active { background: var(--accent-soft); }
.ci-qty { min-width: 62px; padding: 0 8px; font-family: var(--font-num); font-size: 1.1rem; }
.ci-sum { flex: none; width: 112px; text-align: right; font-family: var(--font-num); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.ci-del { flex: none; color: var(--muted); border-color: transparent; background: none; }
.ci-del:hover { color: var(--danger); background: var(--danger-soft); }

.pos-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pos-tile {
    display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
    min-height: 72px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface-2); color: var(--ink);
    font: inherit; text-align: left; cursor: pointer;
}
.pt-name { font-weight: 700; font-size: .86rem; line-height: 1.25; }
.pt-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pt-price { font-family: var(--font-num); font-weight: 700; color: var(--accent-deep); }
.pt-sku { font-size: .74rem; color: var(--muted); font-weight: 700; }
.pos-keys { margin-top: 10px; font-size: .7rem; color: var(--muted); line-height: 1.5; }
@media (pointer: coarse) { .pos-keys { display: none; } }

.pos-cash { margin-bottom: 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.pos-cash[hidden] { display: none; }
.pos-cash-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .84rem; }
.pos-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pos-change { margin-top: 8px; font-family: var(--font-num); font-weight: 700; font-size: 1.2rem; color: var(--accent-deep); min-height: 1.4em; }
.pos-change.neg { color: var(--danger); }
/* Xaridorlar oynachalari (brauzer tablari kabi) */
.pos-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pos-tab {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 8px 14px;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface-2); color: var(--ink-2);
    font: inherit; font-size: .88rem; font-weight: 700;
    cursor: pointer; white-space: nowrap;
}
.pos-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 10px -4px rgba(14, 143, 102, .6); }
.pos-tab-new { border-style: dashed; background: none; color: var(--muted); }
.pos-tab-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 7px;
    font-size: 1.1rem; line-height: 1; opacity: .7;
}
.pos-tab-x:hover { opacity: 1; background: rgba(0, 0, 0, .12); }
.pos-flash { font-size: 1rem; }

/* ---- Tovar qabul qilish paneli ---- */
.k-panel {
    margin-top: 12px; padding: 16px 18px;
    border: 2px solid var(--accent); border-radius: var(--radius);
    background: var(--accent-soft);
}
.k-panel[hidden] { display: none; }
.k-title { font-weight: 800; font-size: 1.12rem; margin-bottom: 2px; }
.k-panel input, .k-panel select { font-size: 1.05rem; padding: 12px 14px; }
.ci-tap:hover .ci-name { text-decoration: underline; }
.k-nocost { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: .84rem; color: var(--ink-2); cursor: pointer; }
.k-nocost input { margin-top: 3px; width: 17px; height: 17px; flex: none; }
.k-nocost[hidden] { display: none; }
/* Tovar qabul qilish: telefonda pastga yopishgan "saqlash" paneli */
.k-sticky { display: none; }
@media (max-width: 760px) {
    .k-sticky:not([hidden]) {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
        background: #fff; border-top: 1px solid var(--line, #e4e1d6);
        box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, .25);
        font-weight: 700; font-size: .9rem;
    }
    #kirimForm { padding-bottom: 8px; }
}
/* Boshlash ro'yxati (Asosiy sahifa) */
.onboard { border: 2px solid var(--accent); background: linear-gradient(180deg, var(--accent-soft), #fff 70%); }
.onboard-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.onboard-head h2 { margin: 0; }
.onboard-bar { height: 6px; border-radius: 3px; background: rgba(14, 143, 102, .15); margin: 12px 0 6px; overflow: hidden; }
.onboard-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.onboard-step { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid rgba(14, 143, 102, .14); }
.onboard-step:first-of-type { border-top: 0; }
.onboard-n {
    flex: none; width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .86rem; background: #fff; border: 2px solid var(--accent); color: var(--accent-deep);
}
.onboard-step.done .onboard-n { background: var(--accent); color: #fff; }
.onboard-step.done strong { color: var(--ink-2); font-weight: 650; }
.onboard-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .9rem; }
.onboard-txt span { color: var(--ink-2); font-size: .84rem; }
/* Tasdiq oynasi (o'chirishdan oldin) */
.sure-back {
    position: fixed; inset: 0; z-index: 400;
    background: rgba(15, 29, 23, .55);
    display: flex; align-items: center; justify-content: center; padding: 16px;
    animation: sureIn .12s ease-out;
}
.sure {
    width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 22px 20px 18px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); text-align: center;
}
.sure-ico {
    width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--danger-soft); color: var(--danger); font-weight: 900; font-size: 1.5rem;
}
.sure-msg { font-weight: 700; font-size: 1.05rem; line-height: 1.4; margin-bottom: 18px; overflow-wrap: anywhere; }
.sure-btns { display: flex; gap: 10px; }
.sure-btns .btn { flex: 1; justify-content: center; padding: 13px 10px; font-size: .98rem; }
.sure-yes { background: var(--danger); border-color: var(--danger); color: #fff; }
.sure-yes:hover { background: #b33232; }
@keyframes sureIn { from { opacity: 0; } }
/* Tizim holati ro'yxati (Sozlamalar) */
.st-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 10px 26px; }
.st-row { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; }
.st-row strong { display: block; }
.st-row span { color: var(--ink-2); font-size: .84rem; }
.st-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; margin-top: 5px; background: #c9c6b8; }
.st-dot.ok { background: #12a273; box-shadow: 0 0 0 3px rgba(18, 162, 115, .16); }
.st-dot.warn { background: #e0a31a; box-shadow: 0 0 0 3px rgba(224, 163, 26, .18); }
.st-dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(207, 61, 61, .16); }
/* Ovozli yordamchi uchun namunaviy gaplar */
.k-help { margin-top: 10px; font-size: .84rem; color: var(--ink-2); }
.k-help summary { cursor: pointer; font-weight: 700; color: var(--accent-deep); }
.k-help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 22px; margin-top: 10px; }
.k-help-grid div { display: flex; flex-direction: column; gap: 3px; }
.k-help-grid strong { color: var(--ink); margin-bottom: 2px; }
.price-ideas { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: .82rem; }
.price-ideas[hidden] { display: none; }
.price-chip {
    padding: 7px 12px; border: 1px solid #b9dccd; border-radius: 99px;
    background: #fff; color: var(--accent-deep);
    font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer;
}
.price-chip:hover { background: var(--accent-soft); }
/* Ovozli yordamchining savoli */
.k-ask {
    margin-top: 10px; padding: 14px 16px;
    border: 2px solid var(--data-blue); border-radius: var(--radius);
    background: var(--data-blue-soft);
}
.k-ask[hidden] { display: none; }
.k-ask-msg { font-weight: 700; font-size: 1.02rem; margin-bottom: 10px; }
.k-ask-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Raqam terish oynasi ---- */
.np-back {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(15, 29, 23, .5);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.np { background: #fff; border-radius: 20px; padding: 18px; width: 100%; max-width: 340px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
.np-title { font-weight: 700; font-size: .9rem; color: var(--ink-2); margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-disp {
    font-family: var(--font-num); font-size: 2rem; font-weight: 700; text-align: right;
    padding: 8px 14px; margin-bottom: 12px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
    overflow: hidden;
}
.np-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.np-key {
    height: 62px;
    border: 1px solid var(--line); border-radius: 14px;
    background: #fff; color: var(--ink);
    font-family: var(--font-num); font-size: 1.5rem; font-weight: 700;
    cursor: pointer;
}
.np-row { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; margin-top: 10px; }
.np-row .btn { padding: 14px 8px; }
/* ---- Kamera bilan skanerlash: to'liq ekran, o'rtada ramka ---- */
.cam-ov { position: fixed; inset: 0; z-index: 300; background: #000; overflow: hidden; color: #fff; touch-action: none; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame {
    position: absolute; left: 50%; top: 44%;
    width: min(82vw, 440px); aspect-ratio: 5 / 3; max-height: 46vh;
    transform: translate(-50%, -50%);
    border-radius: 22px;
    box-shadow: 0 0 0 200vmax rgba(8, 14, 11, .62);   /* ramkadan tashqarisi qoraytiriladi */
}
.cam-c { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; transition: border-color .15s; }
.cam-tl { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 22px; }
.cam-tr { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 22px; }
.cam-bl { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 22px; }
.cam-br { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 22px; }
.cam-line {
    position: absolute; left: 8%; right: 8%; top: 12%; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, #2fe0a5 18%, #2fe0a5 82%, transparent);
    box-shadow: 0 0 14px 2px rgba(47, 224, 165, .7);
    animation: camLine 2.1s ease-in-out infinite alternate;
}
@keyframes camLine { to { top: 88%; } }
.cam-frame.ok { animation: camOk .35s ease-out; }
.cam-frame.ok .cam-c { border-color: #2fe0a5; }
.cam-frame.ok .cam-line, .cam-frame.bad .cam-line { visibility: hidden; }
.cam-frame.bad .cam-c { border-color: #ff6b6b; }
@keyframes camOk { 0% { background: rgba(47, 224, 165, .45); } 100% { background: transparent; } }
.cam-top {
    position: absolute; left: 0; right: 0; top: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 26px;
    background: linear-gradient(180deg, rgba(0, 0, 0, .6), transparent);
}
.cam-title { font-weight: 750; font-size: 1.02rem; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.cam-btn {
    min-width: 46px; height: 46px; padding: 0 14px; border-radius: 23px;
    border: 1px solid rgba(255, 255, 255, .35); background: rgba(20, 28, 24, .55); color: #fff;
    font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.cam-top .cam-btn { font-size: 1.6rem; line-height: 1; padding: 0; }
.cam-btn.on { background: #ffd95a; color: #1b1b12; border-color: #ffd95a; }
.cam-btn[hidden], .cam-toast[hidden] { display: none; }
.cam-foot {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 30px 18px calc(26px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(0deg, rgba(0, 0, 0, .66), transparent);
    text-align: center;
}
.cam-hint { font-weight: 650; font-size: 1.02rem; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }
.cam-toast {
    max-width: 100%; padding: 11px 16px; border-radius: 14px;
    background: #12a273; color: #fff; font-weight: 750; font-size: 1.02rem;
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .6);
}
.cam-toast.bad { background: #cf3d3d; }
@media (prefers-reduced-motion: reduce) { .cam-line { animation: none; top: 50%; } }

/* ---- Sensorli ekran: tugma va maydonlar barmoq uchun kattaroq ---- */
@media (pointer: coarse) {
    input[type=text], input[type=password], input[type=number], input[type=date], select { min-height: 46px; font-size: 16px; }
    .btn { min-height: 46px; }
    .btn-sm { min-height: 40px; }
    .btn-icon { width: 44px; height: 44px; }
    .nav a { padding: 12px 14px; }
    .pos-item { padding: 14px; }
}
.sm-only, .sm-only-row { display: none; }
@media (max-width: 640px) {
    .ci { flex-wrap: wrap; }
    .ci-main { flex-basis: 100%; }
    .ci-sum { margin-left: auto; }
    .pl-price { margin-left: 0; font-size: 1.4rem; }
    /* qidiruv — butun qator, «№ Kod / Kamera / Ovoz» — bitta qatorda yonma-yon */
    .pos-scan { flex-wrap: wrap; }
    .pos-scan .pos-search { flex: 1 1 100%; }
    .pos-scan .pos-mode { flex: 1 1 0; justify-content: center; padding-left: 8px; padding-right: 8px; }
    .ci-sum { width: auto; min-width: 72px; }
    /* jadvallarda telefonda kamroq kerakli ustunlar yashiriladi (ma'lumoti nom ostida qisqa ko'rinadi) */
    .col-sm-hide { display: none; }
    .sm-only { display: block; }
    .sm-only-row { display: table-row; } /* jadval jami qatori: yashirin ustunlarsiz to'g'ri joylashadi */
    .td-note { min-width: 200px; } /* izoh tor ustunga siqilib qator juda baland bo'lib ketmasin — jadval yon tomonga suriladi */
}
/* Ombor: telefonda asosiy ish — tovar qabul qilish — ogohlantirishlardan oldin */
.stock-flow { display: flex; flex-direction: column; }
@media (max-width: 860px) { .stock-flow > .k-alert { order: 2; } }

/* ============ Kirish sahifasi ============ */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(560px 380px at 82% -8%, rgba(23, 178, 126, .2), transparent 65%),
        radial-gradient(480px 340px at -8% 108%, rgba(23, 178, 126, .12), transparent 60%),
        linear-gradient(165deg, #14261e, #0f1d17 55%, #0b1611);
    padding: 22px;
    font-family: var(--font);
}
.login-card {
    background: var(--surface);
    border-radius: 22px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55);
    padding: 38px 36px 32px;
    width: 100%; max-width: 392px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand .brand-mark { width: 44px; height: 44px; border-radius: 13px; }
.login-brand .t {
    font-family: var(--font-num); font-weight: 700; font-size: 1.22rem; letter-spacing: -.01em;
}
.login-brand .t small { display: block; font-family: var(--font); font-size: .74rem; font-weight: 500; color: var(--muted); margin-top: -1px; }
.login-card h1 { font-size: 1.14rem; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: .86rem; margin: 0 0 20px; }

/* ============ Bo'sh holat ============ */
.empty {
    text-align: center;
    color: var(--muted);
    padding: 26px 10px;
    font-size: .88rem;
}
.empty .ico { display: block; margin: 0 auto 8px; opacity: .45; }

/* Past ekranlarda (noutbuk, brauzer kattalashtirilgan) menyu ixchamroq — ko'pincha aylantirmasdan sig'adi */
@media (max-height: 820px) and (min-width: 861px) {
    .brand { padding: 14px 20px 10px; }
    .nav-label { padding: 9px 12px 4px; }
    .nav a { padding: 7px 12px; }
    .sidebar-user { margin: 8px 12px 10px; padding: 8px 10px; }
}

/* ============ Telefon ============ */
@media (max-width: 860px) {
    .layout { flex-direction: column; }
    .sidebar { position: static; width: 100%; }
    .brand { padding: 14px 16px 6px; }
    .nav { flex-direction: row; overflow-x: auto; padding: 6px 12px 10px; scrollbar-width: none; }
    .nav::-webkit-scrollbar { display: none; }
    .nav-label { display: none; }
    .nav a { padding: 8px 13px; white-space: nowrap; }
    .sidebar-user { margin: 0; border: none; border-top: 1px solid var(--side-line); border-radius: 0; padding: 9px 16px; background: none; }
    .main { margin-left: 0; padding: 18px 14px 44px; }
    .chart-box { height: 240px; }
    .page-head { margin-bottom: 16px; }
    .card, .stat { padding: 15px 16px; }
}
