@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #0a0d10;
  --bg-2: #0e1217;
  --panel: #11161d;
  --surface: #141a22;
  --surface-2: #1a2230;
  --accent: #f59f2a;
  --accent-2: #f7b23b;
  --card: var(--surface);
  --success: #2ecc71;
  --danger: #e74c3c;
  --text: #f5f7fb;
  --muted: #a3adba;
  --border: rgba(255, 255, 255, .08);
  --shadow: 0 18px 45px rgba(0, 0, 0, .45);
  --glow: 0 0 0 1px rgba(245, 159, 42, .25), 0 10px 30px rgba(245, 159, 42, .08);
  --ring: 0 0 0 2px rgba(245, 159, 42, .18);
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 18px;
  --radius-pill: 999px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 16px;
  --content-max: 1400px;
  --page-pad-y: 18px;
  --page-pad-x: 26px;
  --page-pad-bottom: 32px;
  --card-pad: 16px;
  --header-pad-x: var(--card-pad);
  --header-pad-y: calc(var(--card-pad) - 4px);
  --control-h: 40px;
  --control-h-sm: 34px;
  --control-pad: 10px 14px;
  --control-pad-sm: 8px 12px;
  --control-font-sm: 13px;
  --title-xl: 24px;
  --title-lg: 22px;
  --title-md: 18px;
  --stat-xl: 32px;
  --stat-lg: 28px;
  --stack-gap: 16px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

form {
  margin: 0;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Space Grotesk", "Manrope", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 10% -10%, rgba(245, 159, 42, .18), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(42, 180, 214, .10), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
}

a {
  color: inherit;
}

a:not(.btn):not(.btn-ghost):not(.btn-secondary):not(.btn-danger):not(.side-item):not(.link-ghost):not(.btn-small):hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.btn-ghost:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(245, 159, 42, .55);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: .2px;
}

h1 {
  font-size: var(--title-xl);
}

h2 {
  font-size: var(--title-lg);
}

h3 {
  font-size: var(--title-md);
}

h4 {
  font-size: 14px;
}

::selection {
  background: rgba(245, 159, 42, .28);
  color: #111;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
  color: var(--muted);
}

