/* ============ AURUN DISPLAY — tegas / flat / no-rounded ============ */
* { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0 !important; }
[hidden] { display: none !important; }

@font-face {
  font-family: 'Nasalization';
  src: url('../vendor/fonts/nasalization.woff') format('woff');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:      #0a0b0d;
  --panel:   #121317;
  --line:    #2a2d34;
  --line2:   #3a3e47;
  --text:    #f2f3f5;
  --muted:   #8b9099;
  --accent:  #e4002b;   /* merah tegas */
  --ok:      #19c37d;
  --warn:    #ffb000;
}

html, body { height: 100%; }
body {
  font-family: "Montserrat", system-ui, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- shared ---------- */
.uppercase { text-transform: uppercase; letter-spacing: .08em; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px solid var(--accent);
  padding: 16px 24px;
  background: #0c0d10;
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; display: flex; align-items: center; }
.brand b { color: var(--accent); }
.brand-logo { height: 32px; width: auto; display: block; }
.login-box .brand-logo { height: 54px; margin: 0 auto 14px; }
.crumb { color: var(--muted); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }

.nav { display: flex; gap: 26px; align-items: center; }
.nav a {
  position: relative; color: var(--muted); text-decoration: none;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  padding: 6px 0;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: #fff; }
.nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent);
}
.nav a.logout { color: var(--muted); margin-left: 6px; }
.nav a.logout:hover { color: var(--accent); }

.wrap { max-width: none; width: 100%; margin: 0; padding: 24px 32px; }

