:root {
  color-scheme: light dark;
  --bg: #f8fafc;
  --surface: #fff;
  --ink: #101828;
  --muted: #475569;
  --line: #e2e8f0;
  --control: #64748b;
  --accent: #2444d8;
  --on-accent: #fff;
  --selected: #e8eeff;
  --danger: #b91c1c;
  --on-danger: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b111c;
    --surface: #141d2b;
    --ink: #f1f5f9;
    --muted: #a8b6c8;
    --line: #2c394a;
    --control: #8492a6;
    --accent: #83aaff;
    --on-accent: #101a35;
    --selected: #1e305c;
    --danger: #fca5a5;
    --on-danger: #23090b;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.55 system-ui, sans-serif; }
a { color: var(--accent); text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p, dl { margin: 0; }
h1 { font-size: clamp(1.75rem, 1.375rem + 1vw, 2.375rem); line-height: 1.15; letter-spacing: -.025em; margin-bottom: 1.5rem; overflow-wrap: anywhere; }
h2 { font-size: 1.125rem; margin-bottom: .75rem; }
p + p { margin-top: .5rem; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .625rem 1rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
button:active, .button:active { opacity: .84; }
button.quiet { min-height: 2.5rem; background: transparent; color: var(--accent); border-color: var(--line); }
button.danger { color: var(--on-danger); background: var(--danger); }
input, select, textarea {
  min-width: 0;
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--control);
  border-radius: .5rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: .625rem .75rem;
}
textarea { resize: vertical; }
label { display: block; font-weight: 600; }
.brand { display: inline-block; color: var(--ink); text-decoration: none; font-size: 1.25rem; font-weight: 750; letter-spacing: -.025em; }
.brand span { margin-inline-start: .25rem; color: var(--muted); font-size: .875rem; font-weight: 500; letter-spacing: 0; }
.skip { position: fixed; top: .5rem; left: .5rem; padding: .5rem 1rem; z-index: 1; background: var(--surface); }
.skip:not(:focus) { clip-path: inset(50%); }
.auth-page { min-height: 100svh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: min(100%, 25rem); padding: clamp(1.25rem, 6vw, 2rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.auth-card .brand { margin-bottom: 1.5rem; }
.auth-card h1 { font-size: 1.625rem; }
.auth-card details, .auth-card > p { margin-top: 1rem; }
.form-stack { display: grid; gap: .5rem; }
.form-stack label:not(:first-of-type), .form-stack button { margin-top: .5rem; }
.hint { font-size: .875rem; color: var(--muted); }
.console { min-height: 100vh; display: grid; grid-template-columns: 15rem minmax(0,1fr); }
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; padding: 1.5rem 1rem; background: var(--surface); border-inline-end: 1px solid var(--line); }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.sidebar-content { display: flex; flex: 1; flex-direction: column; gap: 1rem; }
.sidebar nav { display: grid; gap: .25rem; }
.sidebar nav a { color: var(--muted); padding: .625rem .75rem; border: 1px solid transparent; border-inline-start-width: 3px; border-radius: .5rem; text-decoration: none; }
.sidebar nav [aria-current] { color: var(--ink); border-inline-start-color: var(--accent); background: var(--selected); font-weight: 700; }
.account { display: grid; align-items: center; gap: .5rem; margin-top: auto; padding-top: .75rem; border-block-start: 1px solid var(--line); color: var(--muted); overflow-wrap: anywhere; }
.console main { width: 100%; max-width: 82rem; padding: clamp(1rem, 4vw, 3rem); min-width: 0; }
.metrics, .columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem),1fr)); gap: .75rem; margin: 1rem 0; }
.metric, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: 1rem; }
.metric dt, .usage dt { color: var(--muted); }
.metric dd { font-size: 1.375rem; font-weight: 700; overflow-wrap: anywhere; }
dd { margin: 0; font-variant-numeric: tabular-nums; }
.panel { margin-bottom: 1rem; }
.panel .button { margin-top: .75rem; }
.columns .panel { margin-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.filters > div { flex: 1 1 12rem; }
.filters label { margin-bottom: .25rem; }
.table-wrap { container-type: inline-size; overflow: auto; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
table { width: 100%; min-width: 34rem; border-collapse: collapse; text-align: start; }
th, td { padding: .75rem 1rem; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { color: var(--muted); font-size: .875rem; background: var(--bg); }
.pagination { display: flex; flex-wrap: wrap; gap: .875rem; margin-top: 1rem; }
.usage > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.usage > div:last-child { border-bottom: 0; }
.usage dd { text-align: end; }
.audit-list { padding: 0; margin: 0; list-style: none; }
.audit-list li { padding: .375rem 0; overflow-wrap: anywhere; }
.audit-list span { color: var(--muted); font-size: .875rem; }
.notice { background: var(--selected); border-radius: .5rem; padding: .75rem; margin-bottom: 1rem; }
.notice ul { margin: 0; padding-inline-start: 1.25rem; }
.notice.error { border: 1px solid var(--danger); color: var(--danger); }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem),1fr)); gap: .75rem; align-items: start; }
details { border: 1px solid var(--line); border-radius: .5rem; padding: .75rem; }
summary { cursor: pointer; font-weight: 600; }
details[open] .form-stack { margin-top: .75rem; }
@media (max-width: 56rem) {
  .console { display: block; }
  .sidebar { padding: .5rem 1rem; border-inline-end: 0; border-block-end: 1px solid var(--line); gap: .75rem; }
  .nav-toggle.quiet { min-height: 2.75rem; }
  .sidebar-content[popover] {
    position: fixed;
    inset: auto 1rem auto auto;
    inset-block-start: 4.25rem;
    inline-size: min(22rem, calc(100% - 2rem));
    max-block-size: calc(100dvh - 5.25rem);
    margin: 0;
    padding: .75rem;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: .75rem;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 .75rem 2rem #0b111c30;
    display: none;
  }
  .sidebar-content:popover-open { display: flex; }
  .account { grid-template-columns: 1fr auto; }
  .console h1 { margin-bottom: 1rem; }
}
@media (max-width: 32rem) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .metric { padding: .75rem; }
  .metric dt { font-size: .8125rem; line-height: 1.35; }
  .metric dd { margin-block-start: .25rem; font-size: 1.125rem; }
  .metric:first-child { grid-column: 1 / -1; }
  .filters { display: grid; }
}
@container (width < 36rem) {
  table, tbody, tr, tbody th, td { display: block; }
  table { min-width: 0; }
  thead { display: none; }
  tbody tr { padding: .75rem; }
  tbody tr + tr { border-block-start: 1px solid var(--line); }
  tbody th { font-size: 1rem; }
  tbody th, td { padding: .35rem .125rem; border: 0; }
  td[data-label] { display: grid; grid-template-columns: minmax(5.5rem, 1fr) minmax(0, 1.6fr); gap: .625rem; }
  td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .875rem; }
  td[data-label="Aksi"]:has(form, .button) { display: block; }
  td[data-label="Aksi"]:has(form, .button)::before { display: block; margin-block-end: .375rem; }
}