.note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.badge {
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-pill {
  border-radius: var(--radius-pill);
}

.paging {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

.paging a {
  color: var(--muted);
  text-decoration: none;
  background: rgba(255, 255, 255, .04);
  padding: var(--control-pad-sm);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.paging a:hover {
  background: rgba(245, 159, 42, .2);
  color: #fff;
  border-color: rgba(245, 159, 42, .5);
}

.row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.row-wrap {
  flex-wrap: wrap;
}

.form-inline,
.form-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.inline-block {
  display: inline-block;
}

.ml-8 {
  margin-left: 8px;
}

.ml-10 {
  margin-left: 10px;
}

.ml-12 {
  margin-left: 12px;
}

.field-w90 {
  width: 90px;
}

.field-w150 {
  width: 150px;
}

.field-w180 {
  width: 180px;
}

.field-w200 {
  width: 200px;
}

.field-w220 {
  width: 220px;
}

.title-muted {
  color: var(--muted);
  font-weight: 700;
}

div.ok,
div.err {
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

div.ok {
  background: rgba(46, 204, 113, .15);
  color: #caffde;
  border-color: rgba(46, 204, 113, .4);
}

div.err {
  background: rgba(231, 76, 60, .15);
  color: #ffd6d3;
  border-color: rgba(231, 76, 60, .4);
}

.mt-10 {
  margin-top: 10px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 6px;
}

.codechip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--border);
  color: #d1d5db;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02);
}

.icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.icon-sm {
  width: 14px;
  height: 14px;
}

.btn .icon,
.btn-ghost .icon,
.btn-secondary .icon,
.btn-danger .icon {
  margin-right: 6px;
}

/* Global search + toasts */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, .7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.search-overlay.active {
  display: flex;
}

.search-modal {
  width: min(860px, 92vw);
  max-height: 86vh;
  background: linear-gradient(180deg, rgba(20, 26, 34, .96), rgba(16, 20, 26, .96));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.search-title {
  font-size: 16px;
  font-weight: 800;
}

.search-input {
  width: 100%;
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-ban {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.quick-ban .field {
  min-width: 180px;
}

.search-results {
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.search-section {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
  padding: 12px;
}

.search-section h4 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.search-item:last-child {
  border-bottom: none;
}

.search-meta {
  color: var(--muted);
  font-size: 12px;
}

.search-actions-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 70;
}

/* Inline global search */
.search-inline {
  min-width: 220px;
  max-width: 300px;
  min-height: var(--control-h);
  height: auto;
}

/* Saved filters */
.saved-filter {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.saved-filter .field {
  min-width: 200px;
}

.filtergrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}

.admin-searchbar,
.log-searchbar,
.server-searchbar,
.log-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.server-searchbar {
  margin-top: 10px;
}

.admin-searchbar .field,
.log-searchbar .field {
  flex: 1 1 240px;
}

.admin-searchbar .btn,
.admin-searchbar .btn-ghost {
  flex: 0 0 auto;
}

/* Bulk actions */
.bulk-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.bulk-count {
  color: var(--muted);
  font-size: 12px;
}

.bulk-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  line-height: 1.2;
}

.bulk-check input {
  accent-color: var(--accent);
}

.inline-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  line-height: 1.2;
}

.inline-suffix {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .search-inline {
    min-width: 180px;
    max-width: 100%;
  }
}

.toast {
  background: rgba(15, 20, 26, .96);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.toast.success {
  border-color: rgba(46, 204, 113, .45);
}

.toast.error {
  border-color: rgba(231, 76, 60, .45);
}

.toast.warn {
  border-color: rgba(245, 159, 42, .45);
}

@media (max-width: 720px) {
  .search-modal {
    padding: 12px;
  }

  .search-actions,
  .quick-ban {
    flex-direction: column;
    align-items: stretch;
  }
}

table {
  width: 100%;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
}

.tbl th,
.tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  font-size: 13px;
}

.tbl th {
  text-align: left;
  color: #cfcfd3;
  background: rgba(15, 19, 24, .9);
  font-weight: 700;
}

.tbl th.col-check,
.tbl td.col-check {
  width: 36px;
  text-align: center;
}

table th,
table td {
  vertical-align: middle;
  word-break: break-word;
}

table .field {
  min-height: var(--control-h-sm);
  padding: 6px 10px;
  font-size: var(--control-font-sm);
}

label {
  font-weight: 600;
  color: #d7dbe3;
}

label.small {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
}

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

.sidebar {
  width: 88px;
  background: linear-gradient(180deg, #0b0f14, #0f151c);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: .5px;
  color: #111;
  background: linear-gradient(180deg, var(--accent), #d9891f);
  box-shadow: var(--glow);
}

.sidebar .logo-badge {
  background: linear-gradient(180deg, #2a3340, #1b222b);
  color: #e7edf6;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
}

.header .logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 13px;
}

.logo {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  font-weight: 700;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  align-items: center;
}

.side-item {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #d4d7dd;
  text-decoration: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0));
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02);
  transition: all .18s ease;
}

.side-item:hover {
  border-color: rgba(245, 159, 42, .5);
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  color: #fff;
}

.side-item.active {
  color: #131313;
  background: linear-gradient(180deg, var(--accent), #d98a22);
  box-shadow: var(--glow), 0 10px 25px rgba(245, 159, 42, .25);
  border-color: rgba(245, 159, 42, .6);
}

.side-item.active:hover {
  color: #131313;
}

.main-col,
.main {
  flex: 1;
  min-width: 0;
}

.content {
  padding: var(--page-pad-y) var(--page-pad-x) var(--page-pad-bottom);
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
}

.content section > .card + .card {
  margin-top: var(--stack-gap);
}

.header,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  row-gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--header-pad-y) var(--header-pad-x);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(10, 13, 16, .95), rgba(14, 18, 23, .85));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  width: 100%;
}

.header::after,
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(245, 159, 42, .45), transparent 70%);
  opacity: .7;
}

.header .title,
.topbar .title {
  font-size: var(--title-lg);
  font-weight: 700;
}

