:root {
  --green: #4caf6e;
  --green-dark: #3a9a5b;
  --green-soft: #eaf7ef;
  --green-line: #cfeedd;
  --green-ink: #1d6b3f;
  --accent: #62c873;
  --primary-rgb: 76, 175, 110;
  --ink: #111827;
  --muted: #5b6472;
  --line: #e5e9ef;
  --bg: #f8fafc;
  --card: #fff;
  --red: #d64545;
  --amber: #c98a1b;
  --blue: #2f6fdb;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 24px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 15px; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
.ico { vertical-align: middle; flex: none; }
code, pre, .mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .85em; }

/* Tombol & form */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; background: var(--green); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--green-dark); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(var(--primary-rgb), .35); outline-offset: 1px; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #f3f5f8; }
.btn.danger { background: #fff; color: var(--red); border-color: #f1c9c9; }
.btn.danger:hover { background: #fdf1f1; }
.btn.sm { padding: 6px 12px; border-radius: 10px; font-size: .88em; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
label { display: block; font-weight: 600; margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
.field { margin-bottom: 18px; }
.hint { color: var(--muted); font-size: .86em; margin-top: 6px; }
.row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* Kartu */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card h2 { font-size: 1.1rem; }
.grid { display: grid; gap: 20px; }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tile { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--green-dark)); box-shadow: 0 6px 14px rgba(var(--primary-rgb), .28); }

/* Badge */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eef1f5; color: #475467; }
.badge.sent, .badge.connected { background: #e5f6ec; color: #1f7a45; }
.badge.delivered { background: #e3f0ff; color: #1d5bb8; }
.badge.read { background: #e0f4f4; color: #0b7a7a; }
.badge.failed, .badge.disconnected { background: #fdeaea; color: #b42323; }
.badge.pending, .badge.processing, .badge.connecting, .badge.qr { background: #fff4de; color: #96600a; }
.badge.cancelled { background: #eceff3; color: #667085; }

/* Alert */
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; border: 1px solid; }
.alert.success { background: var(--green-soft); border-color: var(--green-line); color: var(--green-ink); }
.alert.error { background: #fdf1f1; border-color: #f3c9c9; color: #a12b2b; }
.alert ul { margin: 4px 0 0; padding-left: 20px; }

/* Tabel */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.msg { max-width: 360px; word-break: break-word; }

/* Landing */
.topbar { display: flex; align-items: center; justify-content: space-between; max-width: 1180px; margin: 0 auto; padding: 18px 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .tile { width: 40px; height: 40px; border-radius: 10px; }
.hero { max-width: 860px; margin: 0 auto; padding: 56px 24px 40px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 620px; margin: 0 auto 28px; }
.section { max-width: 1180px; margin: 0 auto; padding: 40px 24px 72px; }
.section h2 { text-align: center; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.section > p.sub { text-align: center; color: var(--muted); margin: 0 0 40px; font-size: 1.05rem; }
.grid.features { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .grid.features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid.features { grid-template-columns: 1fr; } }
.feature { padding: 30px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); border: 1px solid #eef1f5; }
.feature h3 { font-size: 1.25rem; margin: 22px 0 10px; }
.feature p { margin: 0; color: var(--muted); font-size: 1.02rem; }
.footer { text-align: center; color: var(--muted); padding: 28px; border-top: 1px solid var(--line); font-size: .9rem; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: 100%; max-width: 400px; }

/* Admin */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.side .brand { padding: 0 8px 18px; }
.side a.nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #344054; font-weight: 600; }
.side a.nav:hover { background: #f3f6f9; text-decoration: none; }
.side a.nav.active { background: var(--green-soft); color: var(--green-ink); }
.side .spacer { flex: 1; }
.side form button { width: 100%; background: none; border: 0; cursor: pointer; font: inherit; text-align: left; }
.main { padding: 28px 32px 60px; min-width: 0; max-width: 1200px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .n { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-weight: 600; font-size: .88rem; }
.toggle-menu { display: none; }

/* Chart */
.chart { width: 100%; height: 200px; display: block; }
.legend { display: flex; gap: 16px; font-size: .85rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.bar { height: 10px; background: #eef1f5; border-radius: 999px; overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; }

/* Device */
.device { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: #fff; }
.device + .device { margin-top: 16px; }
.device-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.keybox { display: flex; gap: 8px; align-items: center; background: #f6f8fa; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; }
.keybox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.qr { text-align: center; }
.qr img { width: 280px; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
dialog { border: 0; border-radius: var(--radius); padding: 28px; width: min(420px, 92vw); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(16, 24, 40, .5); }

/* Pilihan kartu (radio) */
.pre { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: 12px; overflow-x: auto; margin: 0 0 12px; white-space: pre; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: #fff; padding: 6px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--green-soft); border-color: var(--green-line); color: var(--green-ink); }
.phone-preview { background: #e7ded3; border-radius: 16px; padding: 18px; }
.bubble { background: #d9fdd3; padding: 10px 14px; border-radius: 12px 12px 2px 12px; white-space: pre-wrap; word-break: break-word; max-width: 100%; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 18px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 20; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .side.open { transform: none; }
  .toggle-menu { display: inline-flex; margin-bottom: 14px; }
  .main { padding: 18px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Wizard setup */
.wizard { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; }
.wiz-head { margin-bottom: 22px; }
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 22px; justify-content: space-between; }
.steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); font-weight: 600; position: relative; }
.steps li::before { content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.current::before { background: var(--green); }
.steps .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); z-index: 1; font-weight: 700; }
.steps li.current .dot { border-color: var(--green); color: var(--green-dark); }
.steps li.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.steps li.current { color: var(--ink); }
.wiz-card h1 { font-size: 1.5rem; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.check .mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; color: #fff; background: var(--green); }
.check.warn .mark { background: var(--amber); }
.check.error .mark { background: var(--red); }
.check.error { border-color: #f3c9c9; background: #fdf8f8; }
.check.warn { border-color: #f3e2bf; background: #fffcf5; }
table.summary th { width: 150px; text-transform: none; font-size: .9rem; letter-spacing: 0; color: var(--muted); }
@media (max-width: 560px) { .steps .lbl { display: none; } }


/* ===== Dashboard modern ===== */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), .45); } 100% { box-shadow: 0 0 0 10px rgba(var(--primary-rgb), 0); } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes float-blob { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(18px, -12px) scale(1.08); } }
.rise { opacity: 0; animation: rise .55s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 70ms); }

.hero-card { position: relative; overflow: hidden; border-radius: 24px; padding: 30px 32px; color: #fff; margin-bottom: 24px;
  background: linear-gradient(120deg, var(--green-dark), var(--green) 55%, var(--accent)); box-shadow: 0 18px 40px -16px rgba(var(--primary-rgb), .55); }
.hero-card::before, .hero-card::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .13); animation: float-blob 9s ease-in-out infinite; }
.hero-card::before { width: 260px; height: 260px; right: -60px; top: -90px; }
.hero-card::after { width: 160px; height: 160px; right: 140px; bottom: -80px; animation-delay: -4s; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 6px; }
.hero-card p { margin: 0; opacity: .92; max-width: 560px; }
.hero-card .btn { background: #fff; color: var(--green-ink); margin-top: 16px; }
.hero-card .live { position: absolute; right: 24px; top: 20px; z-index: 1; display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; background: rgba(255, 255, 255, .18); padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(6px); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse-ring 1.6s infinite; }

.kpis { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.kpi { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.kpi:hover { transform: translateY(-4px); box-shadow: 0 14px 34px -14px rgba(16, 24, 40, .22); }
.kpi .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); margin-bottom: 14px; transition: transform .3s; }
.kpi:hover .ic { transform: rotate(-8deg) scale(1.08); }
.kpi .l { color: var(--muted); font-weight: 600; font-size: .86rem; }
.kpi .v { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 1rem; font-weight: 700; color: var(--muted); }
.kpi .meter { height: 6px; background: #eef1f5; border-radius: 99px; margin-top: 12px; overflow: hidden; }
.kpi .meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--accent)); transition: width 1.1s cubic-bezier(.2, .7, .2, 1); }
.kpi.warn .ic { background: #fff4de; color: #96600a; }
.kpi.blue .ic { background: #e3f0ff; color: #1d5bb8; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.1rem; }
.legend { display: flex; gap: 16px; font-size: .85rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.hatch { background: repeating-linear-gradient(45deg, #d64545 0 2px, #f4b4b4 2px 4px); }
.dash-cols { display: grid; align-items: start; gap: 20px; grid-template-columns: 1.7fr 1fr; margin-top: 20px; }
.dash-cols.even { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
@media (max-width: 1000px) { .dash-cols { grid-template-columns: 1fr; } }

.bars { position: relative; height: 230px; display: flex; align-items: flex-end; gap: 6px; padding: 8px 0 0 30px; border-bottom: 1px solid var(--line); }
.bars .grid-line { position: absolute; left: 30px; right: 0; border-top: 1px dashed #eef1f5; }
.bars .grid-line span { position: absolute; left: -30px; top: -9px; font-size: .7rem; color: #98a2b3; width: 24px; text-align: right; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; cursor: default; outline: none; }
.col .stack { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; transform-origin: bottom; }
.bars.animate .stack { animation: grow-y .8s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.col .seg { min-height: 0; transition: filter .2s, opacity .2s; }
.col .seg.ok { background: linear-gradient(180deg, var(--accent), var(--green)); border-radius: 5px 5px 0 0; }
.col .seg.bad { background: repeating-linear-gradient(45deg, #d64545 0 3px, #f4b4b4 3px 6px); border-radius: 5px 5px 0 0; }
.col .seg.ok:not(:first-child) { border-radius: 0; }
.col:hover .seg, .col:focus-visible .seg { filter: brightness(1.08); }
.bars:hover .col:not(:hover) .seg { opacity: .55; }
.col .hit { position: absolute; inset: -4px -2px; }
.xlabels { display: flex; gap: 6px; padding-left: 30px; margin-top: 6px; }
.xlabels span { flex: 1; text-align: center; font-size: .72rem; color: #98a2b3; }
.tip { position: absolute; z-index: 5; pointer-events: none; background: #101828; color: #fff; padding: 8px 12px; border-radius: 10px; font-size: .8rem; line-height: 1.5; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; white-space: nowrap; }
.tip.on { opacity: 1; transform: none; }
.tip b { display: block; margin-bottom: 2px; }

.ring-wrap { display: grid; place-items: center; position: relative; margin: 4px auto 12px; width: 150px; height: 150px; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-wrap .trk { stroke: #eef1f5; }
.ring-wrap .val { stroke: url(#ringGrad); transition: stroke-dashoffset 1.2s cubic-bezier(.2, .7, .2, 1); stroke-linecap: round; }
.ring-wrap .center { position: absolute; text-align: center; }
.ring-wrap .center b { font-size: 1.7rem; display: block; line-height: 1; }
.ring-wrap .center > span { font-size: .75rem; color: var(--muted); }
.srow { margin-bottom: 11px; }
.srow .t { display: flex; justify-content: space-between; font-size: .9rem; }
.srow .t strong { font-variant-numeric: tabular-nums; }
.srow .bar span { transition: width 1s cubic-bezier(.2, .7, .2, 1); }

.dev-list { display: grid; gap: 10px; }
.dev-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s, transform .2s; }
.dev-item:hover { border-color: var(--green-line); transform: translateX(3px); }
.led { width: 10px; height: 10px; border-radius: 50%; background: #c4cad4; flex: none; }
.led.connected { background: #2fb36a; animation: pulse-ring 1.8s infinite; }
.led.qr, .led.connecting { background: #e0a020; }
.recent-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); animation: rise .4s both; }
.recent-row:last-child { border-bottom: 0; }
.sys-strip { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 22px; }
.sys-strip div { background: var(--green-soft); border: 1px solid var(--green-line); border-radius: 16px; padding: 12px 16px; }
.sys-strip b { display: block; font-size: 1.35rem; color: var(--green-ink); font-variant-numeric: tabular-nums; }
.sys-strip span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f8fafc 50%, #eef1f5 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
details.tableview summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .85rem; margin-top: 10px; }

/* ===== Tema warna ===== */
.theme-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.preset { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: border-color .2s, transform .2s, box-shadow .2s; }
.preset:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.preset.on { border-color: var(--green); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .18); }
.preset .sw { display: flex; gap: 6px; margin-bottom: 8px; }
.preset .sw i { width: 28px; height: 28px; border-radius: 50%; display: block; }
.preset b { font-size: .95rem; }
.preset small { color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.colorpick { display: flex; align-items: center; gap: 12px; }
.colorpick input[type=color] { width: 52px; height: 52px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.colorpick .hexbox { display: flex; align-items: center; flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: #fff; }
.colorpick .hexbox span { color: var(--muted); }
.colorpick .hexbox input { border: 0; padding: 13px 8px; font-family: ui-monospace, Menlo, monospace; font-weight: 700; outline: none; text-transform: uppercase; }
.theme-preview { border: 1px dashed var(--green-line); border-radius: 16px; padding: 18px; background: var(--green-soft); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.contrast-note { font-size: .85rem; margin-top: 8px; }
.contrast-note.bad { color: #b42323; }
.role-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--green-soft); color: var(--green-ink); }
.role-badge.user { background: #eef1f5; color: #475467; }
.switch-line { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.switch-line input { width: 18px; height: 18px; accent-color: var(--green); }
@media (prefers-reduced-motion: reduce) { .rise, .col .stack, .hero-card::before, .hero-card::after, .dot-live, .led.connected { animation: none !important; opacity: 1; } }

/* Login: Google & Turnstile */
.or-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 16px 0; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.google-btn { width: 100%; justify-content: center; font-weight: 600; }
.secret-state { font-size: .85rem; margin-top: 6px; }
.secret-state.ok { color: var(--green-ink); }
.copybox { display: flex; gap: 8px; align-items: center; background: #f6f8fa; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; }
.copybox code { flex: 1; overflow-x: auto; white-space: nowrap; }

/* Hapus log */
.purge summary { cursor: pointer; }
.bulkbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fdf1f1; border: 1px solid #f3c9c9; border-radius: 12px; padding: 8px 14px; margin-bottom: 12px; animation: rise .25s both; }
.bulkbar[hidden] { display: none; }
.bulkbar .btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.bulkbar .btn.danger:hover { background: #b83a3a; }

/* Hapus device */
.btn.danger-soft { background: #fff; color: #c13030; border: 1px solid #f0c4c4; }
.btn.danger-soft:hover { background: #fdf1f1; border-color: #e49a9a; }
.btn.danger-solid { background: #d64545; color: #fff; border: 1px solid #d64545; }
.btn.danger-solid:hover { background: #b83a3a; }
.btn.danger-solid:disabled { opacity: .7; cursor: wait; }
#delDialog { width: min(440px, 92vw); padding: 0; }
#delForm { padding: 28px; }
#delDialog[open] { animation: rise .25s both; }
.del-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: #fdecec; color: #d64545; }
.del-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: #475467; }
.del-list li[hidden] { display: none; }
