/* Hillir Super App — token warna dari 01-desain/panduan-desain.md */
:root {
  --violet: #7716E1; --violet-hover: #6411C2; --tint: #F5F4FE; --tint-2: #ECE8FD; --violet-ink: #3C3489;
  --violet-border: #C7C2F5; --lavender: #C4A5FA; --page: #F5F5F8; --card: #FFFFFF; --ink: #1F1B2E; --muted: #5E5A70;
  --line: #EEEDF3; --line-2: #E4E2EC; --ok-bg: #E1F5EE; --ok: #0F6E56; --warn-bg: #FBEFDC; --warn: #8A5A1E;
  --err-bg: #FAECE7; --err: #993C1D; --shadow: 0 6px 18px rgba(38,33,92,.06); --shadow-pop: 0 16px 40px rgba(38,33,92,.16);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--page); color: var(--ink); font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--tint); color: var(--violet-ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--violet); color: #fff; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--violet-hover); }
:focus-visible { outline: 3px solid var(--lavender); outline-offset: 2px; }

/* ---------- Login ---------- */
.login { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; min-height: 100vh; padding: 16px; }
.login-hero { position: relative; overflow: hidden; background: var(--violet); color: #fff; border-radius: 24px; padding: 48px; display: flex; flex-direction: column; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand.light { color: #fff; }
.login-hero h1 { font-size: 42px; line-height: 1.15; letter-spacing: -.02em; margin: 40px 0 16px; max-width: 520px; }
.login-hero p { margin: 0; max-width: 520px; color: rgba(255,255,255,.88); font-size: 15px; }
.orbit { position: relative; width: 420px; height: 420px; margin: auto auto 0; max-width: 100%; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(255,255,255,.28); }
.ring.r2 { inset: 70px; border-style: solid; border-color: rgba(255,255,255,.14); }
.core { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); padding: 26px; border-radius: 36px; background: rgba(255,255,255,.1); box-shadow: 0 0 0 18px rgba(255,255,255,.05); }
.core svg { display: block; }
.orb { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px; border-radius: 18px; background: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(20,8,60,.25);
  transform: rotate(calc(var(--i) * 51.43deg)) translate(185px) rotate(calc(var(--i) * -51.43deg)); animation: orbit 60s linear infinite; }
@keyframes orbit { from { transform: rotate(calc(var(--i) * 51.43deg)) translate(185px) rotate(calc(var(--i) * -51.43deg)); } to { transform: rotate(calc(var(--i) * 51.43deg + 360deg)) translate(185px) rotate(calc(var(--i) * -51.43deg - 360deg)); } }
.login-card { background: var(--card); border-radius: 24px; display: grid; place-items: center; padding: 32px; box-shadow: var(--shadow); }
.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font-size: 30px; margin: 14px 0 6px; letter-spacing: -.01em; }
.login-box > p { margin: 0 0 24px; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 12px; height: 54px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; font-size: 15px; box-shadow: var(--shadow); }
.btn-google:hover { border-color: var(--violet-border); background: var(--tint); }
.login-box .small { margin-top: 20px; }
.alert { margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; background: var(--err-bg); color: var(--err); font-weight: 500; }
.dev { margin-top: 28px; padding-top: 20px; border-top: 1px dashed var(--line-2); display: grid; gap: 10px; }
.dev label { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.dev input { height: 42px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; font: inherit; }

/* ---------- Bar atas ---------- */
.topbar { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar.floating { position: sticky; top: 16px; z-index: 20; margin: 16px; border: 0; border-radius: 16px; box-shadow: var(--shadow); }
.spacer { flex: 1; }
.brand-mini { display: inline-flex; }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--violet); }
.crumb span { color: var(--line-2); }
.crumb b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--tint); color: var(--violet); }
.avatar-btn { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 999px; }
.avatar { width: 40px; height: 40px; border-radius: 999px; background: var(--violet); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 44px; height: 44px; }
.menu-wrap { position: relative; }
.popover { position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; background: var(--card); border-radius: 20px; box-shadow: var(--shadow-pop); padding: 10px; min-width: 260px; }
.pop-title { font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px 10px; }
.pop-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 12px; background: none; cursor: pointer; font-weight: 500; }
.pop-item:hover { background: var(--tint); }
.pop-item.danger { color: var(--err); }
.acct-head { display: flex; gap: 12px; align-items: center; padding: 8px 8px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.acct-head b { display: block; }
.acct-head span { font-size: 12.5px; color: var(--muted); word-break: break-all; }
.popover.apps { width: 340px; }
.sw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.sw-item { position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; text-align: center; font-size: 12.5px; font-weight: 600; }
.sw-item:hover { background: var(--tint); }
.sw-item.on { background: var(--tint-2); color: var(--violet-ink); }
.sw-item i { position: absolute; top: 8px; right: 8px; color: var(--muted); }

/* ---------- Portal ---------- */
.portal { max-width: 1180px; margin: 0 auto; padding: 16px 24px 64px; }
.hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--violet); color: #fff; border-radius: 24px; padding: 48px; margin-top: 16px; }
.hero::after { content: ""; position: absolute; right: -180px; top: -160px; width: 620px; height: 620px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); pointer-events: none; }
.hello { margin: 0 0 8px; font-weight: 500; color: rgba(255,255,255,.9); }
.hero h1 { margin: 0; font-size: 36px; line-height: 1.2; letter-spacing: -.02em; }
.clock { position: relative; z-index: 1; min-width: 330px; padding: 22px; border-radius: 20px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); }
.clock-date { font-weight: 600; margin-bottom: 12px; }
.clock-digits { display: flex; align-items: flex-end; gap: 6px; }
.clock-digits b { font-size: 46px; line-height: 1; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.14); font-variant-numeric: tabular-nums; }
.clock-digits i { font-style: normal; font-size: 34px; align-self: center; opacity: .7; }
.clock-digits small { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.18); font-weight: 600; font-variant-numeric: tabular-nums; }
.clock-meta { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 8px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.88); }
.clock-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.2); overflow: hidden; }
.clock-bar span { display: block; height: 100%; width: 0; background: #fff; border-radius: 999px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 36px 0 16px; }
.section-head h2 { margin: 0; font-size: 22px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.app-card { display: flex; flex-direction: column; gap: 6px; min-height: 230px; padding: 24px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.app-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(38,33,92,.1); }
.app-card svg:first-child { margin-bottom: 14px; }
.app-card h3 { margin: 0; font-size: 19px; }
.app-card p { margin: 0; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: auto; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.note { margin-top: 20px; font-size: 13px; }

/* ---------- Bingkai aplikasi ---------- */
.page-shell { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.frame-wrap { position: relative; flex: 1; min-height: 0; }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.skeleton, .frame-error { position: absolute; inset: 0; z-index: 2; background: var(--page); padding: 24px; }
.skeleton p { text-align: center; color: var(--muted); margin-top: 28px; }
.sk-bar { height: 48px; border-radius: 16px; background: #fff; margin-bottom: 20px; }
.sk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sk-card { height: 180px; border-radius: 20px; background: #fff; }
.sk-bar, .sk-card { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.frame-error { display: grid; place-content: center; justify-items: center; text-align: center; gap: 8px; }
.frame-error[hidden], .skeleton[hidden] { display: none; }
.frame-error h2 { margin: 8px 0 0; }

/* ---------- Halaman sistem ---------- */
.system { max-width: 560px; margin: 12vh auto; padding: 0 24px; text-align: center; }
.system .code { font-size: 72px; font-weight: 800; color: var(--violet); letter-spacing: -.03em; }
.system h1 { font-size: 30px; margin: 4px 0 8px; }
.system .btn { margin-top: 20px; }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: 32px; }
  .login-hero h1 { font-size: 32px; margin-top: 28px; }
  .orbit { display: none; }
  .hero { flex-direction: column; align-items: flex-start; padding: 32px; }
  .clock { min-width: 0; width: 100%; }
  .hero h1 { font-size: 28px; }
  .portal { padding: 8px 16px 48px; }
  .topbar .chip { display: none; }
  .crumb > a, .crumb > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .orb, .sk-bar, .sk-card { animation: none; }
  .app-card { transition: none; }
}
