* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f6f7fb; color: #1f2937; }
#root { max-width: 1100px; margin: 0 auto; padding: 20px; }
.topbar { display:flex; align-items:center; justify-content:space-between; padding: 10px 0 20px; border-bottom: 1px solid #e5e7eb; margin-bottom: 20px; }
.brand { font-weight: 700; font-size: 18px; color: #111827; }
.userbar { font-size: 14px; color: #6b7280; }
.userbar button { margin-left: 10px; }

.hidden { display: none !important; }
.card { background: white; padding: 22px; border-radius: 10px; max-width: 380px; margin: 60px auto; box-shadow: 0 6px 24px rgba(0,0,0,0.06); }
.card h2 { margin-top: 0; }
.card form { display: flex; flex-direction: column; gap: 10px; }
.card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #4b5563; }
.card input { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
.card button { padding: 9px 14px; background: #2563eb; color: white; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; }
.card button:hover { background: #1d4ed8; }
.error { color: #dc2626; font-size: 13px; min-height: 18px; }
.hint { color: #6b7280; font-size: 12px; margin-top: 14px; }

.toolbar { display:flex; gap: 10px; margin-bottom: 12px; align-items: center; }
.toolbar input[type="search"] { flex: 0 0 280px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
.toolbar .check { font-size: 13px; color: #4b5563; display:flex; gap:6px; align-items:center; }
.grow { flex: 1 1 auto; }
.muted { color: #6b7280; font-size: 13px; }

table.users { width: 100%; background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); border-collapse: collapse; }
table.users th, table.users td { padding: 10px 12px; text-align: left; font-size: 14px; }
table.users thead { background: #f3f4f6; }
table.users th { font-weight: 600; color: #4b5563; }
table.users tr + tr td { border-top: 1px solid #f1f5f9; }
table.users td.actions { display:flex; gap:6px; justify-content: flex-end; }
table.users td.actions button { padding: 4px 8px; font-size: 12px; border: 1px solid #d1d5db; background: white; border-radius: 5px; cursor: pointer; }
table.users td.actions button.danger { color: #dc2626; border-color: #fecaca; }
table.users td.actions button.danger:hover { background: #fef2f2; }
table.users td.actions button:hover { background: #f3f4f6; }

.badge { display: inline-block; padding: 2px 7px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
.badge.banned { background: #fee2e2; color: #b91c1c; }
.badge.admin { background: #ddd6fe; color: #5b21b6; margin-left: 4px; }
.badge.oauth { background: #dbeafe; color: #1e40af; margin-left: 4px; }

.pager { display:flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.pager button { padding: 6px 12px; border: 1px solid #d1d5db; background: white; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pager button:disabled { opacity: 0.4; cursor: default; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #111827; color: white; padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.2); z-index: 1000; }
.toast.error { background: #b91c1c; }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid #e5e7eb; }
.tab { padding: 8px 14px; background: transparent; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-size: 14px; color: #6b7280; text-decoration: none; display: inline-block; }
.tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.tab:hover { color: #1f2937; }

.toolbar input[type="text"] { flex: 0 0 280px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
#newSvcBtn { padding: 8px 14px; background: #2563eb; color: white; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; }
#newSvcBtn:hover { background: #1d4ed8; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 999; display: flex; align-items: center; justify-content: center; }
.modal-card { background: white; padding: 24px; border-radius: 10px; max-width: 560px; width: 90%; box-shadow: 0 24px 60px rgba(0,0,0,0.4); }
.modal-card h3 { margin-top: 0; color: #b91c1c; }
.modal-card pre.key { background: #f3f4f6; padding: 12px; border-radius: 6px; font-family: ui-monospace, "SF Mono", monospace; font-size: 13px; user-select: all; word-break: break-all; white-space: pre-wrap; margin: 12px 0; }
.modal-card button { padding: 9px 14px; background: #2563eb; color: white; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; }

/* ─── APK upload tab ──────────────────────────────────────────────────── */
.apk-current {
  background: rgba(0,212,170,.06);
  border: 1px solid rgba(0,212,170,.18);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0 20px;
  font-size: 14px;
}
.apk-current a { color: #00d4aa; }
.apk-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 600px;
}
.apk-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border: 2px dashed rgba(0,212,170,.4);
  border-radius: 10px;
  cursor: pointer;
  background: rgba(0,212,170,.04);
  transition: border-color .15s, background .15s;
}
.apk-file:hover { border-color: rgba(0,212,170,.8); background: rgba(0,212,170,.08); }
.apk-file input { display: none; }
.apk-file span { color: #555; font-size: 14px; }
#apkSubmit {
  padding: 10px 24px;
  background: linear-gradient(135deg, #00d4aa, #00a584);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}
#apkSubmit:disabled { opacity: .6; cursor: not-allowed; }
#apkProgress { width: 100%; height: 6px; }
.success {
  color: #009870;
  background: rgba(0,212,170,.06);
  border: 1px solid rgba(0,212,170,.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
}
.success code { font-family: ui-monospace, monospace; font-size: 11px; word-break: break-all; }
