:root {
  --ink: #16224e;
  --blue: #24408e;
  --blue-bar: #2b3f9e;
  --lav: #dcdcf0;
  --lav-soft: #ececf7;
  --line: #9a9ac4;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #e9ebf0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #222;
}

/* ---------- admin paneli ---------- */
.adminbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 18px;
  background: #1d2a55;
  color: #fff;
}
.adminbar h1 { font-size: 16px; margin: 0 18px 0 0; font-weight: 600; }
.adminbar .spacer { flex: 1; }
.btn {
  border: 1px solid #3b4c86;
  background: #2e4390;
  color: #fff;
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}
.btn:hover { background: #3a52ad; }
.btn.ghost { background: transparent; }
.btn.danger { background: #8c2f39; border-color: #a84852; }
.btn.small { padding: 3px 8px; font-size: 12px; }

.layout {
  display: flex;
  gap: 18px;
  padding: 18px;
  align-items: flex-start;
}
.formcol { width: 330px; flex: none; }
.previewcol { flex: 1; min-width: 0; }

.card {
  background: #fff;
  border: 1px solid #d4d7e0;
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 14px;
}
.card h2 { font-size: 13px; margin: 0 0 10px; color: #1d2a55; text-transform: uppercase; letter-spacing: .04em; }

.frow { margin-bottom: 9px; }
.frow label { display: block; font-size: 11.5px; color: #555; margin-bottom: 3px; }
.frow input, .frow select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #c3c7d4;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
}
.frow input[type="file"] { padding: 4px; font-size: 12px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

.scoregrid { display: grid; grid-template-columns: 1fr 90px; gap: 6px 10px; align-items: center; }
.scoregrid label { font-size: 12.5px; color: #333; }
.scoregrid select { padding: 5px; border: 1px solid #c3c7d4; border-radius: 4px; font-size: 13px; }

.photohint { font-size: 11px; color: #777; margin-top: 4px; }

.records table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.records th, .records td { border: 1px solid #e0e2ea; padding: 5px 7px; text-align: left; }
.records th { background: #f2f3f8; }
.records td.acts { white-space: nowrap; }

.toast {
  position: fixed; right: 16px; bottom: 16px;
  background: #1d2a55; color: #fff;
  padding: 10px 16px; border-radius: 5px; font-size: 13px;
  opacity: 0; transition: opacity .25s; pointer-events: none;
  max-width: 380px;
}
.toast.show { opacity: 1; }
.toast.err { background: #8c2f39; }

/* ---------- A4 varaq ---------- */
.sheetwrap { overflow: auto; }
.sheet {
  width: 210mm;
  height: 296mm;
  background: #fff;
  margin: 0 auto;
  padding: 9mm 11mm 7mm;
  position: relative;
  box-shadow: 0 2px 14px rgba(20, 30, 70, .25);
  color: #1a1a1a;
  font-family: Arial, Helvetica, sans-serif;
  transform-origin: top center;
}

.hdr { display: flex; align-items: flex-start; gap: 6mm; }
.hdr .logo { width: 34mm; flex: none; }
.logo .mark {
  width: 26mm; height: 15mm;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
}
.logo .mark svg { width: 100%; height: 100%; }
.logo .orgname {
  font-size: 8.5pt; font-weight: bold; color: var(--blue);
  line-height: 1.25; margin-top: 1mm; word-break: break-word;
}
.hdr .titles { flex: 1; text-align: center; padding-top: 2mm; }
.titles .t1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17pt; font-weight: bold; color: #101c46; margin: 0;
}
.titles .t2 { font-size: 9.5pt; color: #44508a; margin: 1.2mm 0 0; }
.hdr .photo {
  width: 30mm; height: 38mm; flex: none;
  border: .4mm solid #444; object-fit: cover; background: #eee;
  display: block;
}
.photo.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #999; font-size: 8pt; text-align: center;
}

.qrrow { display: flex; align-items: flex-start; gap: 5mm; margin-top: 3mm; }
.qrbox { width: 28mm; height: 28mm; flex: none; }
.qrbox canvas, .qrbox img, .qrbox svg { width: 28mm; height: 28mm; display: block; }
.qrcap { font-size: 6.5pt; color: #666; margin-top: .8mm; width: 28mm; text-align: center; line-height: 1.3; }

.infobox {
  flex: 1;
  background: var(--lav-soft);
  border: .2mm solid #c9c9e2;
  padding: 2.4mm 3mm;
  font-size: 8pt;
  line-height: 1.55;
}
.infobox .l b { color: #101c46; }
.infobox .two { display: flex; gap: 6mm; }
.infobox .two > div { flex: 1; }

.chartsec { margin-top: 5mm; }
.chartsec h3 {
  text-align: center; color: var(--blue); font-size: 10.5pt; margin: 0 0 2.5mm;
}
.chart {
  display: flex;
  height: 52mm;
  border-left: .2mm solid #b9b9d6;
  border-bottom: .2mm solid #b9b9d6;
  position: relative;
  background:
    repeating-linear-gradient(to top,
      transparent 0, transparent calc(10% - .2mm),
      #ececf5 calc(10% - .2mm), #ececf5 10%);
}
.chart .bars { flex: 1; display: flex; align-items: flex-end; justify-content: space-around; padding: 0 4mm; }
.chart .barcol { width: 12mm; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart .bar { width: 100%; background: var(--blue-bar); }
.chart .barval { font-size: 6.5pt; color: #333; margin-bottom: .6mm; }
.chart .yaxis {
  width: 9mm; flex: none; display: flex; flex-direction: column;
  justify-content: space-between; align-items: flex-end;
  font-size: 6.5pt; color: #444; padding: 0 0 0 1mm;
  transform: translateY(-2.6mm);
}
.chart .xlabels { display: flex; justify-content: space-around; padding: 1.4mm 4mm 0; }
.chart .xlabels span { width: 12mm; text-align: center; font-size: 6.3pt; color: #333; line-height: 1.25; }
.chartbody { margin-left: 0; }

table.guide { width: 100%; border-collapse: collapse; margin-top: 4.5mm; font-size: 7.4pt; }
table.guide th, table.guide td { border: .2mm solid var(--line); padding: 1.5mm 2mm; vertical-align: top; }
table.guide th { background: var(--lav); color: #101c46; font-size: 7.4pt; }
table.guide td.lvl { text-align: center; font-weight: bold; width: 15mm; }
table.guide td.sk { width: 22mm; font-weight: bold; color: #101c46; }
table.guide td.sk small { display: block; font-weight: normal; color: #555; }

.foot {
  position: absolute; left: 11mm; right: 11mm; bottom: 5mm;
  text-align: center; font-size: 6.8pt; color: var(--blue); line-height: 1.5;
}
.foot .certno { color: #555; }

/* ---------- verify sahifasi ---------- */
.vwrap { max-width: 720px; margin: 30px auto; padding: 0 16px; }
.vcard { background: #fff; border: 1px solid #d4d7e0; border-radius: 8px; padding: 22px; }
.vbadge {
  display: inline-block; padding: 6px 14px; border-radius: 20px;
  font-weight: 600; font-size: 14px; margin-bottom: 14px;
}
.vbadge.ok { background: #e2f4e6; color: #1c6b34; border: 1px solid #9ed3ab; }
.vbadge.bad { background: #fbe7e9; color: #8c2f39; border: 1px solid #dfa0a8; }
.vtable { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.vtable th, .vtable td { border: 1px solid #e0e2ea; padding: 7px 10px; text-align: left; }
.vtable th { background: #f2f3f8; width: 40%; }
.vform { display: flex; gap: 8px; margin: 14px 0 4px; }
.vform input { flex: 1; padding: 9px 12px; border: 1px solid #c3c7d4; border-radius: 5px; font-size: 14px; }
.vhint { font-size: 12.5px; color: #666; line-height: 1.6; }
.vphoto { width: 90px; height: 114px; object-fit: cover; border: 1px solid #999; }

/* ---------- chop etish ---------- */
@media print {
  body { background: #fff; }
  .adminbar, .layout .formcol, .records, .toast, .noprint { display: none !important; }
  .layout { display: block; padding: 0; }
  .sheetwrap { overflow: visible; }
  .sheet { box-shadow: none; margin: 0; transform: none !important; zoom: 1 !important; width: 210mm; height: 296mm; }
  @page { size: A4; margin: 0; }
}
