/* Warna mengikuti website induk acityabinaindonesia.co.id */
:root {
  --bg: #f3f7f4;
  --card: #fff;
  --text: #1c2a21;
  --muted: #66746b;
  --line: #dfe8e2;
  --primary: #2c583b;
  --primary-dark: #1f4229;
  --primary-soft: #e8f7ed;
  --brand-dark: #17381f;
  --brand-lime: #8bba34;
  --ok: #15803d;
  --ok-soft: #e3f6ea;
  --warn: #b45309;
  --warn-soft: #fff4e0;
  --err: #b91c1c;
  --err-soft: #fde8e8;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 Lato, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  background: #fff; color: var(--text); padding: .55rem 1.25rem;
  border-bottom: 3px solid var(--primary); box-shadow: 0 2px 10px rgba(23, 56, 31, .06);
}
.topbar .brand { display: flex; align-items: center; gap: .9rem; color: var(--brand-dark); text-decoration: none; }
.topbar .brand img { height: 46px; width: auto; display: block; }
.topbar .brand .app { border-left: 1px solid var(--line); padding-left: .9rem; font-weight: 700; line-height: 1.25; font-size: .95rem; }
.topbar .brand .app small { display: block; font-weight: 400; font-size: .75rem; color: var(--muted); }
.topbar nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.topbar nav a { color: var(--primary); text-decoration: none; font-weight: 700; font-size: .92rem; padding: .25rem 0; }
.topbar nav a:hover { color: var(--brand-dark); }
.topbar nav a.on { box-shadow: inset 0 -3px 0 var(--brand-lime); }
@media (max-width: 560px) {
  .topbar .brand img { height: 36px; }
  .topbar .brand .app { display: none; }
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 1.25rem 16px 3rem; }
.wrap-wide { max-width: none; padding: 1rem 16px 2rem; }
.is-public .wrap { max-width: 640px; padding-top: 2rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem;
}
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.alert { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-err { background: var(--err-soft); color: var(--err); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }

.btn {
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: .5rem .9rem; border-radius: 8px; font: inherit; font-size: .9rem; text-decoration: none;
}
.btn:hover { border-color: #c4cad6; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--err); }
.btn-sm { padding: .25rem .55rem; font-size: .8rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.form { display: grid; gap: .8rem; }
.form label, .field { display: grid; gap: .25rem; font-weight: 600; font-size: .88rem; }
.form .hint, .field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea {
  font: inherit; font-weight: 400; padding: .5rem .65rem; border: 1px solid #cdd3de; border-radius: 7px;
  background: #fff; color: var(--text); width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: flex !important; align-items: center; gap: .4rem; font-weight: 400 !important; }
.inline-form { display: flex; gap: .5rem; margin-top: 1rem; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfd; }
tr:hover td { background: #fbfcff; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-muted { background: #eef1f6; color: var(--muted); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

/* Rekap kehadiran */
.rekap th.day, .rekap td.day { text-align: center; padding: .3rem; min-width: 52px; }
.att {
  width: 46px; padding: .2rem; text-align: center; font-weight: 700; border-radius: 6px; cursor: pointer;
  appearance: none; -webkit-appearance: none; text-align-last: center;
}
.att.s-H { background: var(--ok-soft); color: var(--ok); border-color: #9fd9b4; }
.att.s-I { background: var(--warn-soft); color: var(--warn); border-color: #f2c98b; }
.att.s- { background: #f5f6f8; color: #9aa1ae; }
.legend { display: flex; gap: 1rem; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }

/* QR absensi */
.qr-box { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.qr-box .qr { width: 150px; height: 150px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.qr-box .qr svg, .qr-box .qr img { width: 100%; height: 100%; display: block; }
.copy-url { display: flex; gap: .4rem; max-width: 520px; }
.qr-full { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem 16px; background: #fff; }
.qr-full .qr { width: min(70vh, 90vw); }
.qr-full .qr svg { width: 100%; height: auto; display: block; }

/* Verifikasi */
.verify-status { display: flex; align-items: center; gap: .75rem; padding: 1rem; border-radius: 10px; margin-bottom: 1rem; }
.verify-status .icon { font-size: 2rem; line-height: 1; }
.verify-ok { background: var(--ok-soft); color: var(--ok); }
.verify-bad { background: var(--err-soft); color: var(--err); }
dl.info { display: grid; grid-template-columns: 150px 1fr; gap: .45rem 1rem; margin: 0; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; font-weight: 600; }
@media (max-width: 520px) { dl.info { grid-template-columns: 1fr; } dl.info dd { margin-bottom: .4rem; } }

/* Editor template */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
@media (max-width: 960px) { .editor { grid-template-columns: 1fr; } }
.stage { background: #d9dee8; border-radius: var(--radius); padding: 16px; }
.stage canvas { width: 100%; display: block; box-shadow: 0 4px 18px rgba(0, 0, 0, .18); background: #fff; cursor: default; touch-action: none; }
.panel { position: sticky; top: 1rem; display: grid; gap: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
.panel .card { margin: 0; padding: 1rem; }
.el-list { display: grid; gap: 4px; max-height: 220px; overflow: auto; }
.el-item {
  display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .55rem; border: 1px solid var(--line);
  border-radius: 6px; cursor: pointer; font-size: .85rem; background: #fff; text-align: left;
}
.el-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-item.active { border-color: var(--primary); background: var(--primary-soft); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tags button { font-size: .75rem; padding: 2px 6px; border: 1px dashed #b3bccd; border-radius: 5px; background: #fff; cursor: pointer; font-family: ui-monospace, monospace; }
.tags button:hover { border-color: var(--primary); color: var(--primary); }
.seg { display: flex; }
.seg button { flex: 1; border: 1px solid #cdd3de; background: #fff; padding: .35rem; cursor: pointer; font: inherit; font-size: .85rem; }
.seg button + button { border-left: 0; }
.seg button:first-child { border-radius: 7px 0 0 7px; }
.seg button:last-child { border-radius: 0 7px 7px 0; }
.seg button.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Generate */
.progress { height: 10px; background: #e6e9f0; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--primary); transition: width .15s; }
.thumb { width: 100%; max-width: 640px; border: 1px solid var(--line); border-radius: 6px; display: block; }

@media print { .topbar, .no-print { display: none !important; } }
