/* =========================================================
   StreadLock — satu stylesheet, tanpa framework.
   Tema: dark & light (ikut sistem atau dipilih manual).
   ========================================================= */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Token: dark (default) ---------- */
:root {
  --bg: #09090b;
  --bg-elev: #0f0f12;
  --surface: #131317;
  --surface-2: #1a1a1f;
  --surface-3: #232329;
  --border: rgb(255 255 255 / .07);
  --border-strong: rgb(255 255 255 / .12);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #7c6cff;
  --accent-2: #4f8bff;
  --accent-soft: rgb(124 108 255 / .14);
  --accent-fg: #ffffff;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --blue: #60a5fa;
  --gray: #a1a1aa;
  --overlay: rgb(0 0 0 / .65);
  --card-shadow: 0 1px 0 0 rgb(255 255 255 / .04) inset, 0 1px 2px rgb(0 0 0 / .4);
  --pop-shadow: 0 24px 64px -16px rgb(0 0 0 / .7), 0 0 0 1px rgb(255 255 255 / .06);
  --glow-1: rgb(124 108 255 / .22);
  --glow-2: rgb(79 139 255 / .16);
  color-scheme: dark;
}

/* ---------- Token: light ---------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f7f8; --bg-elev: #ffffff; --surface: #ffffff; --surface-2: #f4f4f6; --surface-3: #ebebef;
    --border: rgb(9 9 11 / .08); --border-strong: rgb(9 9 11 / .14);
    --text: #09090b; --muted: #52525b; --faint: #8a8a93;
    --accent: #5b4cf0; --accent-2: #2f6fed; --accent-soft: rgb(91 76 240 / .10); --accent-fg: #ffffff;
    --green: #059669; --amber: #d97706; --red: #dc2626; --blue: #2563eb; --gray: #71717a;
    --overlay: rgb(9 9 11 / .35);
    --card-shadow: 0 1px 2px rgb(9 9 11 / .04), 0 1px 1px rgb(9 9 11 / .02);
    --pop-shadow: 0 24px 64px -20px rgb(9 9 11 / .28), 0 0 0 1px rgb(9 9 11 / .06);
    --glow-1: rgb(91 76 240 / .12); --glow-2: rgb(47 111 237 / .10);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f7f7f8; --bg-elev: #ffffff; --surface: #ffffff; --surface-2: #f4f4f6; --surface-3: #ebebef;
  --border: rgb(9 9 11 / .08); --border-strong: rgb(9 9 11 / .14);
  --text: #09090b; --muted: #52525b; --faint: #8a8a93;
  --accent: #5b4cf0; --accent-2: #2f6fed; --accent-soft: rgb(91 76 240 / .10); --accent-fg: #ffffff;
  --green: #059669; --amber: #d97706; --red: #dc2626; --blue: #2563eb; --gray: #71717a;
  --overlay: rgb(9 9 11 / .35);
  --card-shadow: 0 1px 2px rgb(9 9 11 / .04), 0 1px 1px rgb(9 9 11 / .02);
  --pop-shadow: 0 24px 64px -20px rgb(9 9 11 / .28), 0 0 0 1px rgb(9 9 11 / .06);
  --glow-1: rgb(91 76 240 / .12); --glow-2: rgb(47 111 237 / .10);
  color-scheme: light;
}

:root {
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --sidebar: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01", "ss03";
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); font-size: .9em; letter-spacing: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; }
.logo { display: block; flex: none; }
.logo .ico { width: 100%; height: 100%; }
.spacer { flex: 1; }

/* ---------- Spinner & boot ---------- */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; display: inline-block;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; opacity: .85;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons ---------- */
.btn {
  --h: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 550; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s, transform .08s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { color: var(--accent-fg); border-color: transparent; background: var(--accent); box-shadow: none; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.btn-danger { background: var(--red); color: #fff; border-color: transparent; box-shadow: none; }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 88%, black); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-icon { --h: 34px; width: var(--h); padding: 0; border-color: transparent; background: transparent; box-shadow: none; color: var(--faint); border-radius: 9px; }
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-icon.danger:hover { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.btn-block { width: 100%; }
.btn-lg { --h: 46px; font-size: 15px; border-radius: 12px; }
.btn-sm { --h: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; }
.field + .field, .grid-2 + .field, .field + .grid-2 { margin-top: 16px; }
.label { font-size: 13px; font-weight: 550; color: var(--text); display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hint { font-size: 12px; font-weight: 450; color: var(--faint); }
.grid-2 { display: grid; gap: 16px; }
.grid-2 > .field { margin-top: 0; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.input {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 10px;
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:hover { border-color: color-mix(in srgb, var(--text) 22%, transparent); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input:disabled { opacity: .55; cursor: not-allowed; }
.input::placeholder { color: var(--faint); }
.input.mono::placeholder { font-family: var(--font); letter-spacing: -.006em; }
select.input {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input-wrap { position: relative; }
.input-wrap .input { padding-left: 38px; }
.input-wrap > .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; pointer-events: none; }
.error-text { color: var(--red); font-size: 13px; min-height: 0; }
.error-text:not(:empty) { margin-top: 12px; }

/* Segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.seg button {
  height: 32px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 550; transition: background .15s, color .15s, box-shadow .15s;
}
.seg button:hover:not(:disabled) { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .15), 0 0 0 1px var(--border); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.seg-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg-row .input { width: 110px; height: 40px; }
@media (max-width: 639px) {
  .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .seg button { padding: 0 6px; }
  .seg-row .input { width: 100%; }
}

/* Switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 13px; }
.switch b { font-weight: 550; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-strong); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .2s var(--ease); }
.switch input:checked { background: var(--green); box-shadow: none; }
.switch input:checked::after { transform: translateX(16px); }

/* ---------- Lock screen ---------- */
.lock {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); position: relative;
}
.lock-card { width: 100%; max-width: 340px; animation: rise .4s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.lock-brand { text-align: center; margin-bottom: 24px; }
.lock-brand .logo { width: 48px; height: 48px; margin: 0 auto 16px; }
.lock-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.lock-brand p { color: var(--faint); margin-top: 2px; font-size: 13px; }
.lock-form { display: grid; }
.lock-form .input { height: 46px; font-size: 15px; padding-right: 48px; border-radius: 12px; }
.lock-form .btn-lg { margin-top: 12px; }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.lock-theme { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 56px; padding: 0 16px; padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .logo { width: 32px; height: 32px; }
.brand b { font-weight: 700; letter-spacing: -.02em; display: block; line-height: 1.2; font-size: 14.5px; }
.brand small { color: var(--faint); font-size: 11.5px; display: block; }
.topbar .brand small { display: none; }
.topbar .brand .logo { width: 28px; height: 28px; }
.main { padding: 20px 16px calc(100px + env(safe-area-inset-bottom)); max-width: 1160px; margin: 0 auto; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* Bottom nav: bar mengambang (mobile) */
.bottomnav {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30;
  height: 60px; padding: 6px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: var(--pop-shadow);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 550; color: var(--faint); border-radius: 14px; transition: color .15s, background .15s;
}
.bottomnav a.active { color: var(--text); background: var(--surface-2); }
.bottomnav a.active .ico { color: var(--accent); }
.bottomnav .ico { width: 20px; height: 20px; }

.nav { display: grid; gap: 2px; }
.nav a, .nav button {
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border-radius: 10px;
  color: var(--muted); font-weight: 550; font-size: 13.5px; background: none; border: 0; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); }
.nav a.active .ico { color: var(--accent); }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: var(--sidebar) 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100dvh;
    padding: 20px 14px; border-right: 1px solid var(--border); background: var(--bg-elev);
  }
  .sidebar .brand { padding: 2px 8px 0; }
  .sidebar-foot { margin-top: auto; display: grid; gap: 2px; }
  .topbar, .bottomnav { display: none; }
  .main { padding: 32px 40px 56px; }
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 20px; }
.page-head > :first-child { flex: 1 1 auto; min-width: 0; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex: none; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--faint); font-size: 13px; font-weight: 500; margin-bottom: 14px; transition: color .15s; }
.back:hover { color: var(--text); }
.back .ico { width: 16px; height: 16px; }
.title-block { display: flex; align-items: center; gap: 14px; }
.title-block .avatar { width: 44px; height: 44px; border-radius: 12px; font-size: 15px; }
.title-block .row-main { gap: 6px; }
.title-row { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-width: 0; }
.title-row h1 { overflow-wrap: anywhere; }
.desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 520px; }

@media (max-width: 899px) {
  .page-head h1 { font-size: 21px; }
  .title-block .avatar { width: 40px; height: 40px; }
}
@media (max-width: 520px) {
  .page-head:has(.title-block) .actions { width: 100%; }
  .page-head:has(.title-block) .actions .btn-primary { flex: 1; }
  .docs .page-head .actions { width: 100%; }
  .docs .page-head .actions .btn { flex: 1; }
}

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--card-shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; }
.card-head h2 { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.card-head a { font-size: 13px; color: var(--muted); font-weight: 500; }
.card-head a:hover { color: var(--text); }
.card-body { padding: 0 18px 18px; }
.card-body.pad { padding: 18px; }
.section { margin-top: 16px; }
.split { display: grid; gap: 16px; margin-top: 16px; align-items: start; }
@media (min-width: 1000px) { .split { grid-template-columns: 1fr 1fr; } }

/* Stat strip */
.stats {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--card-shadow); overflow: hidden;
}
.stat { --c: var(--faint); padding: 16px 20px; border-left: 1px solid var(--border); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .k::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.stat .v { font-size: 24px; font-weight: 700; letter-spacing: -.035em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.15; }
@media (max-width: 639px) {
  .stat { padding: 12px 4px; text-align: center; }
  .stat .k { font-size: 11px; justify-content: center; gap: 4px; }
  .stat .k::before { width: 5px; height: 5px; }
  .stat .v { font-size: 19px; }
}

/* ---------- Badges & chips ---------- */
.badge {
  --c: var(--gray);
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent); }
.badge.active { --c: var(--green); }
.badge.expired { --c: var(--amber); }
.badge.revoked { --c: var(--red); }
.badge.plain::before { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: .02em;
}
button.chip { cursor: pointer; transition: color .15s, border-color .15s; }
button.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip .ico { width: 13px; height: 13px; }

.avatar {
  --c: var(--accent);
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 13px; letter-spacing: -.02em; color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent);
}

/* ---------- Lists ---------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.toolbar .input-wrap { flex: 1 1 200px; min-width: 0; }
.toolbar select { flex: 0 0 auto; width: 150px; }
@media (max-width: 420px) { .toolbar select { width: 118px; } }

.list { overflow: hidden; }
.list-head { display: none; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--border); transition: background .12s; }
.row:first-child, .list-head + .row { border-top: 0; }
.row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.row-lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.row-title.is-empty { color: var(--faint); font-weight: 500; font-style: italic; }
.row-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.row-meta .ico { width: 14px; height: 14px; color: var(--faint); }
.row-meta > span, .row-meta > div { display: inline-flex; align-items: center; gap: 6px; }
.row-actions { display: flex; gap: 2px; flex: none; align-self: center; margin-right: -8px; }
.stack { display: grid !important; gap: 2px !important; }
.stack .small { font-size: 12px; color: var(--faint); }
.row-sub.mono { font-size: 11.5px; color: var(--faint); }
@media (max-width: 899px) {
  .hide-mobile { display: none !important; }
  .row-meta .stack { display: inline-flex !important; }
  .row-meta .stack .small { font-size: 12.5px; }
  .row-meta > .hide-mobile, .row-meta .stack > .hide-mobile { display: none !important; }
  .products-grid .row-meta { padding-left: 48px; }
}

@media (min-width: 900px) {
  .list-head, .row-main.grid { display: grid; align-items: center; column-gap: 16px; }
  .list-head { padding: 12px 16px 10px; font-size: 11.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
  .row { padding: 12px 16px; }
  .row-actions { margin: 0 -6px 0 0; width: 34px; justify-content: flex-end; }
  .row-actions.wide { width: 70px; }
  .row-main.grid .row-meta { display: contents; }
  .row-main.grid .row-meta > * { min-width: 0; font-size: 13px; }
  .row-main.grid .row-meta > *:not(.stack) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .products-grid { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) 120px 130px; }
  .licenses-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 120px minmax(0, 1fr) minmax(0, 1fr); }
  .list-head { padding-right: calc(16px + 12px + 34px); }
  .list-head.licenses-grid { padding-right: calc(16px + 12px + 70px); }
  .hide-desktop { display: none !important; }
}
.btn-icon.placeholder { visibility: hidden; }
.key-text { overflow-wrap: anywhere; user-select: all; }
.key-line { display: flex; align-items: center; gap: 4px; }
.key-line .key-text { flex: 1; min-width: 0; }
.key-line .btn-icon { margin: -6px -8px -6px 0; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.pager .btns { display: flex; gap: 6px; }

/* Mini list (dashboard cards) */
.mini { display: grid; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--border); transition: background .12s; }
.mini-row:first-child { border-top: 0; }
a.mini-row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.mini-row .row-main { gap: 2px; }
.mini-row .end { margin-left: auto; text-align: right; flex: none; font-size: 12.5px; color: var(--muted); }
.mini-row .end b { color: var(--amber); font-weight: 600; }
.mini-row .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }

/* ---------- Empty / error / skeleton ---------- */
.empty { text-align: center; padding: 44px 20px; display: grid; justify-items: center; gap: 6px; }
.empty .ico-wrap {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 8px;
  background: var(--surface-2); color: var(--faint);
}
.empty h3 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.empty p { color: var(--muted); max-width: 360px; }
.empty .btn { margin-top: 12px; }
.empty.error .ico-wrap { color: var(--red); }
.empty.compact { padding: 28px 18px; }

.sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: sk 1.3s ease-in-out infinite; border-radius: 6px; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-line { height: 12px; }
.sk-stat { height: 76px; border-radius: var(--r-lg); }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); margin-bottom: 16px; background: color-mix(in srgb, var(--amber) 10%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 24%, transparent); font-size: 13.5px; }
.banner > .ico { color: var(--amber); }
.banner .btn { margin-left: auto; }

