:root {
  --bg: #f4f6f3; --surface: #ffffff; --surface-2: #eef2ee; --text: #1c2420; --muted: #5a6660;
  --brand: #24332b; --accent: #c9862a; --accent-2: #5e7f35; --line: #d5dbd6;
  --top: #5e7f35; --medium: #c9862a; --low: #8c4a2f; --danger: #a33a2a;
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --head: Cambria, Georgia, "Times New Roman", serif;
  --body: Calibri, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#141a17; --surface:#1d2521; --surface-2:#253029; --text:#e8ece9; --muted:#a3ada7;
          --brand:#0f1512; --line:#34403a; --shadow:none; --low:#c06a4a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--head); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 2rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
code { font-size: .9em; background: var(--surface-2); padding: 0 .3em; border-radius: 4px; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .lead { color: var(--muted); max-width: 70ch; margin: 0 0 1.5rem; }

.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.5rem; background: var(--brand); color: #fff; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font: 1.25rem var(--head); }
.brand b { color: var(--accent); font-weight: 700; }
.topbar nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.topbar nav a { color: #d8ded9; text-decoration: none; padding: .35rem .75rem; border-radius: 8px; }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.logout { display: flex; align-items: center; gap: .6rem; margin: 0; }
.who { color: #d8ded9; font-size: .9rem; }
.demo-banner { background: #f7ead4; color: #5b3d0e; padding: .45rem 1.5rem; font-size: .875rem; }
@media (prefers-color-scheme: dark) { .demo-banner { background: #3a2e18; color: #f1d9a8; } }

.wrap { max-width: 1200px; margin: 0 auto; padding: 1.75rem 1.5rem 3rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid var(--line); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } .wrap { padding: 1.25rem 1rem 2rem; } .topbar { padding: .7rem 1rem; } }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: .65rem 1.2rem; font: 600 1rem var(--body); cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.4); }
.btn.small { padding: .3rem .7rem; font-size: .85rem; }
input { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--surface); color: var(--text); margin-top: .3rem; }
label { display: block; margin-bottom: 1rem; font-size: .95rem; }
details { margin: 0 0 1rem; } summary { cursor: pointer; color: var(--muted); }

.drop { display: flex; align-items: center; justify-content: center; text-align: center; border: 2px dashed var(--line); border-radius: var(--radius); padding: 2.5rem 1rem; cursor: pointer; background: var(--surface-2); position: relative; color: var(--muted); }
.drop.over, .drop:hover { border-color: var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }

.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; }
.sample { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 0; cursor: pointer; overflow: hidden; color: var(--text); font: 600 .8rem var(--body); }
.sample img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.sample span { display: block; padding: .3rem; }
.sample:hover { outline: 2px solid var(--accent); }

.result-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.grade { font: 700 2.4rem var(--head); color: #fff; padding: .4rem 1.4rem; border-radius: 12px; }
.grade-top { background: var(--top); } .grade-medium { background: var(--medium); } .grade-low { background: var(--low); }
.grade-text-top { color: var(--top); } .grade-text-medium { color: var(--medium); } .grade-text-low { color: var(--low); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.pair figure { margin: 0; } .pair img { width: 100%; border-radius: 8px; display: block; }
figcaption { font-size: .8rem; color: var(--muted); margin-top: .35rem; }
.sw { display: inline-block; width: .8em; height: .8em; border-radius: 2px; vertical-align: -1px; margin-left: .4em; }
.sw.cyan { background: #00dcc8; } .sw.magenta { background: #c850ff; } .sw.red { background: #ff3c3c; }
.kv { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.kv th, .kv td { text-align: left; padding: .45rem .25rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv th { color: var(--muted); font-weight: 400; width: 45%; }
.reason { padding: .6rem .8rem; border-radius: 8px; background: var(--surface-2); margin: .5rem 0; font-size: .95rem; }
.checks { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .3rem; }
.checks li { padding: .35rem .6rem; border-radius: 6px; font-size: .9rem; background: var(--surface-2); }
.checks li b { display: inline-block; min-width: 5.5em; text-transform: uppercase; font-size: .75rem; letter-spacing: .04em; }
.checks li.ok b { color: var(--top); } .checks li.gagal b { color: var(--danger); } .checks li.dilewati b { color: var(--muted); }
.alert { background: #f6dcd6; color: #6d2416; padding: .6rem .8rem; border-radius: 8px; }

.stats { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.5rem; min-width: 130px; }
.stat .n { font: 700 2rem var(--head); }
.table-wrap { overflow-x: auto; }
.list { width: 100%; border-collapse: collapse; }
.list th, .list td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); }
.list th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.pill { color: #fff; padding: .1rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }

.ds-head { margin-bottom: .5rem; }
.cls { margin-top: 1rem; }
.strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; }
.strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
@media (max-width: 640px) { .strip { grid-template-columns: repeat(3, 1fr); } h1 { font-size: 1.6rem; } }

.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--brand); padding: 1rem; }
.login-card { background: var(--surface); padding: 2rem; border-radius: 16px; width: 100%; max-width: 380px; text-align: center; }
.login-card h1 b { color: var(--accent); }
.login-card form { text-align: left; margin-top: 1.25rem; }
.login-card .btn { width: 100%; }

/* ---- RBAC, training, model ---- */
.role { font-size: .72rem; padding: .05rem .45rem; border-radius: 999px; margin-left: .3rem; font-weight: 600; vertical-align: 1px; }
.role-nusatec { background: var(--accent); color: #fff; } .role-ptpn { background: var(--accent-2); color: #fff; }
select, textarea { width: 100%; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--surface); color: var(--text); margin-top: .3rem; }
.row2, .row3 { display: grid; gap: .75rem; } .row2 { grid-template-columns: 1fr 1fr; } .row3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) { .row2, .row3 { grid-template-columns: 1fr; } }
label.check { display: flex; align-items: center; gap: .5rem; padding-top: 1.6rem; } label.check input { width: auto; margin: 0; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; } .actions form { margin: 0; }
.status { font-size: .8rem; padding: .1rem .55rem; border-radius: 999px; font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.status.big { font-size: 1rem; padding: .35rem 1rem; }
.s-done { background: var(--top); color: #fff; } .s-running { background: var(--accent); color: #fff; }
.s-failed { background: var(--danger); color: #fff; } .s-queued, .s-cancelled { background: var(--surface-2); color: var(--muted); }
.progress { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: .5rem; }
.progress .bar { height: 100%; width: 0; background: var(--accent); transition: width .5s; }
.log { background: #111613; color: #cfd8d2; padding: 1rem; border-radius: 8px; max-height: 360px; overflow: auto; font: 12px/1.45 Consolas, monospace; white-space: pre-wrap; }
.ok-msg { background: #e3efd8; color: #2f4a17; padding: .6rem .8rem; border-radius: 8px; }
.flash { border-color: var(--accent); } .pw { font-size: 1.2rem; padding: .3rem .6rem; user-select: all; }
.ai { margin-bottom: 1rem; }
.probrow { display: grid; grid-template-columns: 9rem 1fr 4rem; gap: .6rem; align-items: center; margin: .25rem 0; }
.probrow meter { width: 100%; height: 14px; } .probrow .pv { text-align: right; font-variant-numeric: tabular-nums; }
.probrow .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.roi { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.roi img { width: 110px; border-radius: 8px; border: 2px solid #00dcc8; }
tr.cross td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
