/* detalQR App (app.detalqr.uz) — portal. Ranglar DetalKroy bilan bir oila. */
:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --ink: #18202e;
  --ink-2: #3b4456;
  --muted: #687184;
  --line: #d6dae1;
  --line-2: #e8ebf0;
  --accent: #135bd8;
  --accent-2: #0f4bb4;
  --accent-soft: #e4ecfc;
  --ok: #138a5e;
  --ok-soft: #e3f4ec;
  --warn: #b25e09;
  --warn-soft: #fdf1e1;
  --bad: #c2362b;
  --bad-soft: #fbe7e5;
  --r: 8px;
  --r-lg: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; }

/* tugmalar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; white-space: nowrap;
  text-decoration: none; color: var(--ink); font-weight: 500; }
.btn:hover { border-color: #b9c0cc; background: var(--panel-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0, 0, 0, .05); }
.btn.sm { height: 32px; padding: 0 10px; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--bad); }
.btn svg { width: 18px; height: 18px; flex: none; }
input[type=text], input[type=password], input:not([type]), input[type=email], select {
  height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; min-width: 0; }
input:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* tepa panel */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.logo { width: 28px; height: 28px; flex: none; }
.logo.lg { width: 44px; height: 44px; }
.brand-n { font-weight: 600; font-size: 15px; }
.brand-n b { color: var(--accent); }
.crumb { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); overflow: hidden; }
.crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.sp { flex: 1; }
.who { color: var(--ink-2); text-decoration: none; padding: 0 6px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang { height: 32px; width: auto; }

main { padding: 18px; max-width: 1440px; margin: 0 auto; }

/* kirish */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% 0%, #dfe8fb, transparent), var(--bg); }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 14px; padding: 26px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.login-head { display: flex; gap: 12px; align-items: center; }
.login-head p { margin: 2px 0 0; }
.login-card label { display: grid; gap: 5px; font-weight: 500; }
.err { margin: 0; padding: 8px 10px; border-radius: var(--r); background: var(--bad-soft); color: var(--bad); }

/* ro'yxat */
.bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.bar h1 { margin-right: auto; }
.search { width: 240px; }
.drop { display: grid; place-items: center; gap: 6px; padding: 26px 16px; margin-bottom: 18px; text-align: center;
  border: 2px dashed #b8c3d6; border-radius: var(--r-lg); background: var(--panel); color: var(--ink-2); cursor: pointer; }
.drop.on { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 34px; height: 34px; color: var(--accent); }
.drop b { font-size: 15px; }
.prog { width: min(420px, 100%); height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { display: grid; grid-template-rows: 150px auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.card:hover { border-color: var(--accent); }
.card .th { display: grid; place-items: center; background: linear-gradient(180deg, #fafbfd, #eef1f6); }
.card .th img { max-width: 100%; max-height: 150px; object-fit: contain; }
.card .th svg { width: 56px; height: 56px; color: #a7b1c2; }
.card .bd { padding: 10px 12px; display: grid; gap: 3px; }
.card .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .mt { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; padding: 0 6px; border-radius: 4px; background: var(--ok-soft); color: var(--ok); font-size: 11.5px; font-weight: 600; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* model sahifasi */
.mhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.mhead .t { margin-right: auto; min-width: 0; }
.mhead .t h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.act { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; min-height: 74px; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--panel); cursor: pointer; text-align: center; color: var(--ink); }
.act:hover { border-color: var(--accent); background: var(--accent-soft); }
.act.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.act svg { width: 24px; height: 24px; color: var(--accent); }
.act b { font-weight: 600; font-size: 13.5px; }
.act small { color: var(--muted); font-size: 11.5px; line-height: 1.2; }
.work { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.work.split { grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr); }
.view { position: relative; height: calc(100vh - 250px); min-height: 420px; border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; background: #fff; }
.view iframe { width: 100%; height: 100%; border: 0; display: block; }
.pane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; overflow: auto;
  height: calc(100vh - 250px); min-height: 420px; }
.pane-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pane-h h2 { margin-right: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 0 10px; height: 32px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th, table.t td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
table.t th { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--panel-2); position: sticky; top: -14px; }
table.t td.r, table.t th.r { text-align: right; white-space: nowrap; }
table.t tr.sec td { background: var(--panel-2); font-weight: 600; }
table.t tr.tot td { font-weight: 700; font-size: 14px; border-top: 2px solid var(--line); }
.note { padding: 10px 12px; border-radius: var(--r); background: var(--panel-2); color: var(--ink-2); margin: 8px 0; }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.rows { display: grid; gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 20px 0; }

/* sozlama, admin */
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; max-width: 760px; }
.box h2 { margin-bottom: 10px; }
.form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-items: end; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; max-width: min(560px, calc(100% - 32px));
  padding: 10px 16px; border-radius: var(--r); background: #1d2433; color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.toast.bad { background: var(--bad); }

@media (max-width: 1100px) {
  .work.split { grid-template-columns: minmax(0, 1fr); }
  .pane { height: auto; min-height: 0; }
}
@media (max-width: 760px) {
  main { padding: 12px; }
  .acts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .view { height: 62vh; min-height: 320px; }
  .work.split .pane { order: -1; }
  .top { gap: 4px; padding: 0 8px; }
  #btnCad, #btnKroy, .crumb { display: none; }
  .search { width: 100%; }
}
