/* Dashboard user lptech-wd — mobile first, gaya iOS. */
:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --card: #ffffff;
  --field: #ffffff;
  --text: #1c1c1e;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, .18);
  --accent: #0b6b4f;
  --accent-2: #10b981;
  --tint: rgba(16, 185, 129, .12);
  --on-accent: #ffffff;
  --danger: #d70015;
  --warn: #b25000;
  --bar: rgba(242, 242, 247, .84);
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 10px 28px rgba(0, 0, 0, .07);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --field: #2c2c2e;
    --text: #f2f2f7;
    --muted: #98989d;
    --line: rgba(84, 84, 88, .55);
    --accent: #34d399;
    --accent-2: #34d399;
    --tint: rgba(52, 211, 153, .14);
    --on-accent: #06281d;
    --danger: #ff453a;
    --warn: #ff9f0a;
    --bar: rgba(0, 0, 0, .74);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 24px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.has-nav { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
body.busy { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
h2, h3, p { margin-top: 0; }

/* ---------- Header ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bar);
  border-bottom: .5px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; }
.logo {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  object-fit: cover;
  background: var(--card);
  flex: none;
}
.brand-text { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.bar-right { display: flex; align-items: center; gap: 4px; min-width: 0; }
.bar-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
  line-height: 1.2;
  margin-right: 2px;
}
.bar-user b { font-size: 12px; font-weight: 600; }
.bar-user small { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
@media (max-width: 420px) {
  .bar-user b { font-size: 11px; }
  .bar-user small { max-width: 30vw; }
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--muted);
  flex: none;
}
.icon-btn:active { background: var(--field); }
.icon-btn.on { color: var(--accent); background: var(--tint); }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.panels { min-width: 0; }
.view { padding: 18px 0 8px; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 14px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.2px; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.row-head h3 { margin: 0; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 8px 0; }
.mt0 { margin-top: 0; }
.center { text-align: center; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--field); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--tint); color: var(--accent); }
.badge.warn { background: rgba(255, 159, 10, .15); color: var(--warn); }
.badge.danger { background: rgba(215, 0, 21, .1); color: var(--danger); }

/* ---------- Tombol ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--field);
  font-size: 16px;
  font-weight: 600;
}
.btn:active { opacity: .82; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn + .btn { margin-top: 10px; }
.btn + .btn { margin-top: 10px; }

/* ---------- Tab / navigasi ---------- */
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--bar);
  border-top: .5px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}
.tab.on { color: var(--accent); background: var(--tint); }
.tab .ic { width: 22px; height: 22px; }
@media (min-width: 820px) {
  body.has-nav { padding-bottom: 24px; }
  .admin-shell { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 20px; align-items: start; min-width: 0; }
  .tabs {
    position: sticky;
    top: 76px;
    left: auto;
    right: auto;
    bottom: auto;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border: .5px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
  }
  .tab { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 11px 12px; font-size: 14px; }
  .tab .ic { width: 20px; height: 20px; }
}

/* ---------- Placeholder & info ---------- */
.soon {
  display: inline-block;
  margin: 2px 0 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .2px;
}
.count {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}
.count small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.mono { font-family: ui-monospace, Menlo, monospace; }

/* ---------- Login ---------- */
.view.narrow { max-width: 460px; margin: 0 auto; }
.lead { padding: 4px 4px 2px; }
.lead h1 { font-size: 24px; letter-spacing: -.5px; margin: 0 0 4px; }
.lbl { display: block; margin: 0 0 14px; color: var(--muted); font-size: 13px; font-weight: 600; }
.field {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--field);
  color: var(--text);
  font-size: 16px;
  outline: none;
  box-shadow: 0 0 0 1px var(--line) inset;
}
.field:focus { box-shadow: 0 0 0 2px var(--accent-2) inset; }
.field::placeholder { color: var(--muted); opacity: .7; }
.token-input {
  letter-spacing: 1.6px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 17px;
  text-transform: uppercase;
}
.msg { min-height: 1.3em; margin: 10px 0 0; color: var(--danger); font-size: 13.5px; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .45);
}
.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow: auto;
  padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
  background: var(--card);
  border-radius: 22px 22px 0 0;
}
.modal-card h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.2px; }
.modal-card p { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.modal-actions { display: flex; gap: 8px; }
.modal-actions .btn { flex: 1; }
@media (min-width: 820px) {
  .modal { align-items: center; padding: 20px; }
  .modal-card { border-radius: 22px; }
}

/* ---------- Toast & spinner ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: 90vw;
  padding: 10px 16px;
  border-radius: 999px;
  background: #1c1c1e;
  color: #fff;
  font-size: 13px;
  text-align: center;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}
@media (min-width: 820px) { .toast { bottom: 28px; } }
#spin {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  place-items: center;
  background: rgba(127, 127, 127, .12);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  touch-action: none;
  overscroll-behavior: contain;
}
#spin.on { display: grid; }
#spin::after {
  content: "";
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
