body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0b1020;
  color: #e8eefc;
}

* {
  box-sizing: border-box;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 16px calc(16px + 64px + env(safe-area-inset-bottom));
}

.muted {
  color: #9fb0d3;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.topbar-left {
  display: grid;
  gap: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  font-weight: 900;
  color: #e8eefc;
}

.profile-main {
  display: grid;
  gap: 2px;
}

.profile-name strong {
  font-size: 16px;
}

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr 110px 98px;
  gap: 8px;
  align-items: center;
}

.admin-head {
  font-size: 12px;
  font-weight: 800;
  color: #9fb0d3;
  padding: 0 2px;
}

.admin-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-sm {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.linkbtn {
  border: 0;
  padding: 0;
  background: transparent;
  color: #9fb0d3;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.iconbtn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #e8eefc;
  cursor: pointer;
  font-size: 20px;
  line-height: 34px;
}

.app {
  display: grid;
  gap: 10px;
}

.page {
  display: grid;
  gap: 10px;
}

.btn, .tab {
  background: #2b59ff;
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #e8eefc;
}

.btn-danger {
  background: rgba(255, 60, 60, 0.22);
  border: 1px solid rgba(255, 60, 60, 0.35);
  color: #ffd6d6;
}

.btn-danger:hover {
  filter: brightness(1.07);
}

.field {
  display: grid;
  gap: 6px;
}

.inputwrap {
  position: relative;
  display: block;
}

.inputwrap .input {
  padding-right: 40px;
}

.helpbtn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #e8eefc;
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
  line-height: 20px;
  padding: 0;
}

.helpbtn:hover {
  filter: brightness(1.06);
}

.label {
  color: #9fb0d3;
  font-size: 12px;
  font-weight: 800;
}

.input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: #e8eefc;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.input:focus {
  border-color: rgba(43, 89, 255, 0.9);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal-card {
  position: relative;
  width: min(560px, 92vw);
  max-height: 80vh;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(11, 16, 32, 0.98);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.modal-title {
  font-weight: 900;
}

.modal-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.list {
  display: grid;
  gap: 8px;
}

.listbtn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  padding: 10px 12px;
  color: #e8eefc;
  cursor: pointer;
  font-weight: 800;
}

.listbtn:hover {
  filter: brightness(1.05);
}

.sub {
  color: #9fb0d3;
  font-weight: 700;
  font-size: 12px;
}

.empty {
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: #9fb0d3;
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.item-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.item-title strong {
  font-size: 16px;
}

.meta {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px 10px;
  font-size: 14px;
}

.k {
  color: #9fb0d3;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.badge-ok {
  background: rgba(0, 200, 100, 0.15);
  color: #b9ffd6;
}

.badge-warn {
  background: rgba(255, 190, 0, 0.15);
  color: #ffe6a7;
}

.badge-muted {
  background: rgba(255, 255, 255, 0.10);
  color: #e8eefc;
}

.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(11, 16, 32, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.tab {
  background: rgba(255, 255, 255, 0.10);
  color: #e8eefc;
  padding: 10px 6px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
}

.tab.active {
  background: #2b59ff;
  color: white;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.35;
}

.debug {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  overflow: auto;
  max-height: 50vh;
}

.hidden {
  display: none;
}