/* ---------- home ---------- */
.home-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
@media (max-width: 640px) { .home-grid { grid-template-columns: repeat(2, 1fr); } }
.home-card {
  display: block; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line);
  padding: 40px 24px; text-align: center;
}
.home-card:hover { border-color: var(--accent); }
.home-card .num { font-size: 44px; font-weight: 900; color: var(--accent); }
.home-card .lbl { margin-top: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.home-card .desc { margin-top: 8px; color: var(--muted); font-size: 13px; }

/* ---------- panels / forms ---------- */
.section { border: 1px solid var(--line); background: var(--panel); margin-bottom: 14px; }
.section > h2 {
  font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: #0e0f12;
}
.section > .body { padding: 18px; }

label.field { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

input[type=text], input[type=url], input[type=password] {
  width: 100%; background: #08090b; border: 1px solid var(--line2);
  color: var(--text); padding: 12px 14px; font-size: 15px; font-family: inherit;
}
input:focus { outline: none; border-color: var(--accent); }

/* ---------- login overlay ---------- */
.login-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-box {
  width: 340px; max-width: 90vw; background: var(--panel);
  border: 1px solid var(--line2); border-top: 3px solid var(--accent);
  padding: 28px 26px;
}
.login-box .btn { margin-top: 8px; }

.row { display: flex; gap: 12px; align-items: stretch; }
.row > * { flex: 1; }
.row .grow-2 { flex: 2; }

.btn {
  border: 1px solid var(--line2); background: #1b1d22; color: var(--text);
  padding: 12px 20px; font-size: 13px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; cursor: pointer; font-family: inherit; text-decoration: none;
}
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.block { width: 100%; }

/* file input as tegas button-bar */
.filebar { display: flex; align-items: center; gap: 0; border: 1px solid var(--line2); }
.filebar .file-btn {
  background: #1b1d22; padding: 12px 18px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; font-size: 13px; cursor: pointer; border-right: 1px solid var(--line2);
  white-space: nowrap;
}
.filebar .file-btn:hover { background: #24272e; }
.filebar .file-name { padding: 12px 16px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* mode toggle — segmented, square */
.seg { display: flex; border: 1px solid var(--line2); width: max-content; }
.seg button {
  background: transparent; color: var(--muted); border: 0; border-right: 1px solid var(--line2);
  padding: 10px 22px; font-size: 13px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; cursor: pointer; font-family: inherit;
}
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--accent); color: #fff; }

.status { font-size: 13px; letter-spacing: .04em; padding: 10px 14px; border-left: 3px solid var(--line2); background: #0e0f12; margin-top: 14px; }
.status.ok   { border-color: var(--ok);   color: var(--ok); }
.status.warn { border-color: var(--warn); color: var(--warn); }

.hint { color: var(--muted); font-size: 12px; margin-top: 10px; letter-spacing: .04em; }

/* participant count strip */
.count-strip { display: flex; gap: 10px; margin-top: 14px; }
.count-strip .cell { flex: 1; background: #0e0f12; border: 1px solid var(--line); padding: 14px; text-align: center; }
.count-strip .cell .n { font-size: 28px; font-weight: 900; }
.count-strip .cell .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-top: 4px; }

/* ---------- quick links (dashboard) ---------- */
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 16px; }
.quick-links .ql { display: block; text-decoration: none; background: #0e0f12; border: 1px solid var(--line); padding: 16px; }
.quick-links .ql:hover { border-color: var(--accent); }
.quick-links .ql-t { display: block; color: var(--text); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; }
.quick-links .ql-d { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
@media (max-width: 640px) { .quick-links { grid-template-columns: 1fr; } }

.bg-row { display: flex; gap: 10px; align-items: stretch; }
.bg-row .btn { white-space: nowrap; }
.bg-preview {
  margin-top: 16px; width: 100%; aspect-ratio: 16 / 9; max-height: 72vh; margin-inline: auto;
  border: 1px solid var(--line2);
  background-color: #000; background-position: center; background-repeat: no-repeat;
  background-size: cover; /* kotak sudah mengikuti rasio gambar (di-set via JS) -> pas tanpa bar */
}

/* ---------- loading overlay ---------- */
.loading-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(6,7,9,.72); backdrop-filter: blur(2px);
}
.loading-box { text-align: center; color: var(--text); }
.spinner {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50% !important;
  border: 4px solid rgba(255,255,255,.15); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loadingMsg { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- aksi baris tabel ---------- */
table.data td.act { white-space: nowrap; }
.act-btn {
  border: 0; color: #fff;
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: inherit; margin-right: 5px; vertical-align: middle;
}
.act-btn.edit { background: #e67e22; }
.act-btn.edit:hover { background: #f18c34; }
.act-btn.del { background: #d32f2f; }
.act-btn.del:hover { background: #e53935; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center;
  background: rgba(6,7,9,.7); padding: 20px;
}
.modal-box { width: 420px; max-width: 100%; background: var(--panel); border: 1px solid var(--line2); border-top: 3px solid var(--accent); padding: 22px 24px; }
.modal-head { font-size: 14px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* modal konfirmasi berhasil (mis. sesudah ganti password) */
.modal-box.ok-box { border-top-color: var(--ok); text-align: center; }
.ok-mark {
  width: 56px; height: 56px; margin: 4px auto 16px; display: block;
  border: 2px solid var(--ok); color: var(--ok); padding: 12px;
  animation: okpop .28s ease-out both;
}
.ok-title { font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ok); }
.ok-msg { margin-top: 10px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.ok-msg b { color: var(--text); }
.modal-box.ok-box .modal-actions { justify-content: center; }
@keyframes okpop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }

/* ---------- header halaman + aksi kanan ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-title { font-size: 18px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.page-actions .btn { height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; }
.ico { width: 16px; height: 16px; flex: none; display: block; }

/* varian warna tombol */
.btn.success { background: #157347; border-color: #157347; color: #fff; }
.btn.success:hover { background: #1a8a54; border-color: #1a8a54; }
.btn.info { background: #1e50a0; border-color: #1e50a0; color: #fff; }
.btn.info:hover { background: #2660bd; border-color: #2660bd; }
.btn.danger-solid { background: #c62828; border-color: #c62828; color: #fff; }
.btn.danger-solid:hover { background: #d83636; border-color: #d83636; }

/* ---------- data table (Peserta) — modern ---------- */
:root { --ctrl-h: 40px; }

.table-toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.table-toolbar .tb-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-toolbar .tb-right { margin-left: auto; }

/* semua kontrol toolbar tinggi seragam */
.table-toolbar .btn,
.table-toolbar .select.sm,
.table-toolbar .input.sm {
  height: var(--ctrl-h); display: inline-flex; align-items: center; padding: 0 14px;
}
.table-toolbar .select.sm { padding-right: 34px; }
.input, .select.sm, .input.sm { background: #0f1116; border: 1px solid var(--line2); color: #fff; font-family: inherit; }
.select.sm option { background: #14161b; color: #fff; }
.input.sm, .select.sm { font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; width: auto; }
.input.sm { min-width: 220px; }
.input:focus, .select.sm:focus { outline: none; border-color: var(--accent); }
.btn.sm { padding: 8px 12px; font-size: 13px; }
.btn.danger { background: transparent; border-color: #5a2230; color: #ff6b6b; }
.btn.danger:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* status ringkas (bukan blok besar) */
.status.mini { border: 0; background: transparent; padding: 0; color: var(--muted); font-size: 12.5px; letter-spacing: .02em; }
.status.mini.ok { color: var(--ok); }
.status.mini.warn { color: var(--warn); }

.table-wrap { border: 1px solid var(--line); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data thead th {
  position: sticky; top: 0; z-index: 1; text-align: left;
  background: #101216; color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 0 14px; height: 40px; border-bottom: 1px solid var(--line2);
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data th.sortable.sorted { color: var(--accent); }
.sort-ind { font-size: 10px; opacity: .45; }
table.data th.sortable.sorted .sort-ind { opacity: 1; }
table.data tbody td {
  padding: 0 14px; height: 40px; vertical-align: middle; white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,.05); color: var(--text);
}
table.data tbody tr:hover td { background: rgba(255,255,255,.028); }
table.data tbody tr.selected td { background: rgba(228,0,43,.08); }
table.data th:first-child, table.data td:first-child { padding-left: 16px; }
table.data th:last-child, table.data td:last-child { padding-right: 18px; }
table.data td.idx { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
table.data td.bib { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
table.data td.nama { white-space: normal; color: #e7e9ee; }
table.data td.jarak { color: var(--muted); font-weight: 600; }
table.data .empty { color: var(--muted); text-align: center; padding: 40px; height: auto; }

/* kolom checkbox */
table.data th.chk, table.data td.chk { width: 44px; padding-left: 16px; padding-right: 0; }
table.data input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px;
  border: 1.5px solid var(--line2); background: #0f1116; cursor: pointer; position: relative; vertical-align: middle;
}
table.data input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
table.data input[type=checkbox]:checked::after {
  content: ""; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
table.data input[type=checkbox]:indeterminate { background: var(--accent); border-color: var(--accent); }
table.data input[type=checkbox]:indeterminate::after {
  content: ""; position: absolute; left: 3px; top: 6.5px; width: 8px; height: 2px; background: #fff;
}

/* tag kategori berwarna (subtle di tema gelap) */
.kat-tag {
  display: inline-block; padding: 3px 9px; font-size: 10.5px; letter-spacing: .04em;
  text-transform: uppercase; font-weight: 800; border-radius: 4px !important;
  color: #0e1014;                              /* teks gelap di atas warna solid */
  background: var(--c, #8b93a7);
  border: 0;
}

/* baris footer ringkasan */
table.data tfoot .foot-row td {
  height: 42px; background: #101216; border-top: 1px solid var(--line2); border-bottom: 0;
  color: var(--muted); font-size: 12px; letter-spacing: .03em;
}
table.data tfoot #footCount { font-weight: 700; color: var(--text); }
table.data tfoot #footBreak { text-align: right; }

/* paging */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.pagination .pg-info { color: var(--muted); font-size: 13px; }
.pagination .pg-controls { display: flex; align-items: center; gap: 6px; }
.pagination .pg-lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-right: 2px; }
.pagination .pg-pages { color: var(--text); font-size: 13px; padding: 0 8px; min-width: 92px; text-align: center; }
.pagination .select.sm { height: 34px; min-width: 66px; padding: 0 8px; color: #fff; }
.pagination .btn.sm { min-width: 36px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; }
.btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- INPUT page ---------- */
body.input-page { min-height: 100vh; display: flex; flex-direction: column; }
.input-stage {
  flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center;
  max-width: 720px; width: 100%; margin: 0 auto; padding: 24px 24px 48px;
}
.bib-input {
  width: 100%; text-align: center; font-size: 64px; font-weight: 900;
  letter-spacing: .08em; padding: 24px 16px; background: #08090b;
  border: 2px solid var(--line2); color: var(--text); font-family: inherit;
}
.bib-input:focus { outline: none; border-color: var(--accent); }
.match-info { text-align: center; min-height: 22px; margin: 16px 0; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; }
.match-info.ok { color: var(--ok); }
.match-info.warn { color: var(--warn); }

.preview { border: 1px solid var(--line2); background: var(--panel); }
.preview .pv-bib { font-size: 72px; font-weight: 900; text-align: center; padding: 20px 10px 6px; line-height: 1; }
.preview .pv-nama { font-size: 24px; font-weight: 700; text-align: center; padding-bottom: 6px; }
.preview .pv-kat { text-align: center; padding-bottom: 20px; }
.preview .pv-kat span { display: inline-block; background: var(--accent); color: #fff; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; padding: 6px 14px; }
.preview .pv-kat span:empty { display: none; }

/* ---------- DISPLAY (MONITOR) ---------- */
.display { overflow: hidden; background: #000; }
.stage {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #000;
}
.idle { position: relative; z-index: 1; text-align: center; }
.idle-logo { font-size: 9vw; font-weight: 900; letter-spacing: .12em; color: #23262d; text-transform: uppercase; }
.idle-sub { font-size: 2vw; margin-top: 8px; color: var(--muted); letter-spacing: .3em; text-transform: uppercase; }
.idle-hint { font-size: 1vw; margin-top: 18px; color: #5a5f6b; letter-spacing: .16em; text-transform: uppercase; }

/*
  BOARD = "papan" template. Mengikuti rasio gambar (di-set via JS --ar).
  Zona teks (BIB/Nama/Kategori) diposisikan via JS (dari layout tersimpan).
*/
.board {
  position: relative;
  aspect-ratio: var(--ar, 1451 / 1080);
  width: min(100vw, calc(100vh * (var(--ar, 1.343))));
  height: auto; max-height: 100vh;
  background-color: transparent; background-position: center; background-repeat: no-repeat;
  background-size: 100% 100%;
  container-type: size;
  overflow: hidden;
}
.zone {
  position: absolute; display: flex; align-items: center; justify-content: center;
  color: #fff; line-height: .9; white-space: nowrap;
}
.d-bib { font-family: "Nasalization", "Montserrat", sans-serif; font-weight: 700; letter-spacing: .01em; }
.d-nama { font-family: "Montserrat", sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.d-jarak { font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }

@keyframes cut { from { opacity: 0; transform: translateY(1.5%); } to { opacity: 1; transform: none; } }
.board.pop .d-bib { animation: cut .18s steps(3, end); }

/* ---------- menu kotak berikon (admin) ---------- */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.menu-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  text-decoration: none; color: var(--text);
  background: #0e0f12; border: 1px solid var(--line); padding: 22px 20px; min-height: 128px;
}
.menu-card:hover { border-color: var(--accent); background: #12141a; }
.menu-card .mico { width: 30px; height: 30px; color: var(--accent); margin-bottom: 6px; }
.menu-card .mc-t { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 15px; }
.menu-card .mc-d { color: var(--muted); font-size: 12.5px; }

/* ---------- ringkasan per tipe (admin) ---------- */
.type-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 640px) { .type-counts { grid-template-columns: repeat(2, 1fr); } }
.type-counts .tc { background: #0e0f12; border: 1px solid var(--line); border-left: 4px solid var(--tc, var(--line2)); padding: 12px 14px; display: flex; align-items: baseline; gap: 10px; }
.type-counts .tc-n { font-size: 22px; font-weight: 900; min-width: 28px; color: var(--tc, var(--text)); }
.type-counts .tc-k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- pemilih tipe ---------- */
.select {
  width: 100%; background: #08090b; border: 1px solid var(--line2); color: var(--text);
  padding: 12px 38px 12px 14px; font-size: 15px; font-family: inherit; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.select:focus { outline: none; border-color: var(--accent); }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
@media (max-width: 640px) { .type-grid { grid-template-columns: repeat(2, 1fr); } }
.type-grid .tchip {
  background: #0e0f12; border: 1px solid var(--line); border-left: 4px solid var(--tc, var(--line2));
  padding: 10px 12px; cursor: pointer;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.type-grid .tchip:hover { border-color: var(--line2); }
.type-grid .tchip.active { border-color: var(--accent); color: #fff; }
.type-grid .tchip .dot { width: 9px; height: 9px; background: var(--warn); flex: none; }
.type-grid .tchip.ready .dot { background: var(--ok); }

/* ---------- toggle tampil/sembunyi zona ---------- */
.toggle-row { display: flex; gap: 2px; margin-top: 14px; flex-wrap: wrap; }
.toggle-btn {
  flex: 1; min-width: 120px; border: 1px solid var(--line2); background: #1b1d22; color: var(--muted);
  padding: 10px 14px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; font-family: inherit;
}
.toggle-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.toggle-btn:not(.on) { text-decoration: line-through; }

/* ---------- editor tata letak (di halaman Tampilan) ---------- */
.editor-board .zone.zone-off { opacity: .3; outline-style: dotted; }
.editor-board {
  position: relative; width: 100%; aspect-ratio: var(--ar, 1451 / 1080); max-height: 72vh;
  margin: 16px auto 0; border: 1px solid var(--line2);
  background-color: #000; background-position: center; background-repeat: no-repeat;
  background-size: 100% 100%; container-type: size; overflow: hidden; user-select: none;
  touch-action: none;
}
.editor-board .zone {
  cursor: move; outline: 2px dashed rgba(255,255,255,.7); outline-offset: -2px;
  background: rgba(228,0,43,.14);
}
.editor-board .zone .z-label {
  position: absolute; top: 2px; left: 4px; font-size: 12px; line-height: 1.2;
  background: var(--accent); color: #fff; padding: 1px 6px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.editor-board .z-handle {
  position: absolute; right: -1px; bottom: -1px; width: 18px; height: 18px;
  background: var(--accent); cursor: nwse-resize; border: 2px solid #fff;
}
.editor-hint { color: var(--muted); font-size: 12px; margin-top: 10px; }

/* ========================================================================
   RESPONSIF — tablet & mobile
   ======================================================================== */

/* Tablet ke bawah */
@media (max-width: 860px) {
  .wrap { padding: 18px 16px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 10px 14px; }
  .brand-logo { height: 26px; }
  /* nav jadi satu baris yang bisa digeser horizontal, tak meluber */
  .nav {
    order: 3; width: 100%; gap: 18px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 4px; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }

  .page-head { align-items: flex-start; }
  .page-actions { width: 100%; margin-left: 0; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }

  .table-toolbar .tb-group { width: 100%; }
  .table-toolbar .tb-right { margin-left: 0; }
  .table-toolbar .input.sm { flex: 1 1 100%; min-width: 0; }
  .table-toolbar .select.sm { flex: 1 1 45%; }

  .section > .body { padding: 16px; }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-box { width: 100%; }
}

/* Ponsel */
@media (max-width: 520px) {
  .wrap { padding: 14px 12px; }
  .topbar { padding: 10px 12px; }
  .nav { gap: 14px; }
  .nav a { font-size: 11px; letter-spacing: .1em; }
  .page-title { font-size: 16px; }

  h1 { font-size: clamp(24px, 8vw, 34px); }

  /* grid kartu jadi 1 kolom */
  .home-grid, .menu-grid, .type-grid, .type-counts, .quick-links { grid-template-columns: 1fr; }

  /* aksi tabel: tombol boleh turun, teksnya jangan kepotong */
  .page-actions .btn { font-size: 12px; padding: 0 12px; height: 42px; }
  .table-toolbar .select.sm { flex: 1 1 100%; }

  /* tabel: sel lebih rapat + tetap bisa digeser (table-wrap sudah overflow-x) */
  table.data th, table.data td { padding: 0 10px; }
  table.data { font-size: 13px; }

  /* paging tetap rapi */
  .pagination { gap: 8px; }
  .pagination .pg-info { width: 100%; }
  .pagination .pg-controls { flex-wrap: wrap; justify-content: flex-start; }

  /* halaman Input: kotak BIB proporsional layar kecil */
  .bib-input { font-size: 12vw; padding: 16px 10px; letter-spacing: .06em; }
  .input-stage { padding: 18px 14px 40px; }
  .preview .pv-bib { font-size: 16vw; }
  .preview .pv-nama { font-size: 6vw; }

  /* editor tata letak: papan penuh lebar, kontrol menumpuk */
  .toggle-row .toggle-btn { min-width: 0; flex: 1 1 30%; padding: 10px 6px; font-size: 11px; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 10px 8px; }

  /* login & modal muat layar kecil */
  .login-box { padding: 22px 18px; }

  /* form ganti kredensial: tombol simpan turun ke bawah input */
  .row { flex-wrap: wrap; }
  .row .grow-2 { flex: 1 1 100%; }
  .bg-row { flex-wrap: wrap; }
  .bg-row > * { flex: 1 1 100%; }
}
