* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f7fb;
  color: #1f2328;
}

a {
  text-decoration: none;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: #111827;
  color: #fff;
  padding: 24px 18px;
  flex-shrink: 0;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu a {
  color: #d1d5db;
  padding: 12px 14px;
  border-radius: 10px;
  transition: all .2s ease;
}

.menu a:hover,
.menu a.active {
  background: #2563eb;
  color: #fff;
}

.main-content {
  flex: 1;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.admin-user {
  color: #4b5563;
  font-size: 14px;
}

.alert {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 14px;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

.card h3 {
  margin: 0 0 10px 0;
  font-size: 15px;
  color: #6b7280;
}

.card p {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.panel {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

.inner-panel {
  margin-bottom: 18px;
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-item-full {
  grid-column: 1 / -1;
}

.form-item label {
  font-size: 14px;
  color: #374151;
  font-weight: 600;
}

input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
}

textarea {
  resize: vertical;
}

.checkbox-row {
  margin-top: 16px;
  margin-bottom: 10px;
}

.form-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-default {
  background: #e5e7eb;
  color: #111827;
}

.btn-warning {
  background: #f59e0b;
  color: #fff;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-edit {
  background: #10b981;
  color: #fff;
}

.btn-small {
  padding: 8px 10px;
  font-size: 13px;
}

.section-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-bar input,
.filter-bar select {
  max-width: 260px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.data-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #374151;
}

.empty-text {
  text-align: center;
  color: #6b7280;
  padding: 20px 10px;
}

.sub-text {
  color: #6b7280;
  font-size: 12px;
  margin-top: 4px;
}

.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-group-column {
  flex-direction: column;
}

.remark-form textarea {
  min-width: 180px;
  margin-bottom: 8px;
}

.status-tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-on {
  background: #dcfce7;
  color: #166534;
}

.status-off {
  background: #f3f4f6;
  color: #4b5563;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-review {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-paid {
  background: #e0f2fe;
  color: #0369a1;
}

.status-completed {
  background: #dcfce7;
  color: #166534;
}

.status-failed {
  background: #fee2e2;
  color: #b91c1c;
}

.status-info {
  background: #eef2ff;
  color: #4338ca;
}

.preview-box {
  margin-top: 12px;
}

.preview-image,
.table-thumb,
.qr-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #eee;
}

.table-thumb {
  width: 60px;
  height: 60px;
}

.qr-preview-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.wallet-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
}

.wallet-user-list,
.wallet-detail {
  min-width: 0;
}

.wallet-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  font-size: 14px;
}

.empty-card {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 24px;
  color: #6b7280;
}

.row-selected {
  background: #eff6ff;
}

@media (max-width: 1100px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-layout {
    grid-template-columns: 1fr;
  }

  .wallet-summary-grid,
  .info-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .admin-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .main-content {
    padding: 16px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}