:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #d8dee8;
  --line-soft: #e7ebf2;
  --text: #18212f;
  --muted: #6b7688;
  --accent: #2563eb;
  --accent-soft: #e8f0ff;
  --green: #13845b;
  --green-soft: #e8f7ef;
  --amber: #a65f00;
  --amber-soft: #fff4dc;
  --red: #c33445;
  --red-soft: #fff0f2;
  --violet: #6d4aff;
  --violet-soft: #f0edff;
  --shadow: 0 14px 34px rgba(22, 34, 51, 0.08);
  --radius: 8px;
  --sans: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.55), transparent 28%),
    rgba(244, 246, 249, 0.42);
  backdrop-filter: blur(3px);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.admin-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

body.auth-locked .admin-shell {
  filter: blur(18px) saturate(0.72) brightness(0.96);
  opacity: 0.62;
  pointer-events: none;
  user-select: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: #111827;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 4px;
  color: #aeb7c6;
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 6px;
  padding-top: 18px;
}

.nav-item {
  height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: #253247;
  color: #fff;
}

.main {
  min-width: 0;
  padding: 18px 22px 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: -18px -22px 20px;
  padding: 14px 22px;
  background: rgba(244, 246, 249, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.global-search {
  display: grid;
  grid-template-columns: auto minmax(260px, 520px) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.global-search span {
  color: var(--muted);
  font-size: 13px;
}

.top-actions,
.head-actions,
.inline-controls,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input,
select {
  height: 38px;
  padding: 0 11px;
}

textarea {
  min-height: 72px;
  padding: 9px 11px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7aa4ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 13px;
  white-space: nowrap;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.secondary-button {
  background: #eef2f7;
  color: var(--text);
}

.danger-button {
  background: var(--red-soft);
  color: var(--red);
}

.ghost-button {
  background: transparent;
  color: var(--accent);
}

.icon-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #eef2f7;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.view-head h1 {
  font-size: 25px;
  letter-spacing: 0;
}

.view-head p,
.panel-head span,
.form-message {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card,
.panel,
.empty-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 15px;
  min-height: 94px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 9px;
  font-size: 25px;
  letter-spacing: 0;
}

.metric-card small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

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

.content-grid {
  grid-template-columns: 300px minmax(0, 1fr);
}

.api-grid {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.ai-route-grid {
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
}

.panel {
  padding: 16px;
  margin-bottom: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 16px;
}

.wide-panel {
  min-width: 0;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.8fr) repeat(2, minmax(120px, 0.7fr)) repeat(2, minmax(130px, 0.7fr)) repeat(2, minmax(110px, 0.6fr)) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #fff;
}

.ai-route-table {
  min-width: 1080px;
}

.data-table th,
.data-table td {
  padding: 12px 11px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  background: #f8fafc;
  color: #526174;
  font-size: 12px;
  font-weight: 700;
}

.data-table tbody tr:hover {
  background: #fbfdff;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.member-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
}

.member-cell strong,
.member-cell span {
  display: block;
}

.member-cell span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.tag-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge,
.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.badge {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.green,
.status-pill.success {
  background: var(--green-soft);
  color: var(--green);
}

.badge.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.red,
.status-pill.danger {
  background: var(--red-soft);
  color: var(--red);
}

.badge.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.tag {
  background: #edf1f6;
  color: #526174;
}

.tag.green {
  background: var(--green-soft);
  color: var(--green);
}

.tag.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.red {
  background: var(--red-soft);
  color: var(--red);
}

.tag.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.amount-positive {
  color: var(--green);
  font-weight: 700;
}

.amount-negative {
  color: var(--red);
  font-weight: 700;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  color: var(--muted);
}

.chart {
  height: 250px;
  min-height: 250px;
}

.chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart .axis-label,
.chart .empty-label {
  fill: var(--muted);
  font-size: 12px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 250px;
}

.donut-wrap svg {
  width: 180px;
  height: 180px;
}

.legend {
  display: grid;
  gap: 10px;
}

.legend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.legend-item strong {
  color: var(--text);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.package-card {
  min-height: 154px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.package-card strong {
  display: block;
  margin: 6px 0;
  font-size: 24px;
}

.package-card span,
.package-card small {
  display: block;
  color: var(--muted);
}

.rule-list {
  display: grid;
  gap: 12px;
}

.rule-list div {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
}

.rule-list strong,
.rule-list span {
  display: block;
}

.rule-list span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.settings-form {
  display: grid;
  gap: 10px;
}

select[multiple] {
  height: 116px;
  padding: 8px;
}

select[multiple] option {
  padding: 6px;
}

.home-card-category-field {
  grid-column: span 2;
}

.home-card-category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.home-card-category-option {
  min-height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 4px 10px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
}

.home-card-category-option:hover {
  border-color: #7aa4ff;
  color: #1d4ed8;
}

.home-card-category-option[aria-pressed="true"] {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.home-card-category-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

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

.form-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-category-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  margin-bottom: 20px;
  padding: 6px;
  overflow-x: auto;
  background: #111827;
  border: 1px solid #263247;
  border-radius: 8px;
  scrollbar-width: thin;
}

.home-category-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  background: transparent;
  color: #cbd5e1;
  font-weight: 650;
  white-space: nowrap;
}

.home-category-tab:hover {
  background: #253247;
  color: #fff;
}

.home-category-tab.active {
  background: #fff;
  color: #18212f;
}

.home-category-tab.is-disabled {
  color: #8190a5;
}

.home-category-tab small {
  min-width: 18px;
  color: inherit;
  font-size: 11px;
  text-align: center;
  opacity: 0.72;
}

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

.home-manage-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.home-manage-card:hover,
.home-manage-card:focus-visible {
  border-color: #7aa4ff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.16);
  outline: none;
  transform: translateY(-2px);
}

.home-manage-card.is-disabled {
  opacity: 0.58;
}

.home-manage-card-visual {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #e9eef5;
}

.home-manage-card-visual > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-manage-card-fallback {
  display: grid;
  height: 100%;
  place-content: center;
  gap: 10px;
  padding: 18px;
  background: linear-gradient(150deg, #172554, #2563eb 62%, #60a5fa);
  color: #fff;
  text-align: center;
}

.home-manage-card-fallback b {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-size: 30px;
}

.home-manage-card-fallback small {
  font-size: 12px;
  opacity: 0.86;
}

.home-manage-card-state {
  position: absolute;
  top: 9px;
  right: 9px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 12px;
  line-height: 24px;
}

.home-manage-card-info {
  display: grid;
  gap: 3px;
  padding: 10px 2px 2px;
}

.home-manage-card-category,
.home-manage-card-info small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-manage-card-category {
  color: var(--accent);
  font-weight: 650;
}

.home-manage-card-info strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-card-empty {
  display: grid;
  min-height: 188px;
  grid-column: 1 / -1;
  place-content: center;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.home-card-empty strong {
  color: var(--text);
}

.home-category-drawer {
  width: min(520px, 100%);
}

.home-card-editor-backdrop {
  align-items: flex-start;
  overflow-y: auto;
}

.modal.home-card-editor-modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  margin: auto;
  overflow-y: auto;
}

.home-card-editor-modal .modal-head {
  position: sticky;
  top: -18px;
  z-index: 1;
  margin: -18px -18px 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
}

.home-card-editor-modal .modal-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.admin-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.admin-list-row strong,
.admin-list-row span {
  display: block;
}

.admin-list-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.switch-field {
  align-content: start;
}

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

.media-upload-grid input[type="file"] {
  height: auto;
  min-height: 38px;
  padding: 7px 9px;
  color: var(--muted);
  font-size: 12px;
}

.home-media-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-media-item {
  min-width: 0;
}

.home-media-item > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.home-media-item img,
.home-media-empty {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-soft);
}

.home-media-item img {
  object-fit: cover;
}

.home-media-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.api-config-block {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.api-config-block .panel-head {
  margin: 0;
}

.api-config-block .panel-head h3 {
  font-size: 14px;
}

.api-json-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-card-cover-thumb {
  display: block;
  width: 42px;
  height: 56px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  object-fit: cover;
}

.home-card-cover-empty {
  display: grid;
  width: 42px;
  height: 56px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: var(--muted);
}

.home-card-table {
  min-width: 1040px;
}

.settings-table {
  min-width: 760px;
}

.feature-groups {
  display: grid;
  gap: 14px;
}

.feature-group-panel .panel-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.feature-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.feature-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.feature-card-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.feature-card strong,
.feature-card code,
.feature-card small {
  display: block;
}

.feature-card code {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: normal;
  word-break: break-all;
}

.feature-card small {
  color: var(--muted);
  font-size: 12px;
}

.compact-field {
  margin: 0;
}

.compact-field span {
  font-size: 12px;
}

.small-number {
  width: 120px;
}

.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.switch-line input {
  width: 18px;
  height: 18px;
  padding: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #334155;
}

.empty-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.empty-card {
  min-height: 120px;
  padding: 18px;
}

.empty-card strong,
.empty-card span {
  display: block;
}

.empty-card span {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.38);
}

.modal-backdrop.active {
  display: grid;
}

body.auth-locked #loginModal {
  z-index: 45;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
}

body.auth-locked #loginModal [data-close-modal] {
  display: none;
}

.modal {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
  padding: 18px;
}

.modal-head,
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

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

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 35;
  width: min(620px, 100%);
  height: 100vh;
  transform: translateX(100%);
  transition: transform 0.18s ease;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(15, 23, 42, 0.16);
  padding: 18px;
  overflow-y: auto;
}

.drawer.active {
  transform: translateX(0);
}

.drawer-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.drawer-body {
  display: grid;
  gap: 14px;
}

.detail-section {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
}

.detail-section h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

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

.detail-grid div {
  min-width: 0;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: none;
  max-width: min(420px, calc(100% - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
}

.toast.active {
  display: block;
}

@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .metric-grid,
  .package-grid,
  .feature-card-grid,
  .media-upload-grid,
  .home-media-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid,
  .content-grid,
  .empty-grid {
    grid-template-columns: 1fr;
  }

  .api-json-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .main {
    padding: 14px 12px 32px;
  }

  .topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
    margin: -14px -12px 16px;
    padding: 12px;
  }

  .global-search,
  .filter-bar,
  .side-nav,
  .metric-grid,
  .package-grid,
  .feature-card-grid,
  .media-upload-grid,
  .home-media-preview,
  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .home-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .home-category-tabs {
    margin-bottom: 14px;
  }

  .home-card-editor-backdrop {
    padding: 10px;
  }

  .modal.home-card-editor-modal {
    max-height: calc(100vh - 20px);
  }

  .home-card-editor-modal .form-grid {
    grid-template-columns: 1fr;
  }

  .home-card-category-field {
    grid-column: auto;
  }

  .form-grid-two {
    grid-template-columns: 1fr;
  }

  .admin-list-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .inline-controls,
  .view-head,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

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