/* ---------- Dashboard layout ---------- */
.split.equal { align-items: stretch; }
@media (min-width: 1000px) { .split.equal > .card { display: flex; flex-direction: column; min-height: 220px; } }
.split.equal > .card > .mini { flex: 1; align-content: start; }
.split.equal > .card > .empty { flex: 1; align-content: center; }
.empty.compact { padding: 24px 18px 28px; gap: 4px; }
.empty.compact .ico-wrap { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 6px; }
.empty.compact h3 { font-size: 14px; }
.empty.compact p { font-size: 13px; }
.empty.compact .btn { margin-top: 10px; }
.sk-bar { height: 72px; border-radius: var(--r-lg); }

/* ---------- Lookup ---------- */
.lookup-card { padding: 12px; }
.lookup-form { display: flex; gap: 8px; }
.lookup-form .input-wrap { flex: 1; min-width: 0; }
.lookup-form .input { border-color: transparent; background: var(--surface-2); }
.lookup-form .input:focus { border-color: var(--accent); }
.lookup-result { margin-top: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 12px; animation: fade .25s var(--ease); }
@media (min-width: 900px) {
  .lookup-result { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); column-gap: 24px; align-items: start; }
  .lookup-result .top { grid-column: 1; }
  .lookup-result .kv { grid-column: 2; grid-row: 1 / span 2; }
  .lookup-result .btns { grid-column: 1; align-self: end; }
}
.lookup-result .top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.lookup-result .btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Detail dialog bits ---------- */
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 9px 12px; font-size: 13px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.panel { padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.panel + .panel, .panel + .field, .field + .panel { margin-top: 16px; }
.panel-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.panel-title .faint { font-weight: 500; }
.device { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.device:first-of-type { border-top: 0; }
.device .ico { color: var(--faint); }
.device .row-main { gap: 0; }

.key-box {
  margin-top: 2px; padding: 18px 16px; border-radius: var(--r); text-align: center; word-break: break-all; user-select: all;
  font: 600 15px/1.6 var(--mono); letter-spacing: .05em;
  background: linear-gradient(180deg, var(--accent-soft), transparent), var(--surface-2); border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
}
.key-list { margin-top: 2px; max-height: 300px; overflow: auto; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); }
.key-list div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--border); font-size: 12.5px; }
.key-list div:first-child { border-top: 0; }
.key-list .mono { user-select: all; }

