/* app.css — token desain, dasar, dan komponen bersama (publik + admin) */
:root {
  --ink: #0f1c2e;
  --ink-2: #1b2b42;
  --text: #223048;
  --muted: #566277;
  --paper: #f3f5f8;
  --surface: #ffffff;
  --line: #dce1e8;
  --line-soft: #e9edf2;
  --brand: #1d44b8;
  --brand-600: #183a9c;
  --brand-50: #e9eefb;
  --stamp: #c2301d;
  --ok: #0f7a57;      --ok-50: #e3f4ee;
  --warn: #8f5405;    --warn-50: #fbf0dc;
  --bad: #b42318;     --bad-50: #fdecea;
  --neutral-50: #eceff3;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --shadow-pop: 0 12px 32px -12px rgba(15, 28, 46, .28);
  --focus: 0 0 0 3px rgba(29, 68, 184, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { left: 8px; }
.ikon { flex: none; vertical-align: -.2em; }
.num { font-variant-numeric: tabular-nums; }
.isbn { font-family: var(--serif); font-variant-numeric: lining-nums tabular-nums; letter-spacing: .01em; white-space: nowrap; }
.isbn .cd { color: var(--stamp); }
.muted { color: var(--muted); }

/* ---------- Merek ---------- */
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; flex: none; display: grid; place-items: center; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-name { font: 600 1.35rem/1 var(--serif); letter-spacing: -.01em; }
.brand-name small { display: block; font: 500 .72rem/1.3 var(--sans); color: var(--muted); letter-spacing: 0; margin-top: .2rem; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 .95rem/1 var(--sans); padding: .8rem 1.25rem; min-height: 44px;
  border-radius: var(--r-md); border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #8f1c12; color: #fff; }
.btn-sm { padding: .5rem .8rem; min-height: 36px; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Formulir ---------- */
.field { margin-bottom: 1.1rem; }
.field label, .label { display: block; font-weight: 600; font-size: .875rem; color: var(--ink); margin-bottom: .35rem; }
.field .hint { display: block; font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.req { color: var(--stamp); margin-left: .15rem; }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #c5ccd7; border-radius: var(--r-md); padding: .7rem .85rem; min-height: 44px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: #8d98aa; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input[readonly] { background: var(--neutral-50); color: var(--muted); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; }
.check input { margin-top: .3rem; width: 18px; height: 18px; accent-color: var(--brand); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* ---------- Notifikasi & lencana ---------- */
.alert { padding: .85rem 1rem; border-radius: var(--r-md); border: 1px solid; margin-bottom: 1.25rem; font-size: .92rem; }
.alert-sukses { background: var(--ok-50); border-color: #a9dcc8; color: #09553d; }
.alert-galat  { background: var(--bad-50); border-color: #f3b9b3; color: #8b1a10; }
.alert-info   { background: var(--brand-50); border-color: #bccaf1; color: #142f80; }
.alert ul { margin: .4rem 0 0 1.1rem; padding: 0; }

.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; padding: .22rem .6rem; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-terbit { background: var(--ok-50); color: var(--ok); }
.badge-menunggu { background: var(--warn-50); color: var(--warn); }
.badge-ditolak { background: var(--bad-50); color: var(--bad); }
.badge-dibatalkan { background: var(--neutral-50); color: var(--muted); }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; }
table.tabel { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabel th { text-align: left; font-weight: 600; font-size: .8rem; color: var(--muted); padding: .7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; }
.tabel td { padding: .85rem 1rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tabel tbody tr:hover { background: #fafbfd; }
.tabel .judul { font-weight: 600; color: var(--ink); display: block; }
.tabel .sub { color: var(--muted); font-size: .85rem; }
.tabel .kanan { text-align: right; white-space: nowrap; }
.kosong { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.kosong strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: .25rem; }

.paginasi { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0 0; font-size: .9rem; }
.paginasi a, .paginasi .nonaktif { padding: .45rem .9rem; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; background: #fff; }
.paginasi .nonaktif { color: #98a2b3; background: transparent; }
.paginasi a:hover { border-color: var(--ink); }
.paginasi .info { color: var(--muted); }

/* ---------- Tombol salin ---------- */
.salin { background: none; border: 0; padding: .2rem; color: var(--muted); cursor: pointer; border-radius: var(--r-sm); }
.salin:hover { color: var(--brand); }

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

