body { min-height: 100%; }
.adm-top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(8px + var(--safe-t)) 16px 8px 8px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.adm-top h1 { flex: 1; margin: 0; font-size: 19px; }
.adm { max-width: 1100px; margin: 0 auto; padding: 16px 16px calc(32px + var(--safe-b)); display: grid; gap: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .lbl { font-size: 13px; color: var(--muted); }
.tile .val { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .sub { font-size: 12.5px; color: var(--muted); }
.bar-meter { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.bar-meter i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.bar-meter i.warn { background: var(--accent); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-head input { max-width: 220px; min-height: 38px; padding: 7px 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; padding: 10px 16px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag.a { background: var(--brand-soft); color: var(--brand); }
.tag.b, .tag.c { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.tag.lock { background: var(--text); color: var(--surface); }
.acts { display: flex; gap: 2px; justify-content: flex-end; flex-wrap: wrap; }
.acts .btn { min-height: 34px; padding: 0 10px; font-size: 13.5px; }
.empty { padding: 18px 16px; color: var(--muted); }
.usage { min-width: 120px; }
.usage .bar-meter { margin-top: 4px; }

.form-grid { display: grid; gap: 14px; }
.form-grid > label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.modes { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.modes legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.mode, .switch { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; font-weight: 400; }
.mode:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.mode input, .switch input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.mode span, .switch span { display: grid; gap: 2px; }
.mode small, .switch small { color: var(--muted); font-size: 13px; }
.row.end { justify-content: flex-end; }

/* Bảng người dùng thành thẻ trên điện thoại */
@media (max-width: 760px) {
  .adm-top .btn span { display: none; }
  .adm-top .btn { width: 44px; padding: 0; }
  table.t thead { display: none; }
  table.t, table.t tbody, table.t tr, table.t td { display: block; width: 100%; }
  table.t tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.t td { border: 0; padding: 4px 16px; }
  table.t td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 13px; }
  table.t .num { text-align: left; }
  .acts { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px; }
  .tile .val { font-size: 21px; }
}
.panel-body { padding: 12px 16px; }
