:root {
  --brand: #0b5cad;
  --brand-dark: #08457f;
  --brand-soft: #eef4fb;
  --accent: #f5b301;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5d6b7c;
  --border: #dbe1e8;
  --ok: #1a8f4c;
  --warn: #b7791f;
  --err: #c53030;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.45; color: var(--text); background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--brand); }
[hidden] { display: none !important; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--brand); color: #fff; box-shadow: var(--shadow);
}
.topbar .brand { font-weight: 700; display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.logo {
  width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--brand-dark);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: 0 0 auto;
}
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 14px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }
.topbar a, .topbar button.link { color: #fff; font-size: 14px; }
.topbar.admin { background: #1b2430; }

/* ---------- Toggle bahasa ---------- */
.lang-toggle { display: inline-flex; border: 1px solid currentColor; border-radius: 8px; overflow: hidden; font-size: 13px; }
.lang-toggle button {
  font: inherit; font-weight: 700; background: transparent; color: inherit; border: 0; padding: 4px 9px; cursor: pointer; opacity: .75;
}
.lang-toggle button.active { background: rgba(255,255,255,.22); opacity: 1; }
.on-light.lang-toggle button.active, .landing-head .lang-toggle button.active, .login-top .lang-toggle button.active { background: var(--brand); color: #fff; }

/* ---------- Layout ---------- */
.container { max-width: 960px; margin: 0 auto; padding: 16px; }
.container.wide { max-width: 1200px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1; }

/* ---------- Form ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=number], input[type=tel], select, textarea {
  width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
label.check input { width: 20px; height: 20px; accent-color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600;
  padding: 11px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  background: var(--brand); color: #fff; min-height: 44px;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.danger { background: var(--err); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: #f1f4f8; }
.btn.small { padding: 6px 10px; min-height: 34px; font-size: 14px; }
.btn.block { width: 100%; }
button.link { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; color: var(--brand); }

.alert { padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 10px 0; }
.alert.err { background: #fdecec; color: var(--err); border: 1px solid #f5c2c2; }
.alert.ok { background: #e8f6ee; color: var(--ok); border: 1px solid #bfe5cf; }
.alert.warn { background: #fdf5e6; color: var(--warn); border: 1px solid #f1dbb0; }
.alert.info { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #cfe0f3; }

/* ---------- Landing ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.landing-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; max-width: 1000px; width: 100%; margin: 0 auto; }
.landing-head .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--brand-dark); }
.landing-head .logo { width: 36px; height: 36px; font-size: 15px; background: var(--brand); color: var(--accent); border-radius: 9px; }
.landing-head .lang-toggle { color: var(--brand); }
.hero { text-align: center; padding: 28px 16px 8px; max-width: 720px; margin: 0 auto; }
.hero h1 { font-size: 28px; color: var(--brand-dark); }
.hero p { color: var(--muted); margin: 8px 0 0; }
.choices { display: grid; gap: 14px; padding: 24px 16px; max-width: 1000px; width: 100%; margin: 0 auto; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.choice {
  display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.choice:hover { border-color: var(--brand); transform: translateY(-2px); }
.choice .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: var(--brand-soft); margin-bottom: 6px; }
.choice.worker .ico { background: #fdf5e6; }
.choice.admin .ico { background: #eceff3; }
.choice .ttl { font-weight: 800; font-size: 18px; }
.choice .desc { color: var(--muted); font-size: 14px; }
.choice .go { margin-top: auto; padding-top: 10px; font-weight: 700; color: var(--brand); font-size: 14px; }
.landing-foot { margin-top: auto; text-align: center; padding: 20px 16px; color: var(--muted); font-size: 13px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .head { text-align: center; margin-bottom: 8px; }
.login-card .head .logo { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 14px; background: var(--brand); color: var(--accent); font-size: 20px; }
.login-card .head h1 { font-size: 20px; }
.login-card.admin .head .logo { background: #1b2430; }
.login-card .foot { text-align: center; margin-top: 14px; font-size: 14px; }
.login-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.login-top a { font-size: 14px; text-decoration: none; }
.login-top .lang-toggle { color: var(--brand); }

/* ---------- Badge & progres ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.badge.ok { background: #e8f6ee; color: var(--ok); }
.badge.info { background: #e7eefb; color: var(--brand); }
.badge.warn { background: #fdf5e6; color: var(--warn); }
.badge.err { background: #fdecec; color: var(--err); }
.pbar-wrap { display: flex; align-items: center; gap: 10px; }
.pbar { flex: 1; min-width: 80px; height: 8px; border-radius: 99px; background: #e5e9ef; overflow: hidden; display: flex; }
.pbar-ok { background: var(--ok); height: 100%; }
.pbar-part { background: #f0c466; height: 100%; }
.pbar-text { font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.big-pct { font-size: 34px; font-weight: 800; color: var(--brand-dark); line-height: 1; }

/* ---------- Daftar ---------- */
.list { display: grid; gap: 10px; }
.list.cols { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.list-card {
  display: block; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
a.list-card:hover { border-color: #b9c6d6; }
.list-card .title { font-weight: 700; }
.list-card .sub { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.crumbs a { color: var(--brand); text-decoration: none; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 20px 0 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.desc-text { white-space: pre-wrap; margin: 10px 0 0; }
.summary { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .summary { grid-template-columns: 2fr 1fr; } }

/* ---------- Item checklist ---------- */
.item-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.item-card.st-done { border-left: 4px solid var(--ok); }
.item-card.st-partial { border-left: 4px solid #f0c466; }
.item-card .head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.item-card .title { font-weight: 700; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0 0; padding-bottom: 2px; }
.thumbs button { padding: 0; border: 0; background: none; cursor: pointer; flex: 0 0 auto; border-radius: 8px; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; background: #e5e9ef; }

/* ---------- Galeri ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer;
  text-align: left; padding: 0; font: inherit; color: inherit; display: block; width: 100%;
}
.tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e5e9ef; }
.tile .body { padding: 8px; font-size: 13px; }
.tile .desc { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.empty { text-align: center; padding: 24px; color: var(--muted); }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(1000px, calc(100vw - 24px)); max-height: calc(100vh - 24px); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10, 15, 25, .65); }
.dlg-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 1; }
.dlg-head h3 { margin: 0; font-size: 16px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-body { padding: 16px; display: grid; gap: 16px; }
@media (min-width: 820px) { .dlg-body { grid-template-columns: 3fr 2fr; } }
.dlg-body .img-wrap { background: #111; border-radius: 8px; display: grid; place-items: center; min-height: 200px; }
.dlg-body .img-wrap img { max-height: 72vh; width: auto; margin: 0 auto; }
.dlg-pad { padding: 4px 16px 16px; }
.form-dlg { width: min(560px, calc(100vw - 24px)); }
.icon-btn { font: inherit; font-size: 13px; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; color: var(--text); text-decoration: none; display: inline-block; }
.icon-btn:hover { background: #f1f4f8; }
.icon-btn.danger { color: var(--err); }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a {
  font-weight: 600; padding: 10px 14px; color: var(--muted); border-bottom: 3px solid transparent; text-decoration: none; white-space: nowrap;
}
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.stat .n { font-size: 22px; font-weight: 700; }
.stat .l { font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.filters label { margin-top: 0; }
.tree { margin: 0; padding: 0; list-style: none; }
.tree ul { list-style: none; margin: 0; padding-left: 22px; border-left: 1px dashed var(--border); }
.tree li { margin: 4px 0; }
.tree .node { display: flex; align-items: center; gap: 8px; padding: 4px 0; flex-wrap: wrap; }
.tree .node.loc > .name { font-weight: 700; }
.tree .node.off > .name { text-decoration: line-through; color: var(--muted); }
.tree .counts { color: var(--muted); font-size: 12px; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: #f1f4f8; padding: 8px; border-radius: 8px; word-break: break-all; display: block; }
.preview-bar { background: #fdf5e6; color: var(--warn); border-bottom: 1px solid #f1dbb0; padding: 8px 16px; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; background: #1b2430; color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: calc(100vw - 32px);
}
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); min-width: 200px; padding: 6px; z-index: 20; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; color: var(--text) !important; text-decoration: none; background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: #f1f4f8; }
.menu-pop .sep { border-top: 1px solid var(--border); margin: 6px 0; }
.menu-btn { background: rgba(255,255,255,.15); border: 0; color: #fff; font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 8px; cursor: pointer; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 560px) {
  .topbar { gap: 8px; padding: 10px 12px; }
  .topbar .brand span.name { display: none; }
  .hero h1 { font-size: 24px; }
}