/* ---------- Dialog ---------- */
dialog.modal {
  padding: 0; border: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--text);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-shadow: var(--pop-shadow);
}
dialog.modal::backdrop { background: var(--overlay); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog.modal[open] { animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.modal-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.025em; }
.modal-body { padding: 14px 20px 20px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--border); }
.modal-foot .spacer { flex: 1; }
.modal-body > p + p { margin-top: 8px; }

@media (max-width: 639px) {
  dialog.modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  dialog.modal[open] { animation: sheet .28s var(--ease); }
  .modal-head { padding-top: 22px; position: relative; }
  .modal-head::before { content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 36px; height: 4px; border-radius: 4px; background: var(--border-strong); }
  .modal-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; --h: 44px; }
  .modal-foot .spacer { display: none; }
}
@keyframes sheet { from { transform: translateY(60px); opacity: 0; } }

/* ---------- Docs ---------- */
.docs { max-width: 860px; }
.docs .toolbar select { width: 260px; max-width: 100%; }
@media (max-width: 639px) { .docs .toolbar select { width: 100%; } }
.doc { padding: 8px 28px 28px; }
.doc h1 { font-size: 22px; font-weight: 700; letter-spacing: -.03em; margin: 22px 0 8px; }
.doc h2 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; margin: 30px 0 10px; padding-top: 22px; border-top: 1px solid var(--border); }
.doc h3 { font-size: 14.5px; font-weight: 650; margin: 20px 0 8px; }
.doc h1:first-child, .doc h2:first-child { margin-top: 16px; border-top: 0; padding-top: 0; }
.doc p { color: var(--muted); margin: 8px 0; }
.doc ul, .doc ol { color: var(--muted); padding-left: 20px; margin: 8px 0; }
.doc li { margin: 4px 0; }
.doc strong { color: var(--text); font-weight: 600; }
.doc code { font-family: var(--mono); font-size: 12.5px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc th { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.doc td { color: var(--muted); }
.code-block { position: relative; margin: 12px 0; border-radius: var(--r); background: var(--bg-elev); border: 1px solid var(--border-strong); overflow: hidden; }
.code-block .code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 14px; border-bottom: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.code-block pre { margin: 0; padding: 14px; overflow-x: auto; font: 12.5px/1.65 var(--mono); color: var(--text); }
.code-block pre code { all: unset; }
@media (max-width: 639px) { .doc { padding: 4px 16px 20px; } }

/* ---------- Settings ---------- */
.settings { display: grid; gap: 16px; max-width: 640px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.setting-note { margin-top: 10px; }
.card-actions { display: flex; gap: 8px; margin-top: 16px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.confirm-field { margin-top: 16px; }
.grid-label-count { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; }
.grid-label-count > .field { margin-top: 0; }
.grid-label-count + .grid-2, .grid-label-count + .field, .grid-2 + .grid-2 { margin-top: 16px; }

/* ---------- Menu (⋯) ---------- */
.menu-list {
  position: fixed; z-index: 90; min-width: 180px; padding: 5px; display: grid; gap: 1px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--pop-shadow);
  animation: pop .14s var(--ease);
}
.menu-list > a, .menu-list > button {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px;
  background: none; border: 0; width: 100%; text-align: left; font-size: 13.5px; font-weight: 500; color: var(--text);
}
.menu-list > a:hover, .menu-list > button:hover, .menu-list > :focus-visible { background: var(--surface-2); outline: none; }
.menu-list .ico { width: 16px; height: 16px; color: var(--faint); }
.menu-list .danger, .menu-list .danger .ico { color: var(--red); }
.menu-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 100; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
@media (min-width: 900px) { .toasts { bottom: 24px; left: auto; right: 24px; transform: none; } }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; font-weight: 550; font-size: 13.5px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--pop-shadow); animation: pop .22s var(--ease);
}
.toast .ico { width: 16px; height: 16px; color: var(--green); }
.toast.error .ico { color: var(--red); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
