/* Aksa Bali Studio — admin. Tridatu: merah, putih, hitam. */
@font-face { font-family: "Jakarta"; src: url("fonts/plus_jakarta_sans_regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("fonts/plus_jakarta_sans_semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("fonts/plus_jakarta_sans_extrabold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Aksara"; src: url("fonts/NotoSansBalinese.woff") format("woff"); font-weight: 400 700; font-display: swap; unicode-range: U+1B00-1B7F, U+25CC; }

:root {
  --red: #A4232E; --red-pressed: #831B25; --red-soft: #FAECEE;
  --ink: #171717; --bg: #F8F7F5; --surface: #FFFFFF; --surface-alt: #F1F0EE;
  --outline: #E3E0DD; --text-2: #555555; --text-3: #777777;
  --success: #28754C; --success-soft: #E6F2EB; --warn: #8A5A00; --warn-soft: #FFF4DB;
  --radius: 16px; --radius-sm: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 "Jakarta", system-ui, sans-serif; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.bali { font-family: "Aksara", sans-serif; line-height: 1.7; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }

/* Shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--outline); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; text-decoration: none; }
.mark { position: relative; width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: var(--bg); display: grid; place-items: center; overflow: hidden; font-family: "Aksara"; font-size: 20px; line-height: 1; }
.mark::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--red); }
.brand b { font-weight: 800; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--text-2); font-weight: 600; }
.nav a:hover { background: var(--surface-alt); color: var(--ink); }
.nav a.on { background: var(--red-soft); color: var(--red); }
.nav .count { margin-left: auto; font-size: 12px; background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; }
.side .me { margin-top: auto; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-alt); display: grid; gap: 6px; }
.main { padding: 28px 32px 48px; max-width: 1180px; width: 100%; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 14px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.stat b { display: block; font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat span { color: var(--text-2); font-size: 13px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
hr { border: 0; border-top: 1px solid var(--outline); margin: 4px 0; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; background: var(--red); color: #fff; }
.btn:hover { background: var(--red-pressed); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--outline); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.ink { background: var(--ink); color: var(--bg); }
.btn.ok { background: var(--success); }
.btn.block { width: 100%; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 13.5px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--outline); border-radius: var(--radius-sm); padding: 9px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; background: var(--surface); }
textarea { min-height: 90px; resize: vertical; }
input[type="checkbox"] { width: auto; }
input[type="file"] { background: var(--surface); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters select { width: auto; min-width: 160px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-alt); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.draft { }
.badge.in_review { background: var(--warn-soft); color: var(--warn); }
.badge.approved { background: #E8EEF9; color: #2A4F8F; }
.badge.released { background: var(--success-soft); color: var(--success); }
.badge.rejected { background: var(--red-soft); color: var(--red); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--outline); }
td { padding: 12px; border-bottom: 1px solid var(--outline); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.link:hover td { background: var(--bg); cursor: pointer; }
.glyph-cell { font-family: "Aksara"; font-size: 26px; line-height: 1.5; width: 56px; text-align: center; }
.table-card { padding: 0; overflow: hidden; }

/* Alerts */
.alert { border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 18px; }
.alert.ok { background: var(--success-soft); color: var(--success); }
.alert.err { background: var(--red-soft); color: var(--red-pressed); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.token { word-break: break-all; background: var(--ink); color: var(--bg); padding: 10px 12px; border-radius: 10px; }

/* Stroke preview */
.pad { position: relative; aspect-ratio: 1; background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius); overflow: hidden; }
.pad svg { width: 100%; height: 100%; display: block; }
.pad .grid-line { stroke: #E8E4E0; stroke-width: 3; stroke-dasharray: 12 12; }
.pad .stroke { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; }
.pad .raw { fill: none; stroke: var(--red); stroke-width: 3; stroke-dasharray: 10 8; opacity: .9; }
.pad .start { fill: var(--red); }
.pad .num { fill: #fff; font: 800 26px "Jakarta"; text-anchor: middle; dominant-baseline: central; }
.pad.hide-raw .raw { display: none; }
.strokes-list { display: grid; gap: 6px; }
.strokes-list div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 8px 10px; background: var(--bg); border-radius: 10px; }

/* Aksara coverage */
.aksara-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.aksara-tile { position: relative; display: grid; justify-items: center; padding: 10px 6px; border-radius: var(--radius-sm); border: 1px solid var(--outline); background: var(--surface); text-decoration: none; }
.aksara-tile .g { font-family: "Aksara"; font-size: 30px; line-height: 1.6; }
.aksara-tile small { font-weight: 600; font-size: 12px; }
.aksara-tile.released { border-color: var(--success); background: var(--success-soft); }
.aksara-tile .dot { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 800; color: var(--warn); }

/* Events */
.events { display: grid; gap: 10px; }
.event { display: grid; grid-template-columns: 10px 1fr; gap: 10px; font-size: 13.5px; }
.event::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--outline); margin-top: 6px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; display: grid; gap: 16px; }
.thread { height: 6px; border-radius: 3px; background: repeating-linear-gradient(135deg, var(--red) 0 8px, #fff 8px 16px, var(--ink) 16px 24px); border: 1px solid var(--outline); }

details summary { cursor: pointer; font-weight: 600; }
pre { margin: 10px 0 0; max-height: 420px; overflow: auto; background: var(--bg); padding: 12px; border-radius: 10px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side .me { margin-top: 0; }
  .nav { grid-auto-flow: column; overflow-x: auto; }
  .main { padding: 20px 16px 40px; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-2 { grid-template-columns: 1fr; }
}
