:root {
  --bg: #EEF0F4;
  --surface: #FFFFFF;
  --ink: #15173A;
  --ink-2: #3E4263;
  --muted: #5C6080;
  --line: #DADDE7;
  --night: #15123D;
  --cobalt: #2B45E0;
  --gold: #FFC53D;
  --android: #17804A;
  --android-bg: #E2F4E9;
  --web: #2B45E0;
  --web-bg: #E7EBFF;
  --danger: #B8322A;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px;
  padding: 11px 18px;
  font: inherit; font-size: 15px; font-weight: 650;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #FFD46B; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #2A2E62; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: transparent; color: var(--danger); border-color: #F0CFCB; }
.btn-danger:hover { background: #FDF0EE; }

.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font-weight: 750; font-size: 18px; letter-spacing: -.015em; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; }

/* ---------------- Header ---------------- */
.hero { background: var(--night); color: #fff; }
.hero-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.hero-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hero-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .2); }
.hero h1 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin: 0; color: #C9CAE6; white-space: nowrap; }
.hero-meta { font-size: 13px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, .1); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }

/* ---------------- Toolbar ---------------- */
.toolbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(238, 240, 244, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.toolbar .wrap { display: flex; align-items: center; gap: 14px; padding-top: 14px; padding-bottom: 14px; }
.pills { display: flex; gap: 8px; overflow-x: auto; flex: 1 1 auto; min-width: 0; scrollbar-width: none; padding: 2px; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 8px 15px;
  font: inherit; font-size: 14px; font-weight: 650; white-space: nowrap; cursor: pointer;
}
.pill:hover { border-color: #B4B9D0; }
.pill span { color: var(--muted); font-weight: 500; margin-left: 5px; }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill[aria-pressed="true"] span { color: #A9ABD3; }

.search { position: relative; flex: none; }
.search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 260px; padding-left: 38px; }

/* ---------------- Listing ---------------- */
.listing { padding-top: 32px; padding-bottom: 88px; }
.group { margin-bottom: 56px; }
.group-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.group-head h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.025em; font-weight: 750; margin: 0; }
.group-head span { color: var(--muted); font-size: 15px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; align-items: stretch; }
.app {
  position: relative;
  display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 16px;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; color: var(--ink);
  transition: border-color .15s;
}
.app:hover { border-color: #9EA3C2; }
.app:focus-within { border-color: var(--cobalt); }
.app:hover .open { text-decoration: underline; text-underline-offset: 3px; }
.app-icon {
  width: 64px; height: 64px; border-radius: 15px; overflow: hidden;
  background: #fff; box-shadow: inset 0 0 0 1px rgba(21, 23, 58, .1);
  display: grid; place-items: center;
}
.app-icon img { width: 100%; height: 100%; object-fit: contain; }
.app-body { align-self: center; min-width: 0; }
.app-name { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; }
.app-link { color: inherit; text-decoration: none; }
.app-link:focus-visible { outline: none; }
.app-link::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
.app-dev { display: block; font-size: 14px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.app-desc {
  align-self: start;
  grid-column: 1 / -1; margin: 14px 0 0;
  font-size: 14.5px; color: var(--ink-2); line-height: 1.55;
  overflow-wrap: anywhere;
}
.app-foot {
  align-self: end;
  grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid #ECEEF3;
}
.app-date { font-size: 13px; color: var(--muted); }
.app-actions { display: flex; align-items: center; gap: 14px; }
.edit-btn {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 650;
  padding: 4px 10px; border-radius: 8px; cursor: pointer;
}
.edit-btn:hover { border-color: var(--ink); }
.edit-btn[aria-disabled="true"],
.edit-btn[aria-disabled="true"]:hover { color: #A3A7C0; background: #F5F6F9; border-color: #E6E8EF; cursor: not-allowed; }
.edit-btn svg { width: 14px; height: 14px; }
.open { font-size: 14px; font-weight: 700; color: var(--cobalt); }

.notice { margin-top: 16px; background: #FFF6DB; color: #6B4A00; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.notice.err { background: #FDECEA; color: #9E271E; }
.link-btn { border: 0; background: none; padding: 0; margin-left: 6px; font: inherit; font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.done-text { font-size: 14.5px; color: var(--ink-2); margin: 12px 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { font-size: 13px; }

.empty { text-align: center; padding: 72px 16px; }
.empty h2 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 8px; }
.empty p { color: var(--muted); margin: 0 auto 20px; max-width: 40ch; }

.site-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 24px; padding-bottom: 28px; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }
.site-foot .credit { font-size: 11px; opacity: .7; margin-left: 4px; letter-spacing: .01em; }

/* ---------------- Forms / modal ---------------- */
.input {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  padding: 11px 13px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
}
.input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(43, 69, 224, .16); }
textarea.input { resize: vertical; min-height: 88px; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

dialog.modal {
  border: 0; padding: 0; border-radius: 24px;
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  color: var(--ink); background: #fff;
  box-shadow: 0 30px 80px rgba(10, 8, 40, .35);
}
dialog.modal[open] { animation: rise .22s ease-out; }
dialog.modal::backdrop { background: rgba(21, 18, 61, .58); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 24px 0; }
.modal-head h3 { margin: 0; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.x { flex: none; border: 0; background: var(--bg); color: var(--ink); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.x:hover { background: #E1E4EC; }
.x svg { width: 18px; height: 18px; }
.modal-body { padding: 20px 24px 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 8px 24px 24px; }
.modal-foot .spacer { flex: 1; }

.field { margin-bottom: 16px; }
.field > label:not(.logo-pick), .field-label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 6px; }
.field small { color: var(--muted); font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

.logo-pick {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 12px; cursor: pointer;
  border: 1.5px dashed #C3C7D8; border-radius: 14px;
}
.logo-pick:hover, .logo-pick:focus-within { border-color: var(--cobalt); }
.logo-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.logo-wrap { position: relative; }
.logo-wrap .logo-pick { padding-right: 104px; }
.logo-pick.is-drag { border-color: var(--cobalt); background: #F4F6FF; }
.paste-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 650;
  padding: 7px 11px; border-radius: 9px; cursor: pointer;
}
.paste-btn:hover { border-color: var(--ink); }
.paste-btn svg { width: 15px; height: 15px; }
.logo-prev { flex: none; width: 64px; height: 64px; border-radius: 15px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: #A0A4BE; display: grid; place-items: center; }
.logo-prev svg { width: 26px; height: 26px; }
.logo-prev img { width: 100%; height: 100%; object-fit: contain; }
.logo-text strong { display: block; font-size: 15px; }
.logo-text span { font-size: 13px; color: var(--muted); }

.check { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--cobalt); }

.form-msg { font-size: 14px; border-radius: 10px; padding: 10px 12px; margin: 4px 0 8px; }
.form-msg.err { background: #FDECEA; color: #9E271E; }
.form-msg.ok { background: var(--android-bg); color: #10613A; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------- Admin ---------------- */
.admin-top { background: var(--night); color: #fff; }
.admin-top .wrap { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; padding-bottom: 14px; }
.brand-sub { font-weight: 500; color: #9C9ECB; margin-left: 2px; }
.admin-top nav { display: flex; gap: 4px; }
.admin-top nav a { color: #C9CAE6; text-decoration: none; font-size: 14px; font-weight: 650; padding: 8px 12px; border-radius: 10px; }
.admin-top nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.admin-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; padding-top: 32px; padding-bottom: 88px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px; position: sticky; top: 20px; }
.panel h2, .board-head h1 { font-size: 20px; letter-spacing: -.02em; margin: 0 0 4px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; max-width: 60ch; }

.cat-list { list-style: none; margin: 0 0 14px; padding: 0; }
.cat-item { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; background: #fff; }
.cat-item:hover { background: var(--bg); }
.cat-item input { flex: 1; min-width: 0; font: inherit; font-weight: 650; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; }
.cat-item input:hover { border-color: var(--line); background: #fff; }
.cat-item input:focus { outline: none; border-color: var(--cobalt); background: #fff; }
.cat-count { font-size: 13px; color: var(--muted); min-width: 20px; text-align: right; }
.none-note { color: var(--muted); font-size: 14px; padding: 8px 4px; }
.add-cat { display: flex; gap: 8px; }
.add-cat .input { padding: 9px 12px; }
.add-cat .btn { padding: 9px 14px; }

.handle { flex: none; width: 24px; height: 34px; display: grid; place-items: center; color: #A3A7C0; cursor: grab; touch-action: none; }
.handle svg { width: 18px; height: 18px; }
.icon-btn { flex: none; border: 0; background: none; color: var(--muted); width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.icon-btn.danger:hover { color: var(--danger); }

.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.status { font-size: 14px; color: var(--muted); white-space: nowrap; padding-top: 4px; }
.status.err { color: var(--danger); white-space: normal; }

.bucket { background: #fff; border: 1px solid var(--line); border-radius: 20px; margin-bottom: 16px; }
.bucket.inbox { background: #F7F8FB; border-style: dashed; border-color: #C9CDDC; }
.bucket-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 18px 10px; font-weight: 750; font-size: 16px; }
.bucket-head span { color: var(--muted); font-weight: 500; font-size: 14px; }
.app-list { list-style: none; margin: 0; padding: 0 8px 8px; min-height: 52px; }
.app-list:empty::after { content: "Seret app ke sini"; display: block; text-align: center; color: #A3A7C0; font-size: 14px; padding: 14px; }
.row { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 4px; border-radius: 12px; background: inherit; }
.row:hover { background: var(--bg); }
.bucket.inbox .row:hover { background: #fff; }
.row-img { flex: none; width: 42px; height: 42px; border-radius: 11px; object-fit: contain; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.row-main { flex: 1; min-width: 0; }
.row-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-dev { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.is-hidden .row-img, .row.is-hidden .row-main { opacity: .45; }
.tag-hidden { flex: none; font-size: 12px; font-weight: 650; color: #7A5200; background: #FFF2CC; padding: 3px 8px; border-radius: 6px; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { background: #fff; box-shadow: 0 10px 28px rgba(21, 23, 58, .14); }

.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--night); }
.login-card { width: min(400px, 100%); background: #fff; border-radius: 24px; padding: 32px; }
.login-card .brand { color: var(--ink); margin-bottom: 24px; }
.login-card h1 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; }
.cred { background: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 18px 0 20px; line-height: 1.7; }
.cred code { font-family: inherit; font-weight: 700; color: var(--ink); }
.login-card .btn { width: 100%; margin-top: 4px; }
.back-link { display: block; text-align: center; margin-top: 16px; color: var(--muted); font-size: 14px; text-decoration: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .toolbar .wrap { flex-wrap: wrap; }
  .pills { flex-basis: 100%; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .admin-grid { grid-template-columns: 1fr; }
  .panel { position: static; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .grid { grid-template-columns: 1fr; }
  .group-head h2 { font-size: 23px; }
  .hero-bar .btn { padding: 9px 13px; }
  .hero-sep, .hero-meta, .hero h1 { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .site-foot .wrap { flex-direction: column; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.modal[open] { animation: none; }
}

.row-date { margin-left: 8px; color: #8A8EAB; }
