/* Kartu OSIS — ukuran KTP ID-1 (85,6 × 54 mm). */
.ko {
	--ko-hijau: #0b5d3b;
	--ko-hijau-tua: #073d27;
	--ko-emas: #c9a227;
	width: 85.6mm;
	height: 54mm;
	box-sizing: border-box;
	position: relative;
	overflow: hidden;
	background: #fff;
	color: #1b1b1b;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 6.4pt;
	line-height: 1.25;
	border-radius: 3mm;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
	flex: 0 0 auto;
	text-align: left;
}
.ko * { box-sizing: border-box; }
@media print { .ko { box-shadow: none; } }

/* ---------- Depan ---------- */
.ko-kepala {
	height: 10.6mm;
	background: linear-gradient(120deg, var(--ko-hijau-tua), var(--ko-hijau) 70%);
	color: #fff;
	display: flex;
	align-items: center;
	gap: 2mm;
	padding: 0 3mm;
	border-bottom: .7mm solid var(--ko-emas);
}
.ko-logo { height: 7.6mm; width: 7.6mm; object-fit: contain; flex: 0 0 auto; }
.ko-judul { flex: 1; text-align: center; display: flex; flex-direction: column; }
.ko-judul small { font-size: 4.6pt; letter-spacing: .06em; opacity: .92; }
.ko-judul b { font-size: 7.2pt; letter-spacing: .03em; color: #ffe08a; line-height: 1.15; }
.ko-isi { position: relative; display: flex; gap: 2.4mm; padding: 1.6mm 3mm 0; height: 24.6mm; }
.ko-tanda-air { position: absolute; right: 3mm; top: 0; width: 24mm; opacity: .07; pointer-events: none; }
.ko-foto {
	width: 17mm;
	height: 22.6mm;
	flex: 0 0 auto;
	border: .45mm solid var(--ko-hijau);
	border-radius: 1mm;
	overflow: hidden;
	background: #eef3ef;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: #8aa597;
	font-size: 5pt;
	font-weight: 700;
}
.ko-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ko-data { border-collapse: collapse; flex: 1; position: relative; align-self: flex-start; }
.ko-data th, .ko-data td { padding: .12mm 0; vertical-align: top; text-align: left; font-size: 5.7pt; line-height: 1.2; }
.ko-data th { width: 9.4mm; font-weight: 600; color: var(--ko-hijau); white-space: nowrap; }
.ko-data th::after { content: ":"; float: right; padding-right: .9mm; }
.ko-data td b { font-size: 6.2pt; }
.ko-alamat { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ko-bawah {
	position: absolute;
	left: 3mm;
	right: 3mm;
	bottom: 4.1mm;
	height: 13.4mm;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	border-top: .2mm solid #e1e8e3;
	padding-bottom: .5mm;
}
.ko-qr-wrap { display: flex; align-items: flex-end; gap: 1.4mm; }
.ko-qr { width: 12.4mm; height: 12.4mm; background: #fff; padding: .4mm; }
.ko-qr svg { width: 100%; height: 100%; display: block; }
.ko-qr-wrap small { font-size: 4.4pt; color: #555; line-height: 1.25; }
.ko-qr-wrap small b { font-size: 5.4pt; color: #1b1b1b; letter-spacing: .06em; }
.ko-ttd { position: relative; text-align: center; display: flex; flex-direction: column; min-width: 34mm; line-height: 1.15; }
.ko-ttd small { font-size: 4.5pt; }
.ko-ttd b { font-size: 5.3pt; text-decoration: underline; position: relative; z-index: 1; }
.ko-ttd-gambar { height: 5.2mm; position: relative; }
.ko-ttd-gambar img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-height: 9mm; max-width: 26mm; object-fit: contain; }
.ko-kaki {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3.9mm;
	background: var(--ko-hijau);
	color: #fff;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 3mm;
	font-size: 4.9pt;
	font-weight: 600;
	letter-spacing: .02em;
}
.ko-kaki span:last-child { color: #ffe08a; }

/* ---------- Belakang ---------- */
.ko-garis-atas { height: 2.2mm; background: linear-gradient(90deg, var(--ko-hijau), var(--ko-emas)); }
.ko-tanda-air-b { top: 8mm; right: 50%; transform: translateX(50%); width: 34mm; opacity: .06; }
.ko-b-atas { position: relative; padding: 2.4mm 3.6mm 0; }
.ko-b-atas b { color: var(--ko-hijau); font-size: 6.6pt; letter-spacing: .08em; }
.ko-b-atas ol { margin: 1mm 0 0; padding-left: 3.8mm; font-size: 5.8pt; line-height: 1.4; }
.ko-b-madrasah {
	position: absolute;
	left: 3.6mm;
	right: 3.6mm;
	bottom: 5.4mm;
	display: flex;
	gap: 2mm;
	align-items: center;
	border-top: .2mm solid #e1e8e3;
	padding-top: 1.6mm;
}
.ko-b-madrasah img { width: 8mm; height: 8mm; object-fit: contain; }
.ko-b-madrasah div { display: flex; flex-direction: column; font-size: 4.8pt; color: #444; line-height: 1.3; }
.ko-b-madrasah b { font-size: 6.2pt; color: var(--ko-hijau); }
.ko-b-kaki {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3.8mm;
	background: var(--ko-hijau);
	color: #fff;
	font-size: 4.6pt;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 3mm;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---------- Kartu pegawai (potret 54 × 85,6 mm) ---------- */
.ko.kp { width: 54mm; height: 85.6mm; --kp1: #0b5d3b; --kp2: #073d27; --kp3: #1f8a5b; --kp-aksen: #c9a227; --kp-muda: #e3f1e9; background: #fff; }
.ko.kp-tendik { --kp1: #12597a; --kp2: #0a3550; --kp3: #2a8fb5; --kp-aksen: #e0b23c; --kp-muda: #e2eff5; }
.kp-latar { position: absolute; inset: 0; overflow: hidden; }
.kp-latar i { position: absolute; display: block; border-radius: 50%; }
.kp-bulat1 { width: 44mm; height: 44mm; right: -16mm; top: 6mm; background: radial-gradient(circle at 35% 35%, var(--kp-muda), rgba(255, 255, 255, 0) 70%); }
.kp-bulat2 { width: 30mm; height: 30mm; left: -12mm; top: 30mm; background: radial-gradient(circle, rgba(201, 162, 39, .18), rgba(201, 162, 39, 0) 70%); }
.kp-bintang { inset: 0; border-radius: 0 !important; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='.8'%3E%3Cpath d='M20 4l4.7 11.3L36 20l-11.3 4.7L20 36l-4.7-11.3L4 20l11.3-4.7z'/%3E%3Crect x='10' y='10' width='20' height='20' transform='rotate(45 20 20)'/%3E%3Crect x='10' y='10' width='20' height='20'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 9mm 9mm; filter: invert(1); opacity: .035; }
.kp-kepala { position: absolute; left: 3mm; top: 3mm; display: flex; align-items: center; gap: 1.4mm; z-index: 2; }
.kp-kepala img { width: 7.4mm; height: 7.4mm; object-fit: contain; }
.kp-kepala div { display: flex; flex-direction: column; line-height: 1; }
.kp-kepala small { font-size: 4.6pt; font-weight: 800; letter-spacing: .18em; color: var(--kp1); }
.kp-kepala b { font-size: 9.4pt; font-weight: 900; color: var(--kp1); letter-spacing: .01em; }
.kp-kepala em { font-style: normal; font-size: 4.3pt; font-weight: 800; color: var(--kp-aksen); letter-spacing: .08em; margin-top: .4mm; }
.kp-logo-kanan { position: absolute; right: 3mm; top: 3.2mm; width: 6.6mm; height: 6.6mm; object-fit: contain; z-index: 2; }
.kp-foto { position: absolute; left: 50%; top: 13.5mm; width: 40mm; height: 53mm; transform: translateX(-50%); border-radius: 20mm 20mm 0 0; overflow: hidden; z-index: 1;
	background: linear-gradient(180deg, var(--kp-muda), #fff 80%);
	-webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 98%); mask-image: linear-gradient(180deg, #000 72%, transparent 98%); }
.kp-foto img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.kp-foto.kosong { display: flex; align-items: center; justify-content: center; color: #9db3a7; font-size: 6pt; font-weight: 800; letter-spacing: .2em; }
.kp-bawah { position: absolute; left: 0; right: 0; bottom: 0; height: 30mm; z-index: 2; }
.kp-gelombang { position: absolute; inset: 0; width: 100%; height: 100%; }
.kp-gelombang .g1 { fill: var(--kp3); opacity: .85; }
.kp-gelombang .g2 { fill: var(--kp2); }
.kp-gelombang .g3 { fill: none; stroke: var(--kp-aksen); stroke-width: .7; }
.kp-teks { position: absolute; left: 3.2mm; right: 20mm; bottom: 3.6mm; color: #fff; display: flex; flex-direction: column; gap: .5mm; }
.kp-pil { align-self: flex-start; font-size: 3.9pt; font-weight: 800; letter-spacing: .14em; background: var(--kp-aksen); color: #1b1b1b; border-radius: 99px; padding: .35mm 1.6mm; margin-bottom: .4mm; }
.kp-nama { font-size: 7.2pt; font-weight: 900; line-height: 1.12; text-transform: uppercase; letter-spacing: .01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kp-nip { font-size: 5.2pt; letter-spacing: .03em; opacity: .95; }
.kp-jabatan { font-size: 4.8pt; color: #ffe8a3; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kp-qr-depan { position: absolute; right: 3mm; bottom: 3.6mm; width: 15.4mm; height: 15.4mm; background: #fff; border-radius: 1.6mm; padding: .9mm; box-shadow: 0 .4mm 1.2mm rgba(0, 0, 0, .25); }
.kp-qr-depan .ko-qr { width: 100%; height: 100%; padding: 0; border: 0; }

.ko.kp-belakang { background: linear-gradient(160deg, var(--kp3) 0%, var(--kp1) 42%, var(--kp2) 100%); color: #fff; }
.kp-pola { position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='.8'%3E%3Cpath d='M20 4l4.7 11.3L36 20l-11.3 4.7L20 36l-4.7-11.3L4 20l11.3-4.7z'/%3E%3Crect x='10' y='10' width='20' height='20' transform='rotate(45 20 20)'/%3E%3Crect x='10' y='10' width='20' height='20'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 9mm 9mm; opacity: .09; }
.kp-belakang::before { content: ""; position: absolute; width: 60mm; height: 60mm; border-radius: 50%; left: -26mm; bottom: -22mm; background: radial-gradient(circle, rgba(201, 162, 39, .35), rgba(201, 162, 39, 0) 65%); }
.kp-belakang::after { content: ""; position: absolute; width: 40mm; height: 40mm; border-radius: 50%; right: -18mm; top: -14mm; border: 2.4mm solid rgba(255, 255, 255, .08); }
.kp-kode { position: absolute; right: 3mm; top: 2.8mm; font-size: 4.8pt; font-weight: 800; letter-spacing: .12em; opacity: .9; z-index: 1; }
.kp-b-tengah { position: absolute; left: 0; right: 0; top: 15mm; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .8mm; z-index: 1; }
.kp-b-logo { display: flex; gap: 2.4mm; align-items: center; margin-bottom: 1.6mm; }
.kp-b-logo img { width: 13mm; height: 13mm; object-fit: contain; filter: drop-shadow(0 .4mm .8mm rgba(0, 0, 0, .25)); }
.kp-b-tengah b { font-size: 10pt; font-weight: 900; letter-spacing: .04em; }
.kp-b-tengah small { font-size: 4.8pt; opacity: .9; }
.kp-b-tengah em { font-style: italic; font-size: 5pt; color: #ffe08a; margin-top: 1.2mm; }
.kp-b-panel { position: absolute; left: 3mm; right: 3mm; bottom: 6.4mm; background: rgba(255, 255, 255, .96); color: #1b1b1b; border-radius: 2mm; padding: 1.8mm 2mm; display: flex; gap: 2mm; align-items: flex-end; z-index: 1; }
.kp-b-info { display: flex; flex-direction: column; line-height: 1.2; min-width: 14mm; }
.kp-b-info small { font-size: 3.8pt; color: #66736c; }
.kp-b-info b { font-size: 5pt; margin-bottom: .8mm; color: var(--kp1); }
.kp-ttd { flex: 1; min-width: 0; }
.kp-ttd small { font-size: 4pt; }
.kp-ttd b { font-size: 4.7pt; }
.kp-ttd .ko-ttd-gambar { height: 5.6mm; }
.kp-ttd .ko-ttd-gambar img { max-height: 9mm; max-width: 22mm; }
.kp-b-kaki { position: absolute; left: 0; right: 0; bottom: 2mm; text-align: center; font-size: 4.8pt; font-weight: 700; letter-spacing: .06em; opacity: .9; z-index: 1; }

/* ---------- Kartu OSIS (mendatar, satu sisi) — hijau sage yang tenang ---------- */
.ko.ks { --kp1: #3d7a66; --kp2: #23483d; --kp3: #86b9a3; --kp-aksen: #d6c48e; --kp-muda: #e9f3ee; background: #fbfdfc; }
.ks-bulat1 { width: 46mm; height: 46mm; right: -14mm; top: -16mm; background: radial-gradient(circle at 40% 60%, var(--kp-muda), rgba(255, 255, 255, 0) 70%); }
.ks-bulat2 { width: 30mm; height: 30mm; left: 14mm; top: 8mm; background: radial-gradient(circle, rgba(134, 185, 163, .18), rgba(134, 185, 163, 0) 70%); }
.ks-kepala { top: 2.6mm; left: 3mm; }
.ks-kepala img { width: 6.6mm; height: 6.6mm; }
.ks-kepala small { font-size: 4pt; letter-spacing: .14em; }
.ks-kepala b { font-size: 8.6pt; }
.ks-kepala em { font-size: 4pt; color: #9a8a4f; }
.ks-kanan-atas { position: absolute; right: 3mm; top: 2.6mm; z-index: 2; }
.ks-kanan-atas img { width: 6.8mm; height: 6.8mm; object-fit: contain; }
.kp-foto.ks-foto { left: 3mm; top: 11.6mm; width: 23mm; height: 31mm; transform: none; border-radius: 11.5mm 11.5mm 0 0; -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent 99%); mask-image: linear-gradient(180deg, #000 78%, transparent 99%); }
.ks-data { position: absolute; left: 28.6mm; right: 21mm; top: 12.4mm; display: flex; flex-direction: column; gap: .35mm; font-size: 5.6pt; line-height: 1.2; z-index: 2; color: #2a3a33; }
.ks-data .kp-pil { margin-bottom: .6mm; color: #23483d; }
.ks-nama { font-size: 7.6pt; font-weight: 900; color: var(--kp2); text-transform: uppercase; line-height: 1.12; margin-bottom: .4mm; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ks-kelas { font-weight: 800; color: var(--kp1); }
.ks-ttd { position: absolute; left: 28.6mm; bottom: 9.4mm; width: 30mm; min-width: 0; z-index: 2; text-align: left; align-items: flex-start; }
.ks-ttd small { font-size: 4pt; }
.ks-ttd b { font-size: 4.6pt; }
.ks-ttd .ko-ttd-gambar { height: 4.6mm; width: 100%; }
.ks-ttd .ko-ttd-gambar img { left: 8mm; max-height: 8mm; max-width: 20mm; }
.ks-bawah { position: absolute; left: 0; right: 0; bottom: 0; height: 12mm; z-index: 1; }
.ks-berlaku { position: absolute; left: 3mm; bottom: 1.6mm; color: #fff; font-size: 4.6pt; font-weight: 700; letter-spacing: .03em; }
.kp-qr-depan.ks-qr { right: 3mm; bottom: 3mm; width: 16mm; height: 16mm; z-index: 3; }

/* ---------- Portal ---------- */
.ko-tampil { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin: 6px 0 4px; }
.ko-tampil .ko { transform-origin: top center; }
.ko-langkah { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ko-langkah li { display: flex; gap: 10px; align-items: flex-start; }
.ko-langkah .n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: #e7f2ec; color: #0b5d3b; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.ko-langkah .n.ok { background: #0b5d3b; color: #fff; }
.ko-langkah p { margin: 2px 0 0; font-size: 13.5px; color: #5b6660; }
.ko-tombol { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ko-tombol .tombol[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.ko-potong { margin-top: 10px; }
.ko-potong-area {
	position: relative;
	width: 210px;
	height: 280px;
	margin: 8px auto;
	overflow: hidden;
	border-radius: 10px;
	background: #e9eee9;
	touch-action: none;
	cursor: grab;
	border: 2px solid #0b5d3b;
}
.ko-potong-area img { position: absolute; left: 0; top: 0; user-select: none; -webkit-user-drag: none; max-width: none; }
.ko-potong-area::after { content: ""; position: absolute; inset: 18% 22% 30%; border: 2px dashed rgba(255, 255, 255, .85); border-radius: 50% 50% 46% 46%; pointer-events: none; }
.ko-potong input[type=range] { width: 100%; }
.ko-status { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; }
.ko-status.ok { background: #e7f2ec; color: #0b5d3b; }
.ko-status.tunggu { background: #fff4d6; color: #7a5a00; }
.ko-status.tolak { background: #fcebeb; color: #a32d2d; }
.ko-cek { max-width: 460px; margin: 0 auto; text-align: center; }
.ko-cek-hasil { border-radius: 14px; padding: 18px; color: #fff; margin-bottom: 14px; }
.ko-cek-hasil.asli { background: #0b5d3b; }
.ko-cek-hasil.palsu { background: #a32d2d; }
.ko-cek-hasil.nonaktif { background: #7a5a00; }
.ko-cek-hasil b { font-size: 22px; display: block; }
.ko-cek-foto { width: 120px; height: 160px; object-fit: cover; border-radius: 10px; border: 3px solid #fff; margin: 10px auto 0; display: block; background: #eee; }
.ko-cek table { width: 100%; text-align: left; border-collapse: collapse; }
.ko-cek th, .ko-cek td { padding: 8px 4px; border-bottom: 1px solid #e5e9e6; }
.ko-cek th { color: #5b6660; font-weight: 600; width: 40%; }
@media (max-width: 380px) { .ko-tampil .ko { zoom: .9; } }