.header .subtitle,
.topbar .subtitle,
.header .small {
  font-size: 13px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  min-height: var(--control-h-sm);
  font-size: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02);
  white-space: nowrap;
}

.pill.live {
  border-color: rgba(46, 204, 113, .5);
  color: #caffde;
}

.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 12px rgba(46, 204, 113, .7);
}

.tab,
.segbtn,
.rowbtn,
.btn-small,
.check-pill {
  transition: border-color .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease;
}

.tab:hover,
.segbtn:hover,
.rowbtn:hover,
.btn-small:hover,
.check-pill:hover {
  border-color: rgba(245, 159, 42, .45);
  box-shadow: 0 8px 20px rgba(245, 159, 42, .14);
  color: #fff;
}

a.btn,
.btn,
.btn-ghost,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .2px;
  white-space: nowrap;
  transition: transform .18s ease, filter .18s ease, border-color .18s ease;
  min-height: var(--control-h);
  padding: var(--control-pad);
}

.btn {
  background: linear-gradient(180deg, var(--accent), #d9891f);
  color: #141414;
  box-shadow: 0 12px 26px rgba(245, 159, 42, .2);
}

.btn-ghost {
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.btn-secondary {
  background: rgba(255, 255, 255, .06);
  color: #fff;
  border: 1px solid var(--border);
}

.btn-danger {
  background: rgba(231, 76, 60, .2);
  color: #ffd6d3;
  border: 1px solid rgba(231, 76, 60, .6);
}

table .btn-secondary,
table .btn-danger,
.table-wrap .btn-secondary,
.table-wrap .btn-danger {
  min-height: var(--control-h-sm);
  padding: var(--control-pad-sm);
  font-size: var(--control-font-sm);
}

.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(245, 159, 42, .25);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
}

.btn:active,
.btn-ghost:active,
.btn-secondary:active,
.btn-danger:active {
  transform: translateY(0);
}

button:disabled,
.btn:disabled,
.btn-ghost:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: .6;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .02));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: var(--card-pad);
  margin: 0;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: box-shadow .18s ease, border-color .18s ease;
}

.card > strong:first-child {
  display: block;
  font-size: 13px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #e5e9f0;
  margin-bottom: 6px;
}

.card > strong:first-child + .small {
  margin-top: -2px;
  margin-bottom: 8px;
}

.card h2,
.card h3 {
  margin: 0 0 6px;
  font-size: var(--title-md);
}

.card h2 + .muted,
.card h3 + .muted {
  margin-top: -2px;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(245, 159, 42, .45), transparent 70%);
  opacity: .6;
  pointer-events: none;
}

.card:hover {
  box-shadow: 0 22px 55px rgba(0, 0, 0, .45), 0 0 0 1px rgba(245, 159, 42, .18);
  border-color: rgba(245, 159, 42, .35);
}

@media (hover: none) {
  .side-item:hover,
  .btn:hover,
  .card:hover {
    transform: none;
    filter: none;
  }

  .card:hover {
    box-shadow: var(--shadow);
  }

  .tab:hover,
  .segbtn:hover,
  .rowbtn:hover,
  .btn-small:hover,
  .check-pill:hover {
    box-shadow: none;
  }
}

.field,
input,
select,
textarea {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 10px 12px;
  background: rgba(12, 15, 19, .85);
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  min-height: 40px;
}

.field {
  width: 100%;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  touch-action: manipulation;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
  flex: 0 0 auto;
}

input::placeholder,
.field::placeholder,
textarea::placeholder {
  color: rgba(163, 173, 186, .7);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px rgba(12, 15, 19, .92) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.field:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(245, 159, 42, .6);
  box-shadow: var(--ring);
  background-color: rgba(15, 19, 24, .95);
}

.field:hover,
input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, .2);
}

