:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2430; --muted: #6b7380; --line: #e3e6eb;
  --primary: #1f6feb; --primary-d: #1859c0; --ok: #1a7f37; --ok-bg: #e6f4ea;
  --warn: #9a6700; --warn-bg: #fff4d6; --bad: #c62828; --bad-bg: #fdecea;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 10px; }
a { color: var(--primary); }

/* Kirish */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 340px; display: grid; gap: 12px; }

/* Yuqori panel */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px;
  background: #fff; border-bottom: 1px solid var(--line); padding: 0 16px; min-height: 52px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 15px; white-space: nowrap; }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 16px 12px 14px; cursor: pointer; color: var(--muted);
  font: inherit; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.me { display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }

.view { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }

/* Kartochkalar */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 13px; }

/* Forma */
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b6d0fb; border-color: var(--primary); }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Menlo, monospace; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
.row > .btn, .row > .shrink { flex: 0 0 auto; }
.form { display: grid; gap: 12px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.toolbar > label { flex: 1 1 150px; }
.toolbar > label.wide { flex: 3 1 240px; }

.btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 8px 14px;
  border-radius: 8px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.btn:hover { background: #f0f2f5; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }

/* Jadval */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.mono, .mono { font-family: ui-monospace, Menlo, monospace; }
tr.cancelled td { color: var(--muted); text-decoration: line-through; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.meta { color: var(--muted); font-size: 13px; margin: 8px 2px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge.stock { background: var(--ok-bg); color: var(--ok); }
.badge.sold { background: #eef1f5; color: var(--muted); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

/* Sotish savatchasi */
.cart { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cart li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fafbfc; }
.cart li .grow { flex: 1; }
.scan input { font-size: 18px; padding: 12px; font-family: ui-monospace, Menlo, monospace; }

.error { color: var(--bad); margin: 0; min-height: 1em; }
.note-box { padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); }
.note-box.ok { background: var(--ok-bg); color: var(--ok); }
.note-box.bad { background: var(--bad-bg); color: var(--bad); }
.note-box ul { margin: 6px 0 0; padding-left: 18px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d2430; color: #fff;
  padding: 10px 16px; border-radius: 8px; z-index: 50; max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }

.suggest { border: 1px solid var(--line); border-radius: 8px; background: #fff; max-height: 220px; overflow: auto; }
.suggest div { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.suggest div:last-child { border-bottom: 0; }
.suggest div:hover { background: #f0f5ff; }

@media (max-width: 640px) {
  .me span { display: none; }
  .view { padding: 14px 12px 50px; }
}
@media print {
  .topbar, .toolbar, .btn { display: none !important; }
  body { background: #fff; }
}

/* Seriya qidirish natijasi */
.search-card { margin-bottom: 16px; display: grid; gap: 12px; }
.search-card h2 { margin: 0; }
.result { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.result.stock { border-color: #b7dfc2; }
.result-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.result.stock .result-head { background: var(--ok-bg); }
.big { font-size: 18px; font-weight: 700; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 20px; padding: 14px; }
.field .fl { font-size: 12px; color: var(--muted); }
.field .fv { font-size: 15px; }
tr.pick { cursor: pointer; }
tr.pick:hover td { background: #f0f5ff; }
th.num { text-align: right; }
.row.scan { align-items: stretch; }

/* Acoustic B2B */
:root { --bg:#f5f7f6; --text:#203c34; --muted:#78867f; --line:#e2e9e5; --primary:#24634f; --primary-d:#184c3b; --radius:14px; }
body { font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif; line-height:1.55; -webkit-font-smoothing:antialiased; }
a { text-underline-offset:3px; }
button, a, input, select, textarea { -webkit-tap-highlight-color:transparent; }
button, input, select, textarea { transition:background .16s,border-color .16s,box-shadow .16s; }
:focus-visible { outline:3px solid #92bc8c; outline-offset:3px; }
.icon { width:20px; height:20px; flex-shrink:0; }
.wordmark { display:flex; align-items:center; gap:10px; font-size:25px; letter-spacing:-1.2px; font-weight:750; text-decoration:none; color:inherit; }
.brand-mark { display:grid; place-items:center; width:36px; height:36px; border-radius:11px; background:#c9ecac; color:#143c32; font-size:33px; line-height:1; letter-spacing:-2px; padding-right:2px; }
.b2b-tag { font-size:10px; font-weight:650; letter-spacing:1px; border:1px solid currentColor; opacity:.65; border-radius:4px; padding:2px 5px; margin-left:2px; }
.eyebrow { font-size:10px; font-weight:700; letter-spacing:2px; color:var(--primary); }
.login { padding:0; display:grid; grid-template-columns:1.05fr 1fr; min-height:100dvh; }
.login-story { background:#143c32; color:#fff; min-height:100dvh; padding:46px 9%; display:flex; flex-direction:column; position:relative; overflow:hidden; }
.login-story::after { content:""; position:absolute; width:440px; height:440px; right:-235px; bottom:80px; border:1px solid #ffffff12; border-radius:50%; box-shadow:0 0 0 60px #ffffff04,0 0 0 120px #ffffff03; pointer-events:none; }
.story-content { margin:auto 0; padding:70px 0; position:relative; z-index:1; }
.story-content .eyebrow { color:#c9ecac; }
.story-content h2 { font-size:clamp(32px,3.8vw,56px); line-height:1.17; letter-spacing:-2px; font-weight:600; margin:24px 0; }
.story-content h2 span { color:#c9ecac; }
.story-content p { color:#adbfB5; max-width:340px; font-size:15px; line-height:1.8; }
.story-features { display:grid; gap:16px; margin-top:36px; color:#83a28e; font-size:12px; }
.story-features b { color:#e2ece6; font-weight:500; margin-left:16px; font-size:14px; }
.story-footer { color:#87a395; font-size:9px; letter-spacing:1.7px; }
.login-panel { min-height:100dvh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:64px 30px; position:relative; background:#fcfdfc; }
.login-card { max-width:360px; gap:20px; }
.login-card h1 { font-size:34px; letter-spacing:-1px; margin:0; line-height:1.2; }
.login-description { color:var(--muted); margin:-10px 0 10px; }
.login-card label { gap:8px; color:var(--text); font-weight:550; }
.login-card input { padding:13px 15px; }
.login-card .btn { padding:13px 18px; display:flex; justify-content:space-between; align-items:center; }
.login-help { margin:0; color:var(--muted); font-size:12px; text-align:center; line-height:1.8; }
.login-card .error:empty { display:none; }
.login-footer { position:absolute; bottom:28px; font-size:11px; color:#9aa59f; }
.topbar { position:fixed; inset:0 auto 0 0; width:244px; min-height:100dvh; padding:30px 18px 16px; display:flex; flex-direction:column; align-items:stretch; gap:0; flex-wrap:nowrap; background:#fff; z-index:10; border-bottom:0; border-right:1px solid var(--line); }
.sidebar-brand { padding:0 8px 32px; }
.sidebar-brand .wordmark { font-size:23px; }
.brand { font-size:11px; font-weight:400; color:var(--muted); margin:10px 0 0 47px; overflow:hidden; text-overflow:ellipsis; }
.nav-label { font-size:9px; letter-spacing:1.8px; color:#9aa79f; padding:0 14px 13px; font-weight:600; }
.tabs { display:flex; flex-direction:column; overflow:visible; gap:6px; flex:0 0 auto; }
.tabs button { display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:9px; border:0; text-align:left; color:#697b71; font-size:13px; }
.tabs button:hover { background:#f4f7f4; color:var(--primary); }
.tabs button.active { color:#20543c; background:#eaf3e5; font-weight:650; border:0; }
.tabs button.active::after { content:""; width:5px; height:5px; border-radius:50%; background:#407653; margin-left:auto; }
.sidebar-note { margin-top:auto; padding:40px 10px 20px; font-size:10px; color:#8a988f; display:flex; align-items:center; gap:8px; }
.status-dot { width:6px; height:6px; background:#73a96a; border-radius:50%; flex-shrink:0; }
.me { border-top:1px solid var(--line); padding:18px 2px 0; gap:10px; white-space:normal; }
.avatar { height:34px; width:34px; border-radius:50%; display:grid; place-items:center; font-size:13px; font-weight:650; background:#edf2eb; color:var(--primary); flex-shrink:0; }
.me-info { display:grid; gap:2px; flex:1; min-width:0; }
#meName { color:var(--text); font-size:12px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#meRole { color:var(--muted); font-size:10px; }
#logoutBtn { font-size:22px; padding:2px 6px; color:var(--muted); }
.workspace { margin-left:244px; min-height:100dvh; }
.workspace-bar { height:66px; display:flex; align-items:center; justify-content:space-between; padding:0 38px; border-bottom:1px solid var(--line); background:#ffffffb3; font-size:11px; color:var(--muted); }
.workspace-bar b { color:var(--text); font-weight:500; }
.breadcrumb-divider { margin:0 12px; color:#b8c3bc; }
.workspace-date { font-variant-numeric:tabular-nums; }
.page-heading { max-width:1400px; margin:0 auto; padding:34px 38px 25px; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.page-heading h1 { font-size:29px; font-weight:650; letter-spacing:-.9px; margin:5px 0 4px; }
.page-heading p { margin:0; font-size:13px; color:var(--muted); }
.view { max-width:1400px; padding:0 38px 36px; margin:0 auto; min-height:calc(100dvh - 280px); }
h2 { font-size:16px; letter-spacing:-.3px; font-weight:650; }
h3 { font-weight:650; }
.card { padding:24px; box-shadow:0 3px 8px #193b2b03; }
.grid { gap:22px; }
.grid.two { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
.search-card { background:#eef3eb; border-color:#dce7d5; padding:23px 26px; margin-bottom:24px; gap:18px; }
.search-intro { display:flex; align-items:center; gap:13px; }
.search-icon { height:42px; width:42px; display:grid; place-items:center; background:#dfead8; border-radius:12px; color:#407148; flex-shrink:0; }
.search-intro p { font-size:12px; color:#7c8e76; margin:4px 0 0; }
.row.scan { gap:10px; }
.scan input { font-size:14px; padding:13px 16px; min-width:0; }
.scan .btn { padding:12px 28px; }
#lookupResult:empty { display:none; }
.stats { grid-template-columns:repeat(5,minmax(0,1fr)); gap:14px; margin-bottom:26px; }
.stat { padding:20px 18px; position:relative; overflow:hidden; }
.stat-top { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.stat-top .icon { color:#9bab9f; width:18px; height:18px; }
.stat .l { font-size:11px; color:#748279; }
.stat .n { font-size:32px; letter-spacing:-1px; margin-top:12px; font-weight:650; line-height:1.25; }
.stat-caption { font-size:10px; color:#a2ada5; margin-top:6px; }
.stat-1 { background:#143c32; border-color:#143c32; color:#fff; }
.stat-1 .l,.stat-1 .icon,.stat-1 .stat-caption { color:#b1c7b5; }
.stat-1 .n { color:#d2edba; }
label { gap:7px; font-size:12px; font-weight:500; color:#64786c; }
input,select,textarea { padding:10px 12px; border-radius:8px; min-height:42px; }
input::placeholder,textarea::placeholder { color:#a3ada7; font-size:12px; }
input:focus,select:focus,textarea:focus { outline:0; border-color:#81a38b; box-shadow:0 0 0 3px #27624e12; }
input[type=file] { padding:14px; border-style:dashed; background:#f8faf7; }
input::file-selector-button { border:1px solid var(--line); border-radius:5px; padding:6px 10px; margin-right:12px; background:#fff; color:var(--text); }
.form { gap:17px; }
.btn { padding:10px 16px; border-radius:8px; font-size:12px; font-weight:550; display:inline-flex; justify-content:center; align-items:center; gap:8px; min-height:40px; }
.btn:hover { background:#edf3ed; }
.btn.primary { box-shadow:0 2px 3px #143c3210; }
.btn.primary:hover { background:var(--primary-d); border-color:var(--primary-d); }
.btn.small { min-height:28px; font-size:11px; }
.toolbar { padding:20px; background:#fff; border:1px solid var(--line); border-radius:var(--radius); gap:16px; margin-bottom:20px; }
.table-wrap { border-radius:11px; }
th { background:#f6f8f5; font-size:10px; padding:13px 16px; color:#7d8f82; }
td { padding:14px 16px; font-size:12px; border-color:#edf1ed; }
tr:hover td { background:#fafcf9; }
td:first-child { font-weight:500; }
#byModel { margin-top:20px; }
.badge { padding:4px 10px; font-size:10px; font-weight:550; white-space:nowrap; }
.badge.stock { background:#eaf3e4; color:#53814a; }
.badge.sold { background:#edf0f5; color:#6c7c92; }
.empty { padding:48px 20px; font-size:13px; }
.empty::before { content:""; display:block; width:32px; height:26px; border:2px solid #c8d7c9; border-radius:5px; margin:0 auto 16px; background:linear-gradient(#e8efe5,#e8efe5) center/18px 2px no-repeat; }
.meta { font-size:11px; margin-top:12px; }
.cart li { padding:13px; background:#f7faf5; }
.note-box { padding:14px; font-size:12px; }
.toast { background:#143c32; padding:14px 22px; border-radius:12px; font-size:13px; }
.result-head { padding:16px; }.fields { padding:18px; }.field .fl { font-size:11px; }.field .fv { font-size:13px; }
.app-footer { max-width:1400px; margin:0 auto; padding:18px 38px 24px; display:flex; justify-content:space-between; font-size:10px; color:#9ba89f; }
@media(min-width:1600px) { .page-heading { padding-top:44px; } }
@media(max-width:1200px) { .topbar { width:214px; padding-inline:14px; }.workspace { margin-left:214px; }.workspace-bar,.page-heading,.view,.app-footer { padding-left:26px; padding-right:26px; }.stats { gap:10px; }.stat { padding:16px 12px; }.stat-top .icon { display:none; }.grid.two { grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); } }
@media(max-width:900px) { .topbar { width:184px; padding-inline:10px; }.workspace { margin-left:184px; }.sidebar-brand { padding-inline:6px; }.sidebar-brand .wordmark { font-size:19px; gap:7px; }.sidebar-brand .brand-mark { width:30px; height:30px; font-size:28px; }.brand { margin-left:37px; }.tabs button { padding:11px; gap:10px; }.b2b-tag { font-size:8px; }.stats { grid-template-columns:repeat(3,minmax(0,1fr)); }.login-story { padding:38px 9%; }.story-content h2 { font-size:38px; }.stat-top .icon { display:block; } }
@media(max-width:640px) {
  .login { grid-template-columns:1fr; }.login-story { min-height:auto; padding:26px; }.story-content { padding:32px 0 0; }.story-content h2 { font-size:30px; letter-spacing:-1px; margin:12px 0; }.story-content h2 br { display:none; }.story-content h2 br::after { content:" "; }.story-content p { font-size:12px; margin-bottom:0; }.story-features,.story-footer { display:none; }.login-panel { min-height:unset; padding:35px 26px 65px; }.login-card { max-width:100%; width:100%; gap:16px; }.login-card h1 { font-size:28px; }.login-footer { bottom:18px; font-size:10px; }
  .topbar { position:sticky; inset:auto; top:0; width:100%; min-height:0; padding:14px 16px 0; display:grid; grid-template-columns:1fr auto; border-right:0; border-bottom:1px solid var(--line); }.sidebar-brand { padding:0; }.sidebar-brand .wordmark { font-size:21px; }.brand,.nav-label,.sidebar-note { display:none; }.me { border:0; padding:0; gap:6px; }.me-info { display:none; }.tabs { grid-column:1/-1; flex-direction:row; overflow-x:auto; padding:12px 0 10px; gap:5px; }.tabs button { padding:9px 11px; font-size:11px; gap:7px; flex-shrink:0; }.tabs .icon { width:16px; height:16px; }.tabs button.active::after { display:none; }.workspace { margin-left:0; }.workspace-bar { height:44px; padding-inline:18px; font-size:10px; }.page-heading { padding:24px 18px 20px; gap:10px; }.page-heading h1 { font-size:25px; }.page-heading p { font-size:11px; }.page-heading .eyebrow { font-size:8px; }.page-heading .btn { padding:9px 12px; font-size:10px; flex-shrink:0; }.view { padding:0 16px 24px; }.search-card { padding:18px; gap:16px; }.search-intro h2 { font-size:14px; }.search-intro p { font-size:10px; }.search-icon { width:34px; height:34px; }.scan input { font-size:12px; }.row.scan input { flex:1 1 160px; }.scan .btn { padding:10px 18px; }.stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }.stat { padding:16px; }.stat .n { font-size:28px; }.stat:last-child { grid-column:1/-1; }.card { padding:18px; }.grid.two { grid-template-columns:minmax(0,1fr); }.toolbar { padding:16px; gap:12px; }.toolbar>.btn { flex:1 1 auto; }.row > * { min-width:0; }.big { font-size:15px; }.app-footer { padding:16px 18px; font-size:9px; gap:10px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none!important; scroll-behavior:auto!important; } }
@media print { .topbar,.workspace-bar,.page-heading .btn,.app-footer { display:none!important; }.workspace { margin-left:0; }.view,.page-heading { padding:16px 0; }.stat-1 { background:#fff; color:#203c34; border-color:#e2e9e5; }.stat-1 .n { color:#203c34; } }
input[type=checkbox], input[type=radio] { min-height:0; width:16px; height:16px; accent-color:var(--primary); }

.custom-logo {display:block;max-width:100%;width:180px;height:56px;object-fit:contain;object-position:left center;}
.logo-preview {display:block;max-width:100%;width:240px;height:100px;object-fit:contain;margin:16px 0;background:#f3f5f4;border-radius:8px;padding:12px;}

/* Til tanlash va eksport cheklovi */
.workspace-controls {display:flex;align-items:center;gap:16px;}
.language-switch {display:flex;align-items:center;gap:4px;white-space:nowrap;}
.language-switch button {border:0;background:transparent;color:var(--muted);font:inherit;font-size:11px;padding:5px;cursor:pointer;border-radius:4px;}
.language-switch button.active {background:#eaf3e5;color:var(--primary);font-weight:700;}
.login-panel > .language-switch {position:absolute;top:24px;right:30px;}
.export-warning {background:#fff2cc;color:#8a331b;border:2px solid #e3a32c;border-left:6px solid #c64324;border-radius:8px;padding:16px;line-height:1.65;font-weight:600;}
.export-consent {display:flex;align-items:flex-start;gap:10px;color:var(--text);font-weight:600;}
.export-consent input {flex-shrink:0;margin-top:3px;}
.badge.confirmed {background:#e6f4ea;color:#1a7f37;}
@media(max-width:640px) {.workspace-controls {gap:8px;}.workspace-date {display:none;}.language-switch button {padding:4px;}.export-warning {padding:12px;}}
.file-control {position:absolute;width:1px;height:1px;min-height:0;padding:0;opacity:0;}
.file-picker {display:flex;align-items:center;gap:12px;border:1px dashed var(--line);border-radius:8px;padding:12px;background:#f8faf7;}
.file-name {overflow-wrap:anywhere;min-width:0;font-weight:400;}
.story-content h2 > span[data-i18n] {color:inherit;}
