/* Antarestar Research — dashboard. Token terkunci gaya Workspace OS. */
:root {
  --primary: #F26322; --primary-hover: #D8541A; --primary-active: #B8450F; --primary-50: #FEF6F1; --primary-100: #FCE7DA; --primary-200: #F7C4A6;
  --ink: #12161B; --ink-soft: #1C232B;
  --text-1: #1A1D21; --text-2: #3B4149; --text-3: #5C636D; --text-4: #676E78; --text-5: #A8AEB7;
  --line: #E4E6EA; --line-soft: #EFF1F4; --fill-1: #F7F8F9; --fill-2: #EDEFF2; --fill-3: #E4E7EB;
  --bg-body: #F7F8FA; --bg-card: #FFFFFF; --bg-rail: #ECEFF3; --line-rail: #DDE1E7; --rail-w: 232px;
  --green: #16A34A; --green-bg: #E9F7EE; --red: #DC4B4F; --red-bg: #FCEEEE; --amber: #D97706; --amber-bg: #FDF3E6;
  --cyan: #1B8FE3; --cyan-bg: #E9F4FD; --purple: #7358F0; --purple-bg: #F1EEFE;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1); --ease-out: cubic-bezier(.16,1,.3,1);
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg-body); color: var(--text-1); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); } .small { font-size: 12.5px; }
.good { color: var(--green); } .bad { color: var(--red); }

