/* Claude Design "Чамд дурласны гэрчилгээ" загвараас */
:root {
  --yellow: #FDB933;
  --navy: #1B2B5E;
  --gold: #F0C45A;
  --orange: #F28A1E;
  --paper: #FFF4EC;
  --pink: #D6406A;
  --pink-hover: #E2557A;
  --violet: #7A5C92;
  --blue: #2E6FD8;
  --green: #1F9468;
  --amber: #C77A0E;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--yellow); }
body { font-family: 'Nunito', sans-serif; color: var(--navy); }
a { color: var(--navy); }
a:hover { color: var(--pink-hover); }

/* ---------- Book ---------- */
.book {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
}

.cover {
  cursor: pointer;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 440 / 620;
  border-radius: 14px 22px 22px 14px;
  background: radial-gradient(120% 90% at 30% 20%, #2B3F7E 0%, #1B2B5E 55%, #121D42 100%);
  box-shadow: -8px 10px 0 var(--orange), 0 30px 60px rgba(80, 40, 0, .35);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 56px 32px 64px;
  transform: rotate(-2deg);
  margin-bottom: 40px;
  color: var(--gold);
  text-align: center;
}
.cover::before {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1.5px solid rgba(240, 196, 90, .45);
  border-radius: 10px 16px 16px 10px;
  pointer-events: none;
}
.cover-country { font-family: 'Comfortaa', sans-serif; font-weight: 700; font-size: 28px; letter-spacing: .12em; }
.cover-emblem { display: block; height: 150px; width: auto; filter: drop-shadow(0 3px 0 #B8851F); }
.cover-titles { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cover-title { font-family: 'Comfortaa', sans-serif; font-weight: 700; font-size: 30px; line-height: 1.2; }
.cover-sub { font-size: 12px; letter-spacing: .3em; font-weight: 700; }
.cover-hint {
  position: absolute; bottom: -50px; left: 0; right: 0;
  font-family: 'Caveat', cursive; font-size: 26px; color: var(--navy);
}

.spread {
  width: 100%;
  max-width: 960px;
  background: var(--navy);
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 30px 60px rgba(80, 40, 0, .35);
  display: flex;
  flex-wrap: wrap;
}
.leaf {
  flex: 1 1 340px;
  min-height: 600px;
  background: var(--paper);
  position: relative;
  overflow: hidden;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.leaf > * { position: relative; }
.leaf.left { border-radius: 10px 4px 4px 10px; box-shadow: inset -18px 0 24px -18px rgba(27, 43, 94, .25); }
.leaf.right { border-radius: 4px 10px 10px 4px; box-shadow: inset 18px 0 24px -18px rgba(27, 43, 94, .25); }
.leaf > .leaf-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 50% 115%, rgba(226, 85, 122, .10) 0 1px, transparent 1px 8px),
    repeating-radial-gradient(circle at 50% -15%, rgba(233, 168, 32, .12) 0 1px, transparent 1px 10px);
}

.kicker { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .2em; font-weight: 800; color: var(--pink); }
.title { font-family: 'Comfortaa', sans-serif; font-weight: 700; font-size: 30px; line-height: 1.2; }
.title.small { font-size: 26px; }
.lead { margin: 0; font-size: 16px; line-height: 1.6; text-wrap: pretty; }

.p1-bottom { flex: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 70px; }
.sticker-wrap { position: relative; width: 170px; height: 170px; flex: none; }
.bubble {
  position: absolute; top: -70px; left: 96px; width: 160px;
  background: #fff; border-radius: 50%; padding: 18px 14px; text-align: center;
  font-family: 'Caveat', cursive; font-size: 19px; line-height: 1.05;
  box-shadow: 0 2px 0 rgba(27, 43, 94, .12); pointer-events: none;
}
.seal {
  width: 116px; height: 116px; flex: none; border-radius: 50%;
  border: 3px double var(--pink); color: var(--pink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  transform: rotate(-14deg); font-weight: 800; font-size: 10px; letter-spacing: .06em; line-height: 1.3;
}
.seal span { font-size: 26px; line-height: 1; }
.seal em { font-style: normal; margin-top: 2px; }

.slot { display: block; width: 100%; height: 100%; object-fit: cover; }
.slot.circle { border-radius: 50%; }
.slot.empty {
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px;
  background: rgba(27, 43, 94, .06); border: 2px dashed rgba(27, 43, 94, .3);
  color: rgba(27, 43, 94, .55); font-size: 13px; font-weight: 700;
}
.slot.circle.empty { font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 2px; }
.label, .field .label { font-size: 10px; letter-spacing: .14em; font-weight: 800; color: var(--violet); }
.value { font-size: 14px; color: var(--navy); }
.field.big .value { font-size: 17px; font-weight: 800; }
.field.mid .value { font-size: 15px; font-weight: 700; }
.field.pink .value { color: var(--pink); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid3 .label { letter-spacing: .12em; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid2.signs { gap: 20px; }

.id-row { display: flex; gap: 20px; flex-wrap: wrap; }
.photo-frame {
  width: 130px; height: 168px; flex: none; border-radius: 10px; overflow: hidden;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--gold);
}
.photo-frame .slot.empty { border: 0; }
.id-fields { flex: 1 1 160px; display: flex; flex-direction: column; gap: 12px; }

.signature {
  display: flex; flex-direction: column; gap: 2px;
  border-bottom: 1.5px dashed var(--navy); padding-bottom: 4px; max-width: 240px;
}
.hand { font-family: 'Caveat', cursive; font-size: 32px; line-height: 1; }
.signs .hand { font-size: 28px; }
.signature.empty { min-height: 40px; justify-content: flex-end; }
.sig-img { display: block; height: 40px; max-width: 100%; object-fit: contain; object-position: left bottom; }
.mrz {
  margin-top: auto; font-family: 'PT Mono', monospace; font-size: 14px; line-height: 1.5;
  letter-spacing: .06em; word-break: break-all; background: rgba(255, 255, 255, .7);
  border-radius: 6px; padding: 8px 10px;
}

.stamps {
  flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px; align-content: center; justify-items: center; align-items: center;
}
.stamp {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; font-weight: 800; gap: 2px; width: 140px; height: 112px; padding: 8px;
  overflow: hidden; overflow-wrap: anywhere;
}
.stamp small { font-size: 10.5px; letter-spacing: .12em; line-height: 1.2; }
.stamp b { font-family: 'Comfortaa', sans-serif; font-size: 18px; line-height: 1.15; }
.stamp i { font-style: normal; font-size: 10px; letter-spacing: .2em; line-height: 1.2; }
.st-pink-circle { height: 140px; border-radius: 50%; border: 3px solid var(--pink); color: var(--pink); }
.st-pink-circle i { font-size: 18px; letter-spacing: 0; }
.st-blue-rect { border-radius: 14px; border: 3px dashed var(--blue); color: var(--blue); }
.st-green-pill { border-radius: 60px; border: 3px solid var(--green); color: var(--green); }
.st-amber-square { width: 130px; height: 130px; border: 3px double var(--amber); color: var(--amber); border-radius: 6px; }
.st-amber-square b { font-size: 32px; line-height: 1; }
.st-amber-square i { font-size: 11px; letter-spacing: .12em; }
.st-violet-circle { height: 140px; border-radius: 50%; border: 3px solid var(--violet); color: var(--violet); }
.st-navy-oval { border-radius: 50%; border: 4px double var(--navy); color: var(--navy); }
.st-dashed {
  border: 2.5px dashed rgba(27, 43, 94, .35); color: rgba(27, 43, 94, .55); border-radius: 14px;
  font-family: 'Caveat', cursive; font-size: 22px; font-weight: 400; line-height: 1.1; padding: 16px;
}
.st-next { border-radius: 50%; height: 140px; }

.rules { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; font-size: 16px; line-height: 1.45; }
.note { margin-top: auto; font-size: 13px; line-height: 1.5; color: var(--violet); font-weight: 700; }

/* Номын булан — хуудас эргүүлэх (харах хуудас) */
.corner {
  position: absolute; bottom: 0; z-index: 2;
  width: 64px; height: 64px; padding: 0; border: 0; background: none; cursor: pointer;
  transition: width .25s ease, height .25s ease;
  animation: corner-hint 2.4s ease-in-out .8s 2;
}
.corner::before { content: ''; position: absolute; inset: 0; }
.corner.next { right: 0; }
.corner.prev { left: 0; }
/* Дээд хэсэг нь эргэсэн цаас, доод хэсэгт номын хавтас харагдана */
.corner.next::before {
  background: linear-gradient(to bottom right, #fff 0%, #f6e3d4 38%, #e2c3ab 49.5%, var(--navy) 50.5%);
  border-top-left-radius: 6px;
  filter: drop-shadow(-2px -2px 3px rgba(27, 43, 94, .18));
}
.corner.prev::before {
  background: linear-gradient(to bottom left, #fff 0%, #f6e3d4 38%, #e2c3ab 49.5%, var(--navy) 50.5%);
  border-top-right-radius: 6px;
  filter: drop-shadow(2px -2px 3px rgba(27, 43, 94, .18));
}
.corner span {
  position: absolute; top: 6px; font-size: 28px; font-weight: 800; line-height: 1;
  color: var(--pink); transition: transform .25s ease;
}
.corner.next span { left: 12px; }
.corner.prev span { right: 12px; }
.corner:hover, .corner:focus-visible { width: 92px; height: 92px; }
.corner.next:hover span { transform: translateX(3px); }
.corner.prev:hover span { transform: translateX(-3px); }
.corner:focus-visible { outline: none; }
.corner:focus-visible span { text-decoration: underline; }
.with-corners .leaf { padding-bottom: 76px; }
.corner.phone-only { display: none; }
/* Утсан дээр (≈720px-ээс нарийн) нэг удаад нэг тал, тал бүрд хоёр сум */
@media (max-width: 719px) {
  .corner.phone-only { display: block; }
}
.spread.show-left .leaf.right, .spread.show-right .leaf.left { display: none; }
@keyframes corner-hint { 0%, 100% { width: 64px; height: 64px; } 50% { width: 80px; height: 80px; } }

/* Хуудас эргэх хөдөлгөөн */
.spread { perspective: 2000px; }
.spread.flip-next .leaf.left { transform-origin: right center; animation: flip-in-left .55s ease-out; }
.spread.flip-prev .leaf.right { transform-origin: left center; animation: flip-in-right .55s ease-out; }
@keyframes flip-in-left { from { transform: rotateY(85deg); } }
@keyframes flip-in-right { from { transform: rotateY(-85deg); } }
/* Утсан дээр харагдаж буй тал эргэнэ */
.spread.show-left.flip-next .leaf.left, .spread.show-right.flip-next .leaf.right {
  transform-origin: left center; animation: flip-in-right .5s ease-out;
}
.spread.show-left.flip-prev .leaf.left, .spread.show-right.flip-prev .leaf.right {
  transform-origin: right center; animation: flip-in-left .5s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .corner, .spread .leaf { animation: none !important; }
}

.pill-btn {
  height: 44px; padding: 0 18px; border-radius: 22px; border: none;
  background: var(--navy); color: var(--gold);
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.pill-btn:hover { color: #fff; }
.pill-btn.ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.pill-btn:disabled { opacity: .6; cursor: wait; }

@media (max-width: 420px) {
  .leaf { padding: 28px 20px; }
  .sticker-wrap { width: 130px; height: 130px; }
  .bubble { left: 70px; width: 140px; font-size: 17px; }
  .seal { width: 96px; height: 96px; }
  .stamps { gap: 12px; }
  .stamp { width: 124px; height: 100px; }
  .st-pink-circle, .st-violet-circle, .st-next { height: 124px; }
  .st-amber-square { width: 116px; height: 116px; }
}

/* ---------- Create page ---------- */
.site-head { text-align: center; padding: 36px 16px 8px; }
.site-head h1 { font-family: 'Comfortaa', sans-serif; font-size: clamp(26px, 5vw, 40px); margin: 0 0 6px; }
.site-head p { margin: 0; font-weight: 700; }
.lang-switch {
  display: inline-flex; margin-bottom: 14px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .55);
}
.lang-switch button {
  border: 0; border-radius: 999px; padding: 6px 14px; background: transparent; cursor: pointer;
  font: 800 13px 'Nunito', sans-serif; letter-spacing: .08em; color: var(--navy);
}
.lang-switch button[aria-pressed="true"] { background: var(--navy); color: var(--gold); }

.create {
  max-width: 1400px; margin: 0 auto; padding: 24px 16px 48px;
  display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 28px; align-items: start;
  min-width: 0;
}
@media (max-width: 1000px) { .create { grid-template-columns: minmax(0, 1fr); } }
.create .book { position: sticky; top: 16px; }
@media (max-width: 1000px) { .create .book { position: static; } }

.panel { background: var(--paper); border-radius: 18px; padding: 24px; box-shadow: 0 10px 30px rgba(80, 40, 0, .18); }
.panel h2 { font-family: 'Comfortaa', sans-serif; font-size: 16px; margin: 0 0 4px; }
.panel h2:not(:first-child) { margin-top: 24px; }
.sec { border-bottom: 1.5px solid rgba(122, 92, 146, .2); padding-bottom: 12px; }
.sec + .sec { margin-top: 12px; }
.sec + h2 { margin-top: 24px; }
.sec > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: 'Comfortaa', sans-serif; font-weight: 700; font-size: 16px; padding: 6px 0;
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after {
  content: '⌄'; font-size: 20px; line-height: 1; color: var(--violet); transition: transform .2s;
  transform: translateY(-4px);
}
.sec[open] > summary::after { transform: rotate(180deg) translateY(-4px); }
.panel label { display: block; font-size: 11px; letter-spacing: .12em; font-weight: 800; color: var(--violet); margin: 12px 0 4px; }
.panel input, .panel textarea {
  width: 100%; min-width: 0; font: inherit; font-weight: 600; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid rgba(27, 43, 94, .2); background: #fff; color: var(--navy);
}
.panel input:focus, .panel textarea:focus { outline: none; border-color: var(--pink); }
.panel textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.panel input[type=file] { padding: 8px; font-size: 13px; }
.panel .hint { font-size: 12px; color: var(--violet); margin: 4px 0 0; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.panel .pill-btn { width: 100%; margin-top: 20px; }
.msg { font-size: 14px; font-weight: 700; margin: 12px 0 0; }
.msg.err { color: #b42318; }

.result { margin-top: 16px; padding: 16px; border-radius: 12px; background: #fff; }
.result input { font-family: 'PT Mono', monospace; font-size: 13px; }
.result .actions { display: flex; gap: 8px; margin-top: 8px; }
.result .actions .pill-btn { margin-top: 0; height: 38px; font-size: 14px; }

.stamp-ed { background: #fff; border-radius: 12px; padding: 10px 12px 12px; margin-top: 10px; }
.stamp-ed .head { display: flex; gap: 8px; align-items: center; }
.stamp-ed .head b { font-size: 12px; color: var(--violet); white-space: nowrap; }
.stamp-ed select { flex: 1; min-width: 0; font: inherit; font-size: 13px; font-weight: 700; padding: 6px 8px; border-radius: 8px; border: 1.5px solid rgba(27, 43, 94, .2); background: #fff; color: var(--navy); }
.stamp-ed .del { border: 0; background: none; color: var(--pink); font: inherit; font-weight: 800; cursor: pointer; padding: 4px 6px; }
.stamp-ed .row3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; margin-top: 8px; }
.stamp-ed .row3 [data-k="top"] { grid-column: 1 / -1; }
.stamp-ed input { padding: 8px; font-size: 13px; }
.panel .pill-btn.add { margin-top: 10px; height: 38px; font-size: 14px; }

/* ---------- View page ---------- */
.view { padding: 40px 16px 48px; }
.view-tools { position: fixed; top: 16px; right: 16px; z-index: 10; display: flex; gap: 10px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--navy); color: var(--gold);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(80, 40, 0, .3);
  transition: transform .15s ease, color .15s ease;
}
.icon-btn:hover, .icon-btn:focus-visible { color: #fff; transform: translateY(-2px); }
.icon-btn:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Утсан дээр товчнууд номтой давхцахгүй */
@media (max-width: 600px) { .view { padding-top: 76px; } }
.state { text-align: center; padding: 80px 16px; font-family: 'Comfortaa', sans-serif; font-weight: 700; font-size: 20px; }

/* ---------- Music ---------- */
.yt-host { position: fixed; right: 0; bottom: 0; width: 200px; height: 200px; opacity: 0; pointer-events: none; z-index: -1; }
.music-row { display: flex; gap: 8px; align-items: center; }
.music-row input { flex: 1; }
.music-row .pill-btn { width: auto; margin: 0; height: 42px; font-size: 13px; white-space: nowrap; flex: none; }
.hint.ok { color: var(--green); font-weight: 700; }
.hint.err { color: #b42318; font-weight: 700; }
.sig-pad {
  position: relative; margin-top: 8px; border: 1.5px dashed var(--violet); border-radius: 12px; background: #fff;
}
.sig-pad canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; border-radius: 12px; }
.sig-ph {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 0 12px; text-align: center;
  font-size: 13px; color: var(--violet); opacity: .7; pointer-events: none;
}
.sig-pad.drawn .sig-ph { display: none; }
.sig-clear {
  position: absolute; top: 6px; right: 6px; border: 0; border-radius: 999px; padding: 4px 10px;
  font: 700 12px 'Nunito', sans-serif; color: var(--violet); background: rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 1px var(--violet); cursor: pointer;
}

/* ---------- Admin ---------- */
.admin { max-width: 1000px; margin: 0 auto; padding: 16px 16px 48px; }
.login { max-width: 360px; margin: 64px auto; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input { max-width: 260px; }
.toolbar .count { font-weight: 800; }
.certs { display: grid; gap: 10px; }
.cert-row {
  background: var(--paper); border-radius: 14px; padding: 14px 16px;
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.cert-row h3 { margin: 0 0 2px; font-size: 16px; }
.cert-row p { margin: 0; font-size: 13px; color: var(--violet); font-weight: 700; }
.cert-row .actions { display: flex; gap: 8px; }
.cert-row .pill-btn { height: 36px; font-size: 13px; }


/* ---------- Захиалга: Линк | Хэвлэмэл, хугацаа, төлбөр ---------- */
.kind-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 8px 0 12px; padding: 4px;
  border-radius: 999px; background: rgba(122, 92, 146, .12);
}
.kind-tabs button {
  border: 0; border-radius: 999px; height: 38px; background: transparent; cursor: pointer;
  font: 800 14px 'Nunito', sans-serif; color: var(--navy);
}
.kind-tabs button[aria-selected="true"] { background: var(--navy); color: var(--gold); }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.panel label.plan {
  position: relative; display: flex; flex-direction: column; gap: 2px; margin: 0 !important; padding: 12px 14px;
  border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1.5px rgba(122, 92, 146, .25); cursor: pointer;
  letter-spacing: 0 !important;
}
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan b { font: 700 15px 'Comfortaa', sans-serif; color: var(--navy); }
.plan span { font: 800 14px 'Nunito', sans-serif; color: var(--pink, #e0457b); }
.panel label.plan:has(input:checked) { box-shadow: inset 0 0 0 2.5px var(--navy); }
.panel label.plan:has(input:focus-visible) { outline: 2px solid var(--navy); outline-offset: 2px; }
.paid-note { margin: 0 0 10px; font-weight: 800; color: var(--green); }

.pay {
  width: min(380px, calc(100vw - 32px)); border: 0; border-radius: 20px; padding: 22px 20px;
  background: var(--paper, #fff8f0); color: var(--navy); text-align: center;
}
.pay::backdrop { background: rgba(27, 43, 94, .55); }
.pay h3 { margin: 0; font: 700 18px 'Comfortaa', sans-serif; }
.pay-amount { margin: 6px 0 10px; font: 800 26px 'Nunito', sans-serif; color: var(--pink, #e0457b); }
.pay-qr { display: block; width: 220px; height: 220px; margin: 0 auto; border-radius: 12px; background: #fff; padding: 8px; }
.banks { display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; max-height: 220px; overflow: auto; }
.bank { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; color: var(--navy); text-decoration: none; }
.bank img { width: 44px; height: 44px; border-radius: 12px; }
/* Банкны апп руу шилжих товч зөвхөн утсан дээр утгатай */
@media (hover: none) and (pointer: coarse) { .banks { display: grid; } }
.pay-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.pay-actions .pill-btn { width: auto; margin: 0; }
#payTest { width: auto; margin: 10px auto 0; }
#payReopen { width: 100%; margin-top: 8px; }

/* ---------- Админ хэвлэх: нүүр + 3 хуудас, тус бүр нэг A4 ---------- */
#print-area { display: none; }
@page { size: A4 landscape; margin: 10mm; }
@media print {
  html, body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
  .print-page {
    break-after: page; page-break-after: always;
    display: flex; justify-content: center; align-items: center; height: 188mm;
  }
  .print-page:last-child { break-after: auto; page-break-after: auto; }
  .print-page .cover { transform: none; margin: 0; height: 180mm; width: auto; box-shadow: none; }
  .print-page .cover-hint { display: none; }
  .print-page .spread { max-width: none; box-shadow: none; }
  .print-page .leaf { min-height: 168mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Админ: шүүлтүүр, төлөв ---------- */
.filters { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(122, 92, 146, .12); }
.filters button {
  border: 0; border-radius: 999px; padding: 6px 12px; background: transparent; cursor: pointer;
  font: 800 13px 'Nunito', sans-serif; color: var(--navy);
}
.filters button[aria-selected="true"] { background: var(--navy); color: var(--gold); }
.cert-row select { height: 36px; border-radius: 18px; padding: 0 10px; font: 700 13px 'Nunito', sans-serif; }
.badge { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 14px; font-size: 12px; font-weight: 800; background: #eee; }
.badge.paid { background: #dcf3e9; color: var(--green); }
.badge.pending { background: #fdf0d5; color: var(--amber); }
