/* ==========================================================================
   Layanan Masuk Tunggal — tampilan
   ========================================================================== */
:root {
  --accent: #17346f;
  --accent-ink: color-mix(in srgb, var(--accent) 82%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 9%, #fff);
  --accent-ring: color-mix(in srgb, var(--accent) 22%, transparent);
  --gold: #d6a935;
  --bg: #f4f5f9;
  --surface: #fff;
  --line: #e4e7ef;
  --line-2: #eff1f6;
  --text: #0d1526;
  --text-2: #3f4860;
  --muted: #7a8298;
  --green: #12804a; --green-bg: #e7f7ee;
  --red: #c4302b;   --red-bg: #fdecec;
  --amber: #a15c07; --amber-bg: #fdf3e2;
  --blue: #1d4ed8;  --blue-bg: #e8effe;
  --violet: #6d28d9;--violet-bg: #f1eafe;
  --gray-bg: #eef0f4;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --shadow-lg: 0 30px 70px -28px rgba(13, 21, 38, .32);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; line-height: 1.25; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--line-2); padding: 2px 6px; border-radius: 6px; }
em { font-style: normal; color: var(--muted); font-weight: 500; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.text-danger { color: var(--red) !important; }
.mt { margin-top: 8px; }
.stack { display: grid; gap: 16px; align-content: start; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  font: 600 14px/1 var(--font); border: 1px solid transparent; cursor: pointer;
  text-decoration: none !important; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn .ic { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 16px -8px var(--accent); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: #cdd2de; background: #fafbfd; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a82722; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 50px; font-size: 15px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn.disabled { opacity: .4; pointer-events: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--line-2); color: var(--text); }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }

/* ---------- Formulir ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field > small, .field small { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid #dadfe9; background: #fff; color: var(--text);
  font: 500 14.5px var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.textarea { height: auto; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #a3aabb; font-weight: 400; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.select {
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8298' stroke-width='2' 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-sm, .select-sm { height: 34px; font-size: 13.5px; border-radius: 9px; padding-left: 10px; }
.select-sm { padding-right: 30px; background-position: right 8px center; }
.input-mono { font-family: var(--mono); letter-spacing: .02em; }
.input-code { height: 64px; text-align: center; font: 700 26px var(--mono); letter-spacing: .3em; text-transform: uppercase; }
.input-icon { position: relative; display: block; }
.input-icon > .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9aa2b5; pointer-events: none; }
.input-icon > .input { padding-left: 42px; }
.input-icon .reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #9aa2b5; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.input-icon .reveal:hover { color: var(--text); background: var(--line-2); }
.input-icon .reveal .ic { position: static; transform: none; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.input-suffix { position: relative; }
.input-suffix em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; }
.input-suffix .input { padding-right: 56px; }

.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input, .w-check input, [data-check-all] {
  width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0;
}

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { flex: none; width: 42px; height: 24px; border-radius: 99px; background: #d5dae4; position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px var(--accent-ring); }
.switch input:disabled + i { opacity: .55; }
.toggles { display: grid; gap: 14px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.form-actions.spread { justify-content: space-between; }

.radio-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.radio-card { position: relative; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card > span {
  display: grid; gap: 4px; height: 100%; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.radio-card .ic { color: var(--muted); margin-bottom: 4px; }
.radio-card strong { font-size: 14px; }
.radio-card small { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.radio-card input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-ring); }
.radio-card input:checked + span .ic { color: var(--accent); }

.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch i { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); transition: transform .15s; }
.swatch input:checked + i { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); transform: scale(.92); }
.color-field { display: inline-flex; align-items: center; gap: 10px; border: 1px solid #dadfe9; border-radius: var(--radius-sm); padding: 5px 12px 5px 6px; background: #fff; height: 44px; }
.color-field input[type=color] { width: 32px; height: 32px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 8px; }
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type=color]::-webkit-color-swatch { border: 0; border-radius: 8px; }
.color-field code { background: none; padding: 0; color: var(--text-2); }

.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { position: relative; cursor: pointer; }
.check-pill input { position: absolute; opacity: 0; }
.check-pill span {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 12px; border-radius: 99px;
  border: 1.5px solid var(--line); background: #fff; font-size: 13.5px; font-weight: 600; color: var(--text-2); transition: all .15s;
}
.check-pill span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); opacity: .35; transition: opacity .15s; }
.check-pill input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); color: var(--text); }
.check-pill input:checked + span::before { opacity: 1; }
.check-pill input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-ring); }

/* ---------- Lencana & chip ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; vertical-align: middle; }
.badge .ic { width: 13px; height: 13px; }
.badge.tiny { height: 19px; padding: 0 7px; font-size: 10.5px; letter-spacing: .02em; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }
.b-green { background: var(--green-bg); color: var(--green); }
.b-red { background: var(--red-bg); color: var(--red); }
.b-amber { background: var(--amber-bg); color: var(--amber); }
.b-blue { background: var(--blue-bg); color: var(--blue); }
.b-violet { background: var(--violet-bg); color: var(--violet); }
.b-gray { background: var(--gray-bg); color: #5a6378; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--text-2); background: color-mix(in srgb, var(--c, #64748b) 10%, #fff); border: 1px solid color-mix(in srgb, var(--c, #64748b) 22%, #fff); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, #64748b); }
.chip-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: none; }

.avatar {
  flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(140deg, var(--accent-soft), color-mix(in srgb, var(--accent) 18%, #fff));
  color: var(--accent); font-weight: 750; font-size: 13.5px; letter-spacing: .02em;
}
.avatar-sm { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 20px; font-size: 22px; }
.app-dot {
  flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c); font-weight: 800; font-size: 13px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 18%, transparent);
}
.app-dot.lg { width: 50px; height: 50px; border-radius: 15px; font-size: 16px; }

/* ---------- Catatan ---------- */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; margin: 0 0 16px; }
.note .ic { margin-top: 1px; }
.note-error { background: var(--red-bg); color: #8f1f1b; }
.note-info { background: var(--blue-bg); color: #1c3d97; }
.note-success { background: var(--green-bg); color: #0f6b3e; }
.hint { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px; }
.hint .ic { width: 15px; height: 15px; }

/* ==========================================================================
   Halaman publik (masuk, akun)
   ========================================================================== */
.auth { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.auth-brand {
  position: relative; overflow: hidden; color: #fff; padding: 56px clamp(40px, 5vw, 80px);
  background:
    radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--gold) 28%, transparent), transparent 60%),
    radial-gradient(700px 500px at -10% -20%, rgba(255,255,255,.14), transparent 60%),
    linear-gradient(155deg, color-mix(in srgb, var(--accent) 92%, #fff) 0%, var(--accent) 45%, color-mix(in srgb, var(--accent) 55%, #000) 100%);
}
.auth-brand::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}
.auth-brand-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-brand-text { max-width: 520px; }
.auth-brand h1 { font-size: clamp(30px, 3.1vw, 44px); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; margin: 14px 0 18px; text-wrap: balance; }
.auth-brand-sub { font-size: 16px; line-height: 1.65; color: rgba(255,255,255,.78); max-width: 440px; }
.auth-brand-foot { font-size: 13px; color: rgba(255,255,255,.6); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.auth-brand .eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--gold); border-radius: 2px; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; pointer-events: none; }
.orb-1 { width: 320px; height: 320px; background: var(--gold); right: -120px; top: 18%; opacity: .18; }
.orb-2 { width: 260px; height: 260px; background: #fff; left: 20%; bottom: -140px; opacity: .10; }

.brand-logo { display: block; object-fit: contain; filter: drop-shadow(0 10px 24px rgba(0,0,0,.25)); }
.brand-logo.brand-lg { height: 104px; width: auto; max-width: 240px; }
.brand-logo.brand-md { height: 64px; width: auto; }
.brand-logo.brand-sm { height: 40px; width: 40px; filter: none; }
.brand-fallback { display: inline-grid; place-items: center; border-radius: 22%; background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.brand-fallback .ic { width: 55%; height: 55%; }
.brand-fallback.brand-lg { width: 96px; height: 96px; }
.brand-fallback.brand-md { width: 60px; height: 60px; background: var(--accent); }
.brand-fallback.brand-sm { width: 40px; height: 40px; background: var(--accent); }

.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px 28px; }
.auth-mobile-brand { display: none; }
.auth-card {
  width: min(430px, 100%); background: var(--surface); border-radius: 26px; padding: 38px 36px 32px;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); position: relative;
}
.auth-head { margin-bottom: 24px; }
.auth-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.auth-head p { color: var(--muted); font-size: 14.5px; }
.auth-alt { margin-top: 22px; text-align: center; display: grid; gap: 8px; font-size: 14px; }
.auth-alt .muted { font-size: 13px; }
.auth-foot { margin-top: 26px; font-size: 12.5px; color: var(--muted); text-align: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: -4px; }

.app-context {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: -6px 0 24px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 14px;
}
.app-context small { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.app-context strong { font-size: 15px; }

.msg { text-align: center; padding: 6px 0; }
.msg-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.msg-icon .ic { width: 30px; height: 30px; }
.msg-icon.sm { width: 52px; height: 52px; border-radius: 16px; margin: 0 0 16px; }
.msg-icon.sm .ic { width: 24px; height: 24px; }
.msg-success .msg-icon { background: var(--green-bg); color: var(--green); }
.msg h2 { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.msg p { color: var(--text-2); line-height: 1.65; margin-bottom: 24px; }
.msg-actions { display: grid; gap: 10px; }

.account-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.account-head h2 { font-size: 21px; font-weight: 800; }
.account .chips { margin-bottom: 18px; }
.account-apps { margin: 4px 0 20px; }
.account-apps h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.account-app { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; color: var(--text); text-decoration: none !important; transition: background .15s; }
.account-app:hover { background: var(--bg); }
.account-app > span:nth-child(2) { flex: 1; display: grid; }
.account-app small { color: var(--muted); font-size: 12.5px; }
.account-app > .ic { color: var(--muted); }
.account .stack { gap: 10px; margin-bottom: 18px; }

.strength { height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; margin-top: 2px; }
.strength i { display: block; height: 100%; width: 0; background: var(--red); transition: width .25s, background .25s; }

/* ---------- Pemasangan ---------- */
.install { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 64px; display: grid; gap: 18px; }
.install-head { display: flex; gap: 18px; align-items: center; margin-bottom: 10px; }
.install-head h1 { font-size: 28px; font-weight: 800; margin: 4px 0 6px; }
.install-head .eyebrow { color: var(--accent); }
.install-form { display: grid; gap: 18px; }
.install-form .card { display: grid; gap: 16px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step > span { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; }
.step > span .ic { width: 16px; height: 16px; }
.step h2 { font-size: 17px; font-weight: 750; margin-bottom: 3px; }
.step p { color: var(--muted); font-size: 13.5px; }
.app-seed { display: grid; gap: 8px; }
.app-seed-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 14px; background: #fcfcfe; }
.app-seed-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.app-seed-name { display: grid; }
.app-seed-name small { color: var(--muted); font-size: 12px; }
.checklist { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.checklist li.ok .ic { color: var(--green); }
.checklist li.bad .ic { color: var(--red); }

/* ==========================================================================
   Konsol superadmin
   ========================================================================== */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px 14px; overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; margin-bottom: 6px; border-bottom: 1px solid var(--line-2); color: var(--text); text-decoration: none !important; }
.side-brand strong { display: block; font-size: 14.5px; line-height: 1.25; font-weight: 750; }
.side-brand small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.side-nav { display: grid; gap: 2px; }
.side-nav a {
  position: relative; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 11px;
  color: var(--text-2); font-weight: 600; text-decoration: none !important; transition: background .15s, color .15s;
}
.side-nav a .ic { color: #8c93a8; transition: color .15s; }
.side-nav a:hover { background: var(--bg); color: var(--text); }
.side-nav a.active { background: var(--accent-soft); color: var(--accent); }
.side-nav a.active .ic { color: var(--accent); }
.side-nav a.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-nav-sm a { height: 38px; font-size: 13.5px; }
.side-section { margin: 18px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--line-2); }
.side-user-text { flex: 1; min-width: 0; }
.side-user-text strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text small { color: var(--muted); font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 22px clamp(18px, 3vw, 40px) 18px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 25px; font-weight: 800; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { color: var(--muted); font-size: 13.5px; margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.back-link .ic { width: 15px; height: 15px; }
.content { padding: 4px clamp(18px, 3vw, 40px) 56px; width: 100%; max-width: 1280px; display: grid; gap: 18px; align-content: start; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); min-width: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 750; letter-spacing: -.01em; }
.card-head p { font-size: 13px; margin-top: 3px; }
.form-card .card-title { margin-bottom: 16px; }
.narrow { max-width: 820px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.split-wide { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }

/* Statistik */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat strong em { font-size: 16px; color: var(--muted); }
.stat small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.stat-ic .ic { width: 21px; height: 21px; }
.s-blue { background: var(--blue-bg); color: var(--blue); }
.s-violet { background: var(--violet-bg); color: var(--violet); }
.s-green { background: var(--green-bg); color: var(--green); }
.s-amber { background: var(--amber-bg); color: var(--amber); }
.s-red { background: var(--red-bg); color: var(--red); }

/* Persiapan */
.setup { background: linear-gradient(135deg, #fff 55%, var(--accent-soft)); }
.progress { width: 160px; height: 8px; border-radius: 9px; background: var(--line-2); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--gold))); border-radius: 9px; }
.setup-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.setup-list a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line-2); background: #fff; color: var(--text); font-weight: 600; font-size: 13.5px; text-decoration: none !important; transition: border-color .15s; }
.setup-list a:hover { border-color: var(--accent); }
.setup-list a > span:nth-child(2) { flex: 1; }
.setup-list a > .ic { color: var(--muted); }
.setup-num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--line-2); color: var(--text-2); font-weight: 800; font-size: 12.5px; flex: none; }
.setup-list .done a { color: var(--muted); }
.setup-list .done .setup-num { background: var(--green-bg); color: var(--green); }
.setup-list .done .setup-num .ic { width: 15px; height: 15px; }

/* Daftar aplikasi ringkas */
.app-list { display: grid; gap: 4px; margin: -6px; }
.app-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 13px; color: var(--text); text-decoration: none !important; transition: background .15s; }
.app-row:hover { background: var(--bg); }
.app-row-main { flex: 1; min-width: 0; display: grid; }
.app-row-main small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Kartu aplikasi */
.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.app-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 20px; background: var(--surface);
  border: 1px solid var(--line); color: var(--text); text-decoration: none !important; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.app-card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 90px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 9%, transparent), transparent); pointer-events: none; }
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.app-card-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.app-card h3 { font-size: 17px; font-weight: 750; }
.app-card-meta { display: grid; gap: 6px; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--text-2); }
.app-card-meta span { display: flex; align-items: center; gap: 8px; }
.app-card-meta .ic { width: 15px; height: 15px; color: var(--muted); }

/* Kartu kelompok */
.group-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.group-card { position: relative; padding: 20px 18px 16px; border-radius: 18px; background: #fff; border: 1px solid var(--line); color: var(--text); text-decoration: none !important; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.group-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.group-card-bar { position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--c); }
.group-card h3 { font-size: 16px; font-weight: 750; margin-bottom: 4px; }
.group-card-meta { display: flex; gap: 14px; margin-top: 14px; font-size: 12.5px; color: var(--text-2); }
.group-card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.group-card-meta .ic { width: 14px; height: 14px; color: var(--muted); }

/* Tab */
.tabs { display: flex; gap: 4px; padding: 4px; background: #e9ebf2; border-radius: 14px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 11px; font-weight: 650; font-size: 13.5px; color: var(--text-2); text-decoration: none !important; white-space: nowrap; }
.tabs a .ic { width: 16px; height: 16px; }
.tabs a.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(16,24,40,.1); }

/* Mode banner */
.mode-banner { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.mode-banner > .ic { width: 22px; height: 22px; margin-top: 2px; color: var(--accent); }
.mode-banner > div { flex: 1; }
.mode-banner p { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.mode-kode { background: linear-gradient(135deg, #fffaf0, #fff); border-color: #f3e2bd; }
.mode-kode > .ic { color: var(--amber); }
.mode-semua { background: linear-gradient(135deg, #f0fbf5, #fff); border-color: #cdebd9; }
.mode-semua > .ic { color: var(--green); }
.code-pill { display: inline-flex; align-items: center; gap: 6px; font: 700 13px var(--mono); letter-spacing: .12em; background: var(--surface); border: 1px dashed #d6c08f; color: var(--text); padding: 3px 9px; border-radius: 8px; cursor: pointer; }
.code-pill .ic { width: 13px; height: 13px; color: var(--muted); }

/* Daftar hak akses */
.inline-add { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.inline-add .input, .inline-add .select:not(.select-sm) { flex: 1; min-width: 160px; height: 38px; }
.inline-add .select-sm { height: 38px; }
.inline-add .btn-sm { height: 38px; }
.grant-list { list-style: none; margin: 0 -8px; padding: 0; display: grid; }
.grant-list li { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 12px; }
.grant-list li:hover { background: var(--bg); }
.grant-list li + li { border-top: 1px solid var(--line-2); }
.grant-list li:hover + li { border-top-color: transparent; }
.grant-main { flex: 1; min-width: 0; display: grid; color: var(--text); text-decoration: none !important; }
.grant-main strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grant-main small { color: var(--muted); font-size: 12.5px; }
.grant-list form { margin: 0; }
.empty-line { padding: 10px 0 2px; }
.filter-box { margin-bottom: 10px; }

/* Matriks akses */
.matrix { display: grid; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 6px; }
.matrix-head, .matrix-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(170px, 1fr) minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 14px; }
.matrix-head { background: #f8f9fc; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.matrix-row + .matrix-row, .matrix-head + .matrix-row { border-top: 1px solid var(--line-2); }
.matrix-app { display: flex; align-items: center; gap: 12px; min-width: 0; }
.matrix-app > span { display: grid; min-width: 0; }
.matrix-app small { color: var(--muted); font-size: 12px; }
.matrix-eff { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.matrix-eff small { color: var(--muted); font-size: 12px; }
.matrix-compact .matrix-row { grid-template-columns: minmax(0, 1fr) 170px; }
.matrix .app-dot { width: 32px; height: 32px; border-radius: 10px; font-size: 11.5px; }

/* Tabel */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 16px; background: #f8f9fc; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table-users tbody tr:hover { background: #fafbfd; }
.table-users tr.is-checked { background: var(--accent-soft) !important; }
.table-compact td, .table-compact th { padding: 9px 12px; font-size: 13.5px; }
.w-check { width: 44px; padding-right: 0 !important; }
.user-cell { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none !important; min-width: 0; }
.user-cell > span:last-child { display: grid; min-width: 0; }
.user-cell strong { font-size: 14px; }
.user-cell small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 220px; }
.toolbar .select { width: auto; min-width: 170px; }
.bulkbar {
  position: sticky; top: 88px; z-index: 15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px 10px 16px; margin-bottom: 12px; border-radius: 14px; background: var(--text); color: #fff; box-shadow: var(--shadow-lg);
  animation: rise .2s ease;
}
.bulkbar strong { margin-right: auto; font-size: 13.5px; }
.bulkbar .select { width: auto; background-color: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #fff; }
.bulkbar .select option { color: var(--text); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 13.5px; }

/* Aktivitas */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: flex; gap: 12px; padding: 10px 0; }
.feed li + li { border-top: 1px solid var(--line-2); }
.feed p { font-size: 13.5px; color: var(--text-2); }
.feed p strong { color: var(--text); }
.feed small { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.feed-full li { padding: 12px 20px; }
.feed .feed-day { padding: 10px 20px; background: #f8f9fc; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.feed-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: #c3c9d6; box-shadow: 0 0 0 4px #f0f2f6; }
.a-masuk, .a-masuk_aplikasi, .a-kode_akses, .a-daftar { background: #22a565; box-shadow: 0 0 0 4px var(--green-bg); }
.a-gagal_masuk, .a-akses_ditolak { background: #e0483f; box-shadow: 0 0 0 4px var(--red-bg); }
.a-keluar { background: #9aa2b5; }
.a-akses_diubah, .a-akses_dicabut, .a-pengguna_dibuat, .a-pengguna_diubah, .a-pengguna_dihapus, .a-sandi_direset,
.a-kelompok_dibuat, .a-kelompok_diubah, .a-kelompok_dihapus, .a-impor_pengguna { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.a-aplikasi_dibuat, .a-aplikasi_diubah, .a-aplikasi_dihapus, .a-unduh_penghubung, .a-pengaturan, .a-pasang, .a-cadangan { background: #8b5cf6; box-shadow: 0 0 0 4px var(--violet-bg); }

/* Kosong */
.empty { text-align: center; padding: 44px 20px; display: grid; justify-items: center; gap: 8px; }
.empty > .ic { width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: var(--bg); color: var(--muted); margin-bottom: 6px; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--muted); font-size: 13.5px; max-width: 380px; margin-bottom: 10px; }

/* Pemasangan per aplikasi */
.install-steps { display: grid; gap: 14px; }
.step-card { display: grid; gap: 16px; }
.file-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.file-tile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1.5px dashed #d3d8e4; color: var(--text); text-decoration: none !important; transition: border-color .15s, background .15s; }
.file-tile:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-tile > span:nth-child(2) { flex: 1; display: grid; }
.file-tile strong { font-family: var(--mono); font-size: 13.5px; }
.file-tile small { color: var(--muted); font-size: 12.5px; }
.file-tile > .ic { color: var(--accent); }
.file-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.file-ic.alt { background: var(--green-bg); color: var(--green); }
.connect-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--amber-bg); color: var(--amber); font-size: 13.5px; font-weight: 600; }
.connect-status > span { flex: 1; min-width: 200px; }
.connect-status.ok { background: var(--green-bg); color: var(--green); }
.copy-box { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fbfbfd; }
.copy-box-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--text-2); }
.copy-box-head span { display: inline-flex; align-items: center; gap: 8px; }
.copy-box-head .ic { width: 16px; height: 16px; color: var(--accent); }
.copy-box pre { margin: 0; padding: 14px 16px; font: 12.5px/1.65 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--text-2); max-height: 320px; overflow: auto; }
.details { border-top: 1px solid var(--line-2); padding-top: 12px; }
.details summary { cursor: pointer; font-weight: 650; font-size: 13.5px; color: var(--text-2); padding: 4px 0 12px; }
.details > *:not(summary) { margin-bottom: 12px; }
.danger-soft { border-color: #f2d6d4; }
.danger-soft .step > span { background: var(--red-bg); color: var(--red); }
.danger-zone { border-color: #f2d6d4; background: linear-gradient(180deg, #fffafa, #fff); }
.danger-zone .card-title { color: var(--red); margin-bottom: 6px; }
.danger-zone p { margin-bottom: 14px; font-size: 13.5px; }
.danger-inline { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.sec-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 12px; }
.sec-actions form { margin: 0; }

/* Kartu kata sandi */
.reveal-card { display: flex; gap: 16px; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: linear-gradient(135deg, var(--accent-soft), #fff 60%); }
.reveal-card-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.reveal-card h3 { font-size: 16px; margin-bottom: 4px; }
.cred { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.cred > div { display: grid; gap: 4px; }
.cred small { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.cred code { font-size: 17px; font-weight: 700; padding: 6px 12px; background: #fff; border: 1px solid var(--line); }

/* Pengaturan identitas */
.logo-field { display: flex; gap: 16px; align-items: center; }
.logo-preview { width: 120px; height: 120px; border-radius: 18px; display: grid; place-items: center; border: 1px solid var(--line); flex: none; overflow: hidden; }
.logo-preview img { max-width: 86%; max-height: 86%; object-fit: contain; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #eef0f5 25%, transparent 25%), linear-gradient(-45deg, #eef0f5 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eef0f5 75%), linear-gradient(-45deg, transparent 75%, #eef0f5 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.logo-actions { display: grid; gap: 10px; justify-items: start; }
.logo-actions small { font-size: 12.5px; line-height: 1.5; }
.preview-card { position: sticky; top: 100px; }
.mini-login { display: grid; grid-template-columns: 1.05fr 1fr; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 10.5; box-shadow: var(--shadow); }
.mini-brand { padding: 16px; color: #fff; display: flex; flex-direction: column; justify-content: center; gap: 4px; background: radial-gradient(240px 140px at 110% 110%, color-mix(in srgb, var(--gold) 30%, transparent), transparent), linear-gradient(155deg, color-mix(in srgb, var(--accent) 90%, #fff), var(--accent) 50%, color-mix(in srgb, var(--accent) 55%, #000)); }
.mini-logo { width: 42px; height: 42px; margin-bottom: 8px; display: grid; place-items: center; }
.mini-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mini-logo .ic { width: 30px; height: 30px; }
.mini-brand small { font-size: 7.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-weight: 800; }
.mini-brand strong { font-size: 12px; line-height: 1.25; font-weight: 800; }
.mini-form { background: var(--bg); padding: 14px; display: flex; flex-direction: column; justify-content: center; gap: 7px; }
.mini-form b { font-size: 11px; }
.mini-form i { display: block; height: 14px; border-radius: 5px; background: #fff; border: 1px solid var(--line); }
.mini-btn { display: block; text-align: center; font-size: 9px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 5px; padding: 4px; }
.info-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; margin: 18px 0 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 600; }

/* Impor */
.dropzone { position: relative; display: grid; justify-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed #d3d8e4; border-radius: 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone > .ic { width: 30px; height: 30px; color: var(--accent); margin-bottom: 4px; }
.dropzone small { color: var(--muted); font-size: 12.5px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.plain-list { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); display: grid; gap: 4px; }

/* Notifikasi */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: grid; gap: 10px; width: min(400px, calc(100vw - 36px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 12px 13px 14px; border-radius: 14px; background: var(--text); color: #fff; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); animation: rise .25s ease; }
.toast > span { flex: 1; line-height: 1.5; }
.toast > .ic { margin-top: 1px; }
.toast-success > .ic { color: #4ade80; }
.toast-error { background: #7f1d1d; }
.toast-error > .ic { color: #fca5a5; }
.toast-info > .ic { color: #fcd34d; }
.toast-x { border: 0; background: none; color: rgba(255,255,255,.6); cursor: pointer; padding: 0; display: grid; }
.toast-x .ic { width: 16px; height: 16px; }
.toast.hide { opacity: 0; transform: translateY(-6px); transition: all .3s; }
.public .toasts { position: static; width: auto; margin-bottom: 16px; }
.public .toast { background: var(--green-bg); color: #0f6b3e; box-shadow: none; }
.public .toast-error { background: var(--red-bg); color: #8f1f1b; }
.public .toast-x { color: inherit; }
.public .toast > .ic { color: inherit; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Dialog konfirmasi */
.confirm { border: 0; border-radius: 22px; padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.confirm::backdrop { background: rgba(13, 21, 38, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.confirm form { padding: 26px; display: grid; gap: 8px; }
.confirm-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--red-bg); color: var(--red); margin-bottom: 6px; }
.confirm h3 { font-size: 18px; font-weight: 800; }
.confirm p { color: var(--text-2); font-size: 14px; line-height: 1.6; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* Navigasi bawah (ponsel) */
.bottomnav { display: none; }
.scrim { display: none; }
.only-mobile { display: none !important; }

/* ==========================================================================
   Responsif
   ========================================================================== */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split-wide { grid-template-columns: minmax(0, 1fr); }
  .preview-card { position: static; }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 290px; height: auto;
    transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
  }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(13,21,38,.4); }
  .only-mobile { display: inline-grid !important; }
  .only-desktop { display: none !important; }
  .topbar { padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: 12px; }
  .topbar-title h1 { font-size: 21px; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { width: 40px; padding: 0; }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .bottomnav {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px); border-top: 1px solid var(--line);
  }
  .bottomnav a, .bottomnav button {
    display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border: 0; background: none; border-radius: 12px;
    font: 600 11px var(--font); color: var(--muted); text-decoration: none !important; cursor: pointer;
  }
  .bottomnav .ic { width: 22px; height: 22px; }
  .bottomnav a.active { color: var(--accent); }
  .bottomnav a.active .ic { stroke-width: 2.2; }
  .bulkbar { top: 72px; }
  .toasts { top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); right: 12px; left: 12px; width: auto; }
}

@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-main {
    justify-content: flex-start; padding: max(28px, env(safe-area-inset-top)) 16px 24px;
    background: radial-gradient(500px 260px at 100% 0%, color-mix(in srgb, var(--gold) 30%, transparent), transparent 70%),
                linear-gradient(180deg, var(--accent) 0, color-mix(in srgb, var(--accent) 70%, #000) 230px, var(--bg) 230px);
  }
  .auth-mobile-brand { display: flex; align-items: center; gap: 12px; width: min(430px, 100%); color: #fff; margin: 4px 0 22px; padding: 0 4px; }
  .auth-mobile-brand .brand-logo.brand-sm { width: 46px; height: 46px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
  .auth-mobile-brand .brand-fallback { background: rgba(255,255,255,.14); }
  .auth-mobile-brand strong { display: block; font-size: 16px; font-weight: 800; line-height: 1.25; }
  .auth-mobile-brand span { display: block; font-size: 12.5px; color: rgba(255,255,255,.75); }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .card { padding: 18px; border-radius: 16px; }
  .card-flush { padding: 0; }
  .grid-2, .grid-3, .radio-cards, .file-row { grid-template-columns: minmax(0, 1fr); }
  .stats { gap: 10px; }
  .stat { padding: 14px; gap: 12px; flex-direction: column; align-items: flex-start; }
  .stat strong { font-size: 23px; }
  .auth-card { padding: 28px 22px 24px; border-radius: 22px; }
  .auth-head h2 { font-size: 23px; }
  .hide-sm { display: none !important; }
  .table td, .table th { padding: 11px 12px; }
  .matrix-head { display: none; }
  .matrix-row { grid-template-columns: minmax(0, 1fr) 150px; }
  .matrix-compact .matrix-row { grid-template-columns: minmax(0, 1fr) 140px; }
  .toolbar .select { flex: 1; min-width: 0; }
  .inline-add .input, .inline-add .select:not(.select-sm) { min-width: 100%; }
  .inline-add .btn-sm, .inline-add .select-sm { flex: 1; }
  .app-seed-row { grid-template-columns: auto auto minmax(0, 1fr); }
  .app-seed-row .input { grid-column: 1 / -1; }
  .logo-field { flex-direction: column; align-items: flex-start; }
  .form-actions .btn { flex: 1; }
  .card-head { flex-wrap: wrap; }
  .install { padding-top: 28px; }
  .install-head { flex-direction: column; align-items: flex-start; }
  .reveal-card { flex-direction: column; }
  .mode-banner { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