/* Shell */
.shell { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100vh; }
.rail { background: var(--bg-rail); border-right: 1px solid var(--line-rail); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; text-decoration: none; }
.logo img { width: 32px; height: 32px; border-radius: 9px; }
.logo b { font: 800 15px var(--display); letter-spacing: -.02em; display: block; line-height: 1.15; }
.logo span { font-size: 11.5px; color: var(--text-3); }
.nav-group { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-4); padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--text-2); font-weight: 600; position: relative; transition: background .15s var(--ease); }
.nav a:hover { background: rgba(255,255,255,.6); color: var(--text-1); }
.nav a.active { background: var(--bg-card); color: var(--primary-active); box-shadow: 0 1px 2px rgba(18,22,27,.06); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav svg { width: 17px; height: 17px; flex: none; }
.nav .badge { margin-left: auto; font-size: 11px; background: var(--fill-3); color: var(--text-2); border-radius: 10px; padding: 0 7px; font-weight: 700; }
.rail-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--line-rail); font-size: 12.5px; }
.rail-foot b { display: block; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(247,248,250,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 14px 28px; display: flex; align-items: center; gap: 12px; }
.topbar h1 { font: 800 21px var(--display); letter-spacing: -.02em; margin: 0; }
.topbar .crumb { font-size: 12.5px; color: var(--text-3); }
.topbar .sp { flex: 1; }
.content { padding: 22px 28px 60px; max-width: 1360px; }
.topbar .menu-btn { display: none; }

/* Buttons & inputs */
.btn { border: 1px solid var(--line); background: var(--bg-card); border-radius: 9px; padding: 7px 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; text-decoration: none; transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s; }
.btn:hover { background: var(--fill-1); border-color: #D2D6DC; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--fill-2); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 8px; }
.btn.danger { color: var(--red); }
.btn[disabled] { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input[type=text], input[type=search], input[type=number], input[type=password], select, textarea { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: var(--bg-card); min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-200); outline: 3px solid var(--primary-50); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.seg { display: inline-flex; background: var(--fill-2); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-weight: 600; color: var(--text-3); cursor: pointer; }
.seg button.on { background: var(--bg-card); color: var(--text-1); box-shadow: 0 1px 2px rgba(18,22,27,.08); }

/* Cards & KPI */
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card h2 { font: 700 15px var(--display); margin: 0 0 10px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card h2 .sp { flex: 1; }
.kpi .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.kpi .val { font: 800 26px var(--display); letter-spacing: -.03em; margin-top: 4px; }
.kpi .sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.kpi.hero { background: var(--ink); border-color: var(--ink); color: #fff; position: relative; overflow: hidden; }
.kpi.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(242,99,34,.45), transparent 70%); }
.kpi.hero .label, .kpi.hero .sub { color: #B9C0C8; }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }
.split.even { grid-template-columns: 1fr 1fr; }

/* Tables */
.table-wrap { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 10px 12px; background: var(--fill-1); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.t th.sortable { cursor: pointer; }
.t th.sortable:hover { color: var(--text-1); }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .12s; }
.t tbody tr:hover { background: #FCFCFD; }
.t .r { text-align: right; white-space: nowrap; }
.t .clickable { cursor: pointer; }
.prod { display: flex; gap: 10px; align-items: center; min-width: 260px; }
.prod img, .prod .ph { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--fill-2); flex: none; }
.prod a { font-weight: 600; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod a:hover { color: var(--primary-active); }
.tag { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tag.mall { background: #FDECEC; color: #C2262B; }
.tag.komp { background: var(--cyan-bg); color: #0F5F99; }
.tag.own { background: var(--primary-50); color: var(--primary-active); }
.tag.ide { background: var(--fill-2); color: var(--text-2); }
.tag.dievaluasi { background: var(--amber-bg); color: #8a4b05; }
.tag.lanjut { background: var(--green-bg); color: #0F6B33; }
.tag.ditolak { background: var(--red-bg); color: #9b2226; }
.tag.kandidat { background: var(--purple-bg); color: #4B32C3; }
.delta-up { color: var(--green); font-weight: 600; } .delta-down { color: var(--red); font-weight: 600; }

/* Bars & charts */
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar { display: grid; grid-template-columns: minmax(110px, 160px) 1fr 70px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-track { height: 10px; border-radius: 6px; background: var(--fill-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--primary); transform-origin: left; animation: grow .6s var(--ease-out); }
@keyframes grow { from { transform: scaleX(0); } }
.chart { width: 100%; height: 190px; display: block; }
.chart .grid-line { stroke: var(--line-soft); }
.chart .axis { fill: var(--text-4); font-size: 10.5px; }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#arGrad); }
.chart .pt { fill: var(--bg-card); stroke: var(--primary); stroke-width: 2; }

/* Empty, skeleton, toasts */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty h3 { font: 700 17px var(--display); color: var(--text-1); margin: 12px 0 6px; }
.empty .glyph { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-50); color: var(--primary); display: inline-grid; place-items: center; font: 800 21px var(--display); }
.skel { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--fill-2), var(--fill-1), var(--fill-2)); background-size: 200% 100%; animation: sh 1.2s infinite; margin: 8px 0; }
@keyframes sh { to { background-position: -200% 0; } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 600; box-shadow: 0 10px 30px rgba(18,22,27,.2); transition: opacity .3s, transform .3s; }
.toast-err { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }
.notice { padding: 10px 12px; border-radius: 10px; background: var(--amber-bg); color: #7a4304; font-size: 13px; margin-bottom: 14px; }
.notice.info { background: var(--cyan-bg); color: #0F4E7D; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid var(--line); background: var(--bg-card); border-radius: 20px; padding: 3px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.pill:hover { border-color: var(--primary-200); color: var(--primary-active); }
.pill.on { background: var(--primary-50); border-color: var(--primary-200); color: var(--primary-active); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; }
code { background: var(--fill-2); border-radius: 5px; padding: 1px 5px; font-size: 12.5px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(242,99,34,.55), transparent 65%); }
.login-art h2 { font: 800 40px/1.1 var(--display); letter-spacing: -.03em; margin: 0; max-width: 460px; position: relative; z-index: 1; }
.login-art p { color: #B9C0C8; max-width: 420px; position: relative; z-index: 1; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-form h1 { font: 800 26px var(--display); letter-spacing: -.02em; margin: 0; }

dialog { border: 0; border-radius: 16px; padding: 22px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(18,22,27,.25); }
dialog::backdrop { background: rgba(18,22,27,.4); }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .rail.open { transform: none; box-shadow: 0 0 40px rgba(18,22,27,.25); }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px; }
  .split, .split.even { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
