/* ============================================================
   UNZAVOD.UZ — Umumiy uslub
   ============================================================ */

:root {
    --asosiy-rang: #2563eb;
    --asosiy-rang-tor: #1d4ed8;
    --yashil: #16a34a;
    --sariq: #ca8a04;
    --qizil: #dc2626;
    --kok: #2563eb;
    --fon: #f3f4f6;
    --oq: #ffffff;
    --matn: #1f2937;
    --chegaralar: #e5e7eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--fon);
    color: var(--matn);
    line-height: 1.5;
}

/* ---------------- LOGIN SAHIFA ---------------- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
}
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-box {
    background: var(--oq);
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.login-title { text-align: center; font-size: 28px; color: var(--asosiy-rang); margin-bottom: 4px; }
.login-subtitle { text-align: center; color: #6b7280; margin-bottom: 24px; font-size: 14px; }
.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.login-form input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--chegaralar);
    border-radius: 8px; font-size: 15px;
}
.login-form input:focus { outline: none; border-color: var(--asosiy-rang); }

/* ---------------- TUGMALAR ---------------- */
.btn {
    display: inline-block; padding: 10px 20px; border: none; border-radius: 8px;
    font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
    text-align: center; transition: 0.15s;
}
.btn-primary { background: var(--asosiy-rang); color: #fff; }
.btn-primary:hover { background: var(--asosiy-rang-tor); }
.btn-block { width: 100%; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-secondary:hover { background: #4b5563; }
.btn-danger { background: var(--qizil); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------------- XABARLAR ---------------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* ---------------- PANEL LAYOUT ---------------- */
.panel-header {
    background: var(--oq); border-bottom: 1px solid var(--chegaralar);
    padding: 16px 24px; display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 12px;
}
.panel-header h1 { font-size: 20px; color: var(--asosiy-rang); }
.panel-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.panel-body { padding: 24px; max-width: 1280px; margin: 0 auto; }

.card {
    background: var(--oq); border-radius: 10px; padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px;
}
.card-title { margin-bottom: 16px; font-size: 17px; }

/* ---------------- JADVAL ---------------- */
.jadval-orash { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--oq); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--chegaralar); font-size: 14px; vertical-align: top; }
th { background: #f9fafb; font-weight: 600; white-space: nowrap; }
tr:hover { background: #f9fafb; }
.summa-katak { font-weight: 700; white-space: nowrap; }
.amallar-katak { white-space: nowrap; }
.amallar-katak .btn { margin-right: 4px; }
.qoshimcha-matn { font-size: 12px; color: #6b7280; margin-top: 2px; }
.bosh-royxat { color: #6b7280; font-size: 14px; }

/* ---------------- BADGE (kim kiritdi) ---------------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap;
}
.badge-admin { background: var(--yashil); }
.badge-omborchi { background: var(--kok); }
.badge-secondary { background: #9ca3af; }

/* ---------------- QARZ HOLATI RANGLARI ---------------- */
.qarz-kok { background: #dbeafe; color: #1e40af; }
.qarz-sariq { background: #fef9c3; color: #854d0e; }
.qarz-qizil { background: #fee2e2; color: #991b1b; }
.qarz-belgi {
    display: inline-block; padding: 4px 12px; border-radius: 6px; font-weight: 600; font-size: 13px;
}

/* ---------------- FORM ---------------- */
.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.form-row .form-group { flex: 1; min-width: 200px; }
label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
input, select, textarea {
    width: 100%; padding: 8px 12px; border: 1px solid var(--chegaralar);
    border-radius: 6px; font-size: 14px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--asosiy-rang); }
.majburiy { color: var(--qizil); }
.izoh { display: block; font-size: 12px; color: #6b7280; margin-top: 4px; font-weight: 400; }
.form-amallar { display: flex; gap: 10px; margin-top: 8px; }

/* ---------------- RANG TANLASH ---------------- */
.rang-tanlov {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
}
.rang-doira {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px 6px 8px; border: 2px solid var(--chegaralar);
    border-radius: 30px; cursor: pointer; margin: 0;
    font-size: 13px; font-weight: 600; background: var(--oq);
    transition: 0.15s; position: relative;
}
.rang-doira:hover { border-color: #cbd5e1; }
.rang-doira input[type="radio"] {
    position: absolute; opacity: 0; width: 0; height: 0; margin: 0;
}
.rang-doira.tanlangan {
    border-color: var(--asosiy-rang);
    background: #eff6ff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}
.rang-nuqta {
    display: inline-block; width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15); flex-shrink: 0;
}
.rang-nuqta.kichik {
    width: 12px; height: 12px; vertical-align: middle; margin-right: 5px;
}
.rang-nomi { white-space: nowrap; }

/* ---------------- JAMI KARTA ---------------- */
.jami-karta {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 10px;
    background: #eff6ff; border: 1px solid #bfdbfe;
}
.jami-karta strong { font-size: 22px; color: var(--asosiy-rang); }

/* ---------------- NAVIGATSIYA ---------------- */
.nav-tabs {
    display: flex; gap: 4px; margin-bottom: 20px;
    border-bottom: 2px solid var(--chegaralar); flex-wrap: wrap;
}
.nav-tabs a {
    padding: 10px 18px; text-decoration: none; color: #6b7280; font-weight: 600;
    font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.nav-tabs a.active, .nav-tabs a:hover { color: var(--asosiy-rang); border-color: var(--asosiy-rang); }

/* ---------------- KICHIK EKRAN ---------------- */
@media (max-width: 640px) {
    .panel-body { padding: 14px; }
    .panel-header { padding: 12px 14px; }
    .panel-header h1 { font-size: 16px; }
    .form-row .form-group { min-width: 100%; }
}

/* ---------------- ҚОП КЎРИНИШИ (расм) ---------------- */
.qop-korinish {
    display: flex; align-items: center; gap: 16px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 12px; padding: 12px 16px; margin-bottom: 16px;
}
.qop-korinish img {
    width: 96px; height: 96px; object-fit: contain;
    border-radius: 8px; background: #fff;
    border: 1px solid #e2e8f0; flex-shrink: 0;
}
.qop-matn { flex: 1; min-width: 0; }
.qop-nomi { font-size: 16px; font-weight: 700; color: #1e3a8a; margin-bottom: 4px; }
.qop-izoh { font-size: 12.5px; color: #64748b; line-height: 1.45; }

@media (max-width: 640px) {
    .qop-korinish img { width: 76px; height: 76px; }
    .qop-nomi { font-size: 14px; }
}

/* ---------------- МАҲСУЛОТ КАРТАЛАРИ ---------------- */
.mahsulot-tarmoq {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}
.mahsulot-karta {
    border: 2px solid var(--chegaralar);
    border-radius: 12px;
    padding: 14px;
    background: var(--oq);
    display: flex;
    flex-direction: column;
    gap: 9px;
    transition: 0.15s;
}
.mahsulot-karta:hover { border-color: #cbd5e1; box-shadow: 0 3px 12px rgba(0,0,0,0.07); }
.mahsulot-karta.holat-kam { border-color: #fde68a; background: #fffbeb; }

/* --- ТУГАГАН: ранги ўчади, оқариб қолади --- */
.mahsulot-karta.holat-tugagan {
    border-color: #e2e8f0;
    background: #fafafa;
    opacity: 0.5;
    filter: grayscale(0.85);
}
.mahsulot-karta.holat-tugagan:hover {
    border-color: #e2e8f0;
    box-shadow: none;
}
.mahsulot-karta.holat-tugagan .mk-nomi { color: #94a3b8; }
.mahsulot-karta.holat-tugagan .mk-rasm img { opacity: 0.55; }

/* Админ саҳифасида тугаган маҳсулотнинг тугмалари ишлайверади */
.mahsulot-karta.holat-tugagan .mk-amallar,
.mahsulot-karta.holat-tugagan .mk-zaxira-forma {
    opacity: 1;
    filter: grayscale(0);
}

/* --- КАССАДА ТАНЛАНАДИГАН КАРТА --- */
.mahsulot-karta.tanlanadigan { cursor: pointer; user-select: none; }
.mahsulot-karta.tanlanadigan:hover {
    border-color: var(--asosiy-rang);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37,99,235,0.16);
}
.mahsulot-karta.tanlanadigan:active { transform: none; }
.mahsulot-karta.tanlangan {
    border-color: var(--asosiy-rang);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.18);
}

/* --- КАССАДА ТУГАГАН: босиб бўлмайди --- */
.mahsulot-karta.holat-tugagan.tanlanadigan {
    cursor: not-allowed;
    pointer-events: none;
}
.mahsulot-karta.holat-tugagan.tanlanadigan:hover {
    transform: none;
    box-shadow: none;
    border-color: #e2e8f0;
}

.mk-rasm {
    width: 100%; aspect-ratio: 1 / 1; border-radius: 9px;
    overflow: hidden; background: #f8fafc;
    border: 1px solid var(--chegaralar);
    display: flex; align-items: center; justify-content: center;
}
.mk-rasm img { width: 100%; height: 100%; object-fit: contain; }
.mk-rasm-yoq {
    width: 100%; height: 100%; display: flex; align-items: center;
    justify-content: center; font-size: 30px; font-weight: 800;
    color: rgba(255,255,255,0.9); text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.mk-nomi { font-size: 14px; font-weight: 700; line-height: 1.35; }
.mk-zaxira {
    font-size: 13px; font-weight: 700; padding: 5px 10px;
    border-radius: 6px; text-align: center;
}
.zx-yetarli { background: #dcfce7; color: #166534; }
.zx-kam     { background: #fef9c3; color: #854d0e; }
.zx-tugagan { background: #e2e8f0; color: #64748b; letter-spacing: 0.5px; }

.mk-belgi {
    font-size: 11.5px; font-weight: 700; color: #64748b;
    background: #f1f5f9; border-radius: 5px; padding: 3px 8px; text-align: center;
}

.mk-zaxira-forma { display: flex; gap: 6px; }
.mk-zaxira-forma input { padding: 6px 9px; font-size: 13px; }
.mk-zaxira-forma button { padding: 6px 11px; flex-shrink: 0; }

.mk-amallar { display: flex; gap: 6px; margin-top: auto; }
.mk-amallar .btn { flex: 1; padding: 6px 8px; font-size: 12.5px; }
.mk-amallar form { flex: 1; display: flex; }
.mk-amallar form .btn { width: 100%; }

@media (max-width: 640px) {
    .mahsulot-tarmoq { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .mk-nomi { font-size: 13px; }
}

/* ---------------- АУДИТ ЖУРНАЛИ ---------------- */
.audit-belgi {
    display: inline-block; padding: 4px 11px; border-radius: 6px;
    font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.ab-ok   { background: #dcfce7; color: #166534; }
.ab-ogoh { background: #fef9c3; color: #854d0e; }
.ab-xato { background: #fee2e2; color: #991b1b; }
.ab-kul  { background: #f1f5f9; color: #475569; }

.audit-farq {
    margin-top: 5px; font-size: 12px; line-height: 1.5;
    word-break: break-word;
}
.af-eski   { background: #fee2e2; color: #991b1b; padding: 2px 7px; border-radius: 4px; }
.af-yangi  { background: #dcfce7; color: #166534; padding: 2px 7px; border-radius: 4px; }
.af-strelka { color: #94a3b8; margin: 0 5px; font-weight: 700; }

.sahifalar {
    display: flex; align-items: center; justify-content: center;
    gap: 14px; margin-top: 18px; padding-top: 16px;
    border-top: 1px solid var(--chegaralar);
}

/* ---------------- ТАСДИҚЛАШ КОДИ ---------------- */
.kod-maydon {
    font-size: 26px !important;
    letter-spacing: 9px;
    text-align: center;
    font-weight: 700;
    font-family: 'Consolas', 'Courier New', monospace;
    padding: 13px 12px !important;
}
.kod-maydon::placeholder { letter-spacing: 7px; color: #cbd5e1; }

/* ---------------- ЗАХИРА КОДЛАР ---------------- */
.zaxira-tarmoq {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px; margin: 14px 0;
}
.zaxira-kod {
    background: #f8fafc; border: 1px dashed #94a3b8; border-radius: 8px;
    padding: 11px 8px; text-align: center; font-size: 17px; font-weight: 700;
    font-family: 'Consolas', 'Courier New', monospace; letter-spacing: 2px;
    color: #1e293b;
}

/* ---------------- ИШОНЧЛИ КОМПЬЮТЕРЛАР ---------------- */
.qurilma-qator {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 13px 0; border-bottom: 1px solid var(--chegaralar);
}
.qurilma-qator:last-child { border-bottom: none; }
.qurilma-ikon { font-size: 26px; flex-shrink: 0; }
.qurilma-malumot { flex: 1; min-width: 190px; }
.qurilma-nomi { font-weight: 700; font-size: 14.5px; }
.qurilma-joriy {
    display: inline-block; margin-left: 8px; padding: 2px 9px;
    background: #dcfce7; color: #166534; border-radius: 20px;
    font-size: 11.5px; font-weight: 700;
}

/* ---------------- ХОДИМЛАР ---------------- */
.xodim-qator {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 0; border-bottom: 1px solid var(--chegaralar);
}
.xodim-qator:last-child { border-bottom: none; }
.xodim-qator.ochirilgan { opacity: 0.5; }

.xodim-ikon { font-size: 28px; flex-shrink: 0; width: 38px; text-align: center; }
.xodim-malumot { flex: 1; min-width: 220px; }
.xodim-ism {
    font-weight: 700; font-size: 15px; margin-bottom: 3px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.xodim-belgi-ochiq {
    display: inline-block; padding: 2px 10px; border-radius: 20px;
    background: #fee2e2; color: #991b1b; font-size: 11.5px; font-weight: 700;
}
.xodim-prefiks {
    display: inline-block; padding: 2px 10px; border-radius: 6px;
    background: #1e293b; color: #fff; font-size: 12px; font-weight: 700;
    font-family: 'Consolas', 'Courier New', monospace; letter-spacing: 1px;
}
.xodim-amallar { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }

/* ---------------- КИРИШ МАЪЛУМОТЛАРИ ҚУТИСИ ---------------- */
.hisob-quti {
    background: #fff; border: 1px solid #bbf7d0; border-radius: 10px;
    padding: 6px 18px; margin-bottom: 16px;
}
.hisob-qator {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 11px 0; border-bottom: 1px solid #f1f5f9;
}
.hisob-qator:last-child { border-bottom: none; }
.hq-nom {
    font-size: 13px; font-weight: 700; color: #64748b;
    min-width: 82px; text-transform: uppercase; letter-spacing: 0.4px;
}
.hq-qiymat { font-size: 15px; font-weight: 600; word-break: break-all; }
.hq-kod {
    font-family: 'Consolas', 'Courier New', monospace;
    background: #f1f5f9; padding: 5px 12px; border-radius: 6px;
    font-size: 16px; font-weight: 700; letter-spacing: 0.6px; color: #0f172a;
}

@media print {
    .panel-header, .nav-tabs, .form-amallar, .uz-holat { display: none !important; }
}

/* ============================================================
   КАССА
   ============================================================ */
.kassa-tuzilma {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 20px;
    align-items: start;
}
.kassa-chap { min-width: 0; }
.kassa-ong  { min-width: 0; position: sticky; top: 16px; }

.kassa-guruh-nomi {
    font-size: 13px; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.6px;
    margin: 18px 0 10px; padding-bottom: 6px;
    border-bottom: 1px solid var(--chegaralar);
}
.kassa-guruh-nomi:first-of-type { margin-top: 0; }

.kassa-tarmoq { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.kassa-tarmoq .mahsulot-karta { padding: 11px; gap: 7px; }

.mk-narx {
    font-size: 15px; font-weight: 800; color: var(--asosiy-rang);
    text-align: center; padding: 3px 0;
}
.mk-birlik { font-size: 12px; font-weight: 600; color: #94a3b8; }
.mk-narx-yoq { color: #dc2626; font-size: 12px; font-weight: 700; }
.mahsulot-karta.narxsiz { opacity: 0.55; }

/* ---------------- САВАТ ---------------- */
.savat-karta { padding: 18px; }
.chek-belgi {
    float: right; font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px; font-weight: 700; background: #1e293b; color: #fff;
    padding: 3px 11px; border-radius: 6px; letter-spacing: 0.6px;
}

.savat-bosh {
    text-align: center; padding: 34px 14px; color: #94a3b8;
    font-size: 14px; font-weight: 600;
}
.savat-bosh-ikon { font-size: 42px; margin-bottom: 10px; opacity: 0.55; }

.savat-qator {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 0; border-bottom: 1px solid var(--chegaralar);
}
.savat-qator:first-child { border-top: 1px solid var(--chegaralar); }
.savat-qator.savat-xato { background: #fef2f2; }

.sq-rasm {
    width: 46px; height: 46px; border-radius: 7px; overflow: hidden;
    flex-shrink: 0; border: 1px solid var(--chegaralar); background: #fff;
}
.sq-rasm img { width: 100%; height: 100%; object-fit: contain; }
.sq-rangli { width: 100%; height: 100%; }

.sq-malumot { flex: 1; min-width: 0; }
.sq-nomi { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.sq-narx { font-size: 11.5px; color: #64748b; margin-top: 1px; }
.sq-kg   { font-size: 11.5px; color: #16a34a; font-weight: 600; margin-top: 1px; }
.sq-ogoh { font-size: 11.5px; color: #dc2626; font-weight: 700; margin-top: 2px; }

.sq-miqdor { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.sq-tugma {
    width: 28px; height: 30px; border: 1px solid var(--chegaralar);
    background: #f8fafc; border-radius: 6px; cursor: pointer;
    font-size: 17px; font-weight: 700; line-height: 1; color: #334155;
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.sq-tugma:hover { background: #e2e8f0; }
.sq-input {
    width: 62px; padding: 6px 5px !important; text-align: center;
    font-weight: 700; font-size: 14px;
}
.sq-summa {
    min-width: 76px; text-align: right; font-weight: 800;
    font-size: 14px; flex-shrink: 0;
}
.sq-ochir {
    width: 26px; height: 26px; border: none; background: transparent;
    color: #cbd5e1; font-size: 22px; cursor: pointer; line-height: 1;
    flex-shrink: 0; padding: 0; border-radius: 5px;
}
.sq-ochir:hover { color: #dc2626; background: #fee2e2; }

.savat-jami {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 0 4px; margin-top: 6px; border-top: 2px solid #1e293b;
    font-size: 14px; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.6px;
}
.savat-jami strong { font-size: 25px; color: #0f172a; letter-spacing: 0; }

/* ---------------- ТЎЛОВ ТУРИ ---------------- */
.tolov-tanlov { display: flex; gap: 7px; flex-wrap: wrap; }
.tolov-tugma {
    flex: 1; min-width: 92px; margin: 0; cursor: pointer;
    border: 2px solid var(--chegaralar); border-radius: 9px;
    padding: 10px 6px; text-align: center; font-size: 13px;
    font-weight: 700; transition: 0.15s; background: #fff;
}
.tolov-tugma input { position: absolute; opacity: 0; width: 0; height: 0; }
.tolov-tugma:hover { border-color: #cbd5e1; }
.tolov-tugma.tanlangan {
    border-color: var(--asosiy-rang); background: #eff6ff; color: var(--asosiy-rang);
}

/* ---------------- ҚАРЗ ---------------- */
.qarz-checkbox {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    padding: 11px 14px; border: 2px dashed var(--chegaralar);
    border-radius: 9px; font-weight: 700; font-size: 14px; margin: 0;
}
.qarz-checkbox input { width: auto; margin: 0; }
.qarz-checkbox:hover { border-color: #fbbf24; background: #fffbeb; }

.qarz-natija {
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 9px; padding: 12px 14px; margin-bottom: 14px;
}
.qn-qator {
    display: flex; justify-content: space-between;
    font-size: 13.5px; padding: 3px 0;
}
.qn-qarz {
    border-top: 1px solid #fde68a; margin-top: 5px; padding-top: 7px;
    font-size: 16px; font-weight: 800; color: #9a3412;
}
.qn-muddat {
    margin-top: 8px; padding-top: 7px; border-top: 1px dashed #fde68a;
    font-size: 12.5px; color: #854d0e;
}

.savat-amallar { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.savat-sotish { padding: 16px !important; font-size: 17px !important; }
.savat-sotish:disabled {
    background: #cbd5e1 !important; cursor: not-allowed; box-shadow: none;
}

.chek-kod {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 700; font-size: 13px; white-space: nowrap;
}

@media (max-width: 1000px) {
    .kassa-tuzilma { grid-template-columns: 1fr; }
    .kassa-ong { position: static; }
}

/* Маҳсулот картасини босганда таҳрирлаш */
.mahsulot-karta.bosiladigan { cursor: pointer; }
.mahsulot-karta.bosiladigan:hover {
    border-color: var(--asosiy-rang);
    box-shadow: 0 4px 14px rgba(37,99,235,0.14);
}

/* ---------------- МАҲСУЛОТ ТАНЛАШ РЎЙХАТИ ---------------- */
.tanlov-quti {
    background: #eff6ff; border: 2px solid #bfdbfe;
    border-radius: 10px; padding: 14px 16px; margin-bottom: 18px;
}
.tanlov-quti label { color: #1e40af; font-size: 14px; }
.tanlov-quti select {
    font-size: 15px; font-weight: 600; padding: 11px 12px;
    border-color: #93c5fd; background: #fff;
}
.tanlov-quti .izoh { color: #3b82f6; }

/* ---------------- МАҲСУЛОТ РАСМИ (форма) ---------------- */
.rasm-quti {
    display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
}
.rasm-quti img {
    width: 92px; height: 92px; object-fit: contain;
    border: 1px solid var(--chegaralar); border-radius: 9px;
    background: #fff; flex-shrink: 0;
}
.rasm-yoq {
    width: 92px; height: 92px; border: 1px dashed #cbd5e1;
    border-radius: 9px; background: #f8fafc; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #94a3b8; font-weight: 600; text-align: center;
}
.rasm-amal { flex: 1; min-width: 240px; padding-top: 4px; }
.rasm-amal input[type="file"] { margin-bottom: 4px; }

/* ============================================================
   ЯНГИ КЎРИНИШ — Кассадан ташқари барча бўлимлар
   ------------------------------------------------------------
   Кассага тегмайди: kassa_panel.php нинг <body> сида
   class="kassa-body" турибди, қуйидаги қоидалар эса
   body:not(.kassa-body) га ёзилган.

   Уч нарса:
     1. Орқа фон бошқа рангда — карталар ажралиб турсин
     2. Карталар алоҳида — чегара, соя, кўпроқ оралиқ
     3. Карта ичидаги майдонлар ажралиб турсин
   ============================================================ */

body:not(.kassa-body):not(.login-body) {
    background: #ccd6e4;
}

/* ---------- КАРТАЛАР ---------- */
body:not(.kassa-body) .panel-body > .card {
    background: #ffffff;
    border: 1px solid #aab8cc;
    border-radius: 16px;
    padding: 24px 26px;
    margin-bottom: 34px;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06),
                0 10px 28px rgba(15, 23, 42, 0.14);
}

body:not(.kassa-body) .panel-body > .card > .card-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    padding-bottom: 12px;
    margin-bottom: 18px;
    border-bottom: 2px solid #eef2f7;
}

/* ---------- КАРТА ИЧИДАГИ МАЙДОНЛАР ---------- */
/* Тўлдирилмаган майдон кулранг фонда — қаерга ёзиш кераклиги
   дарҳол кўринади. Босилганда оқаради ва кўк ҳалқа чиқади. */
body:not(.kassa-body) .card input[type="text"],
body:not(.kassa-body) .card input[type="number"],
body:not(.kassa-body) .card input[type="date"],
body:not(.kassa-body) .card input[type="month"],
body:not(.kassa-body) .card input[type="password"],
body:not(.kassa-body) .card select,
body:not(.kassa-body) .card textarea {
    background: #eef2f8;
    border: 2px solid #b6c3d6;
    border-radius: 10px;
    padding: 11px 14px;
    transition: border-color .12s, background .12s, box-shadow .12s;
}

body:not(.kassa-body) .card input:hover:not(:disabled):not([readonly]),
body:not(.kassa-body) .card select:hover:not(:disabled),
body:not(.kassa-body) .card textarea:hover:not([readonly]) {
    border-color: #9fb3d0;
}

body:not(.kassa-body) .card input:focus,
body:not(.kassa-body) .card select:focus,
body:not(.kassa-body) .card textarea:focus {
    background: #ffffff;
    border-color: var(--asosiy-rang);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

body:not(.kassa-body) .card input:disabled,
body:not(.kassa-body) .card input[readonly],
body:not(.kassa-body) .card select:disabled {
    background: #e9edf3;
    color: #7b8794;
    cursor: not-allowed;
}

/* Ёрлиқлар бироз тўқроқ — майдондан ажралиб турсин */
body:not(.kassa-body) .card label {
    color: #334155;
    margin-bottom: 7px;
}

/* ---------- ЖАДВАЛЛАР ---------- */
body:not(.kassa-body) .card table {
    border-radius: 10px;
    overflow: hidden;
}
body:not(.kassa-body) .card th {
    background: #dde5f0;
    color: #1e293b;
    border-bottom: 2px solid #b6c3d6;
}
body:not(.kassa-body) .card tr:hover { background: #f4f7fb; }

/* ---------- КИЧИК ЭКРАН ---------- */
@media (max-width: 640px) {
    body:not(.kassa-body) .panel-body > .card {
        padding: 16px;
        margin-bottom: 18px;
        border-radius: 12px;
    }
}

/* ---------- ТУГМАЛАР — ажралиб турсин ---------- */
body:not(.kassa-body) .card .btn {
    border-radius: 9px;
    font-weight: 600;
    padding: 11px 20px;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.16);
    transition: transform .08s, box-shadow .12s, background .12s;
}
body:not(.kassa-body) .card .btn:hover {
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.22);
}
body:not(.kassa-body) .card .btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}
body:not(.kassa-body) .card .btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

/* ---------- ТАНЛОВ РЎЙХАТИ (select) ---------- */
/* Ўқ белгиси қўйилади — бу майдон босилиши мумкинлиги кўринсин */
body:not(.kassa-body) .card select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='none' stroke='%234b5563' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 38px;
    cursor: pointer;
}
body:not(.kassa-body) .card select:focus {
    background-color: #ffffff;
}

/* Карта ичидаги ёзувли қутилар оқ бўлса, майдонлар кўринсин */
body:not(.kassa-body) .card input:not(:disabled):not([readonly]),
body:not(.kassa-body) .card select:not(:disabled) {
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* ---------- КЕНГЛИК НАЗОРАТИ ---------- */
/* Битта кенг элемент бутун саҳифани ўнгга суриб юборарди.
   Қуйидаги қоидалар ҳеч нарса экрандан чиқиб кетмаслигини
   таъминлайди — жадваллар эса ўз ичида сурилади. */
html, body { max-width: 100%; }

body:not(.kassa-body) .panel-body {
    width: 100%;
    overflow-x: hidden;
}

body:not(.kassa-body) .panel-body > .card {
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Жадвал ўз қутиси ичида сурилсин, саҳифани итармасин */
body:not(.kassa-body) .jadval-orash {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
body:not(.kassa-body) .card table {
    border-radius: 0;      /* overflow:hidden олиб ташланди */
    overflow: visible;
}

/* Форма майдонлари тор экранда сиқилсин */
body:not(.kassa-body) .form-row {
    max-width: 100%;
}
body:not(.kassa-body) .form-row > .form-group {
    min-width: 0;
    flex: 1 1 210px;
}

/* ============================================================
   ХИМОЯ ҚОИДАСИ
   ------------------------------------------------------------
   Агар саҳифада бошқарув сарлавҳаси (.panel-header) бўлса —
   бу login саҳифаси ЭМАС. Шунинг учун login кўриниши
   (кўк фон, марказга сиқиш) мажбуран бекор қилинади.

   Сабаби: <body> га хато билан login-body синфи тушиб қолса,
   бутун саҳифа login саҳифасидек кўринарди — фон кўкариб,
   сарлавҳа кичкина қутига сиқилиб қоларди.
   Бу қоида шундай бўлса ҳам саҳифани тўғри кўрсатади.
   ============================================================ */
body:has(.panel-header) {
    display: block !important;
    align-items: initial !important;
    justify-content: initial !important;
    min-height: auto !important;
    background: #ccd6e4 !important;
}

body.kassa-body:has(.panel-header) {
    background: var(--fon) !important;
}

body:has(.panel-header) .panel-header {
    width: 100%;
    box-sizing: border-box;
}

body:has(.panel-header) .panel-body {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

/* ============================================================
   НАВИГАЦИЯ ПЛИТКАЛАРИ ва САРЛАВҲА — профессионал кўриниш
   ------------------------------------------------------------
   Ҳар бўлим алоҳида тўртбурчак «плитка» бўлиб туради.
   Кассага ТЕГМАЙДИ: асосий ўзгаришлар body:not(.kassa-body) да.
   style.css ўзгарди → sw.js даги KESH_NOMI версияси оширилди.
   ============================================================ */

/* --- Сарлавҳа ичидаги умумий бўлаклар (нейтрал, ҳамма жойда) --- */
.ph-brend { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ph-logo { font-size: 22px; }
.ph-bolim { font-weight: 600; opacity: .85; }
.ph-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: #e0e7ff; color: #3730a3; font-weight: 800; font-size: 14px;
}
.ph-ism { display: flex; flex-direction: column; line-height: 1.25; font-weight: 600; }
.ph-ism small { color: #94a3b8; font-size: 11.5px; font-weight: 600; }

/* --- Тўқ градиент сарлавҳа (Кассадан ташқари) --- */
body:not(.kassa-body) .panel-header {
    background: linear-gradient(120deg, #0f172a 0%, #1e3a8a 70%, #2563eb 130%);
    border-bottom: none;
    padding: 15px 26px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .28);
}
body:not(.kassa-body) .panel-header h1 { color: #fff; font-size: 19px; letter-spacing: .2px; }
body:not(.kassa-body) .ph-bolim { color: #bfdbfe; }
body:not(.kassa-body) .panel-user { color: #e2e8f0; }
body:not(.kassa-body) .ph-ism small { color: #93a8c9; }
body:not(.kassa-body) .ph-avatar {
    background: rgba(255, 255, 255, .16); color: #fff;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
body:not(.kassa-body) .ph-chiqish {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .35);
}
body:not(.kassa-body) .ph-chiqish:hover { background: rgba(255, 255, 255, .22); }

/* --- Менью: ҳар бўлим алоҳида тўртбурчак плитка --- */
body:not(.kassa-body) .nav-tabs {
    border-bottom: none;
    gap: 10px;
    margin-bottom: 26px;
}
body:not(.kassa-body) .nav-tabs a {
    display: flex; align-items: center; gap: 8px;
    background: #fff;
    border: 1px solid #aab8cc;
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 0;
    color: #334155;
    font-weight: 700; font-size: 13.5px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 10px rgba(15, 23, 42, .07);
    transition: transform .12s, box-shadow .12s, border-color .12s, color .12s;
}
body:not(.kassa-body) .nav-tabs a:hover {
    transform: translateY(-2px);
    border-color: var(--asosiy-rang);
    box-shadow: 0 4px 14px rgba(37, 99, 235, .22);
    color: var(--asosiy-rang);
}
body:not(.kassa-body) .nav-tabs a.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #1d4ed8;
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .38);
}
body:not(.kassa-body) .nav-tabs a .nt-belgi { font-size: 16px; line-height: 1; }

@media (max-width: 640px) {
    body:not(.kassa-body) .nav-tabs { gap: 7px; }
    body:not(.kassa-body) .nav-tabs a { padding: 9px 12px; font-size: 12.5px; }
    .ph-ism small { display: none; }
}