.tabbar {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.btn-small,
.rowbtn,
.segbtn,
.tab,
.link-ghost,
.paging a {
  min-height: var(--control-h-sm);
  padding: var(--control-pad-sm);
  font-size: var(--control-font-sm);
  white-space: nowrap;
}

.link-ghost,
.paging a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  user-select: none;
  border-radius: 12px;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.tab.active {
  background: linear-gradient(180deg, rgba(245, 159, 42, .2), rgba(245, 159, 42, .08));
  border-color: rgba(245, 159, 42, .5);
  color: #fff;
  box-shadow: 0 10px 24px rgba(245, 159, 42, .16);
}

.tab:hover {
  border-color: rgba(245, 159, 42, .4);
  color: #fff;
}

.tbl thead th,
table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(15, 19, 24, .95);
  backdrop-filter: blur(6px);
}

.tbl tbody tr:hover,
table tbody tr:hover {
  background: rgba(245, 159, 42, .06);
}

::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .15);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .05);
}

@media (max-width: 900px) {
  :root {
    --page-pad-y: 14px;
    --page-pad-x: 16px;
    --page-pad-bottom: 24px;
    --stack-gap: 14px;
    --stat-xl: 28px;
  }

  .sidebar {
    width: 68px;
  }

  .content {
    max-width: none;
  }
}

@media (max-width: 720px) {
  :root {
    --page-pad-y: 12px;
    --page-pad-x: 12px;
    --page-pad-bottom: calc(96px + env(safe-area-inset-bottom));
    --stack-gap: 12px;
    --card-pad: 14px;
  }

  body {
    background-attachment: scroll;
  }

  .app {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: 72px;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-right: none;
    border-top: 1px solid var(--border);
    z-index: 20;
  }

  .logo-badge {
    display: none;
  }

  .side-nav {
    flex-direction: row;
    width: auto;
    gap: 8px;
  }

  .side-nav:last-child {
    margin-left: auto;
  }

  .content {
  }

  .side-item {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 12px;
  }

  .tabbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .tabbar::-webkit-scrollbar {
    height: 6px;
  }

  .tabbar .tab {
    flex: 0 0 auto;
  }

  .pill {
    font-size: 11px;
    padding: 4px 8px;
  }

  .btn,
  .btn-ghost,
  .btn-secondary,
  .btn-danger {
    padding: 8px 12px;
  }
}

@media (max-width: 640px) {
  .form-inline,
  .form-row,
  .actions,
  .paging,
  .log-actions,
  .log-searchbar,
  .admin-searchbar,
  .server-searchbar,
  .saved-filter,
  .bulk-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .btn,
  .actions .btn-ghost,
  .actions .btn-secondary,
  .actions .btn-danger {
    width: 100%;
    justify-content: center;
  }

  .admin-searchbar .btn,
  .admin-searchbar .btn-ghost,
  .log-actions .btn,
  .log-actions .btn-ghost,
  .log-searchbar .btn,
  .log-searchbar .btn-ghost,
  .saved-filter .btn,
  .saved-filter .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .field-w90,
  .field-w150,
  .field-w180,
  .field-w200,
  .field-w220 {
    width: 100%;
  }

  .inline-group {
    width: 100%;
  }
}

@media (max-width: 420px) {
  :root {
    --page-pad-y: 10px;
    --page-pad-x: 10px;
    --page-pad-bottom: calc(96px + env(safe-area-inset-bottom));
    --stack-gap: 10px;
    --card-pad: 12px;
    --stat-xl: 24px;
  }

  .content {
  }

  .pill {
    font-size: 10px;
    padding: 4px 6px;
  }

  .btn,
  .btn-ghost,
  .btn-secondary,
  .btn-danger {
    font-size: 12px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 18px;
  }

  h3 {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.header .right,
.header .controls,
.topbar .top-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.head-left {
  min-width: 0;
}

.head-left:not(.logo) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.head-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.content .header {
  margin-bottom: 0;
}
.actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.check-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(17, 17, 19, .9);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 10px;
  margin: 0;
}

.table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-top: var(--space-3);
  background: rgba(10, 13, 17, .35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

.link-ghost:hover {
  color: #fff;
  border-color: rgba(245, 159, 42, .4);
  background: rgba(255, 255, 255, .08);
}

.ban-check input,
.bulk-check input,
.check-pill input,
.inline-check input,
.tbl .col-check input,
table .col-check input {
  margin: 0;
}

.tbl td.col-check input,
table td.col-check input {
  display: block;
  margin: 0 auto;
}
