:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-strong: #f0f3f8;
  --text: #1f2430;
  --muted: #5f6673;
  --subtle: #8a92a1;
  --line: #e3e7ef;
  --line-strong: #d4dae6;
  --primary: #165dff;
  --primary-hover: #0e49d1;
  --primary-soft: #e8f3ff;
  --success: #00a870;
  --warning: #ff7d00;
  --danger: #f53f3f;
  --info: #165dff;
  --radius: 8px;
  --shadow: 0 14px 36px rgb(31 36 48 / 8%);
  --shadow-soft: 0 8px 22px rgb(31 36 48 / 6%);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #f7f9fd 0%, #f3f6fb 44%, #edf2f8 100%);
  color: var(--text);
}

[hidden] {
  display: none !important;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background:
    radial-gradient(circle at 28% 0%, rgb(22 93 255 / 8%), transparent 28%),
    linear-gradient(180deg, #f8fafd, #eef3f9);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 16%, rgb(22 93 255 / 14%), transparent 30%),
    linear-gradient(180deg, rgb(255 255 255 / 82%), rgb(242 246 252 / 100%)),
    linear-gradient(90deg, transparent 0 31px, rgb(227 231 239 / 58%) 31px 32px);
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 32px;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 98%), rgb(249 251 255 / 94%));
  box-shadow: 0 22px 70px rgb(31 36 48 / 12%);
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 10px;
}

.captcha-image-button {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0;
  background: #ffffff;
  cursor: pointer;
  overflow: hidden;
}

.captcha-image-button img {
  width: 100%;
  height: 38px;
  display: block;
  object-fit: cover;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.login-brand {
  padding-bottom: 4px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background:
    linear-gradient(135deg, #2f7dff 0%, #165dff 52%, #0e3ba7 100%);
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 24%),
    0 10px 22px rgb(22 93 255 / 24%);
}

.brand strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--subtle);
  font-size: 12px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 14px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 96%), rgb(247 249 253 / 94%));
  box-shadow: 8px 0 28px rgb(31 36 48 / 4%);
}

nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius);
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav-item::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #c4ccd8;
  box-shadow: 0 0 0 3px rgb(196 204 216 / 24%);
}

.nav-item.active,
.nav-item:hover {
  background:
    linear-gradient(90deg, rgb(232 243 255 / 100%), rgb(232 243 255 / 58%));
  color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item.active::before,
.nav-item:hover::before {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgb(22 93 255 / 14%);
}

.shell {
  min-width: 0;
  padding: 26px;
}

.topbar {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
  padding: 2px 0 14px;
}

.topbar h1 {
  color: #151b28;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
  font-weight: 800;
}

.topbar p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.ghost-link,
#logoutBtn,
.secondary-button,
menu button:not(.primary),
.row-actions button,
.card-actions button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 13px;
  background:
    linear-gradient(180deg, #ffffff, #f8fafd);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgb(31 36 48 / 4%);
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.ghost-link:hover,
#logoutBtn:hover,
.secondary-button:hover,
menu button:not(.primary):hover,
.row-actions button:hover,
.card-actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f7fbff;
  box-shadow: 0 8px 18px rgb(22 93 255 / 10%);
  transform: translateY(-1px);
}

.admin-badge,
.meta-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--line);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.surface,
.table-wrap,
.settings-panel,
.toolbar,
.stats article,
.resource-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: var(--shadow-soft);
}

.surface {
  padding: 18px;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #f8fafd);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 5px rgb(31 36 48 / 4%);
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.icon-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f7fbff;
  box-shadow: 0 8px 18px rgb(22 93 255 / 10%);
  transform: translateY(-1px);
}

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

.stats article {
  position: relative;
  min-height: 118px;
  padding: 17px;
  overflow: hidden;
}

.stats article::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgb(22 93 255 / 7%), transparent 36%);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.stats article::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(22 93 255 / 16%), rgb(22 93 255 / 5%));
}

.stats article:nth-child(2)::after {
  background:
    linear-gradient(135deg, rgb(0 168 112 / 18%), rgb(0 168 112 / 5%));
}

.stats article:nth-child(3)::after {
  background:
    linear-gradient(135deg, rgb(255 125 0 / 17%), rgb(255 125 0 / 5%));
}

.stats article:nth-child(4)::after {
  background:
    linear-gradient(135deg, rgb(245 63 63 / 15%), rgb(245 63 63 / 5%));
}

.stats article:hover::before {
  opacity: 1;
}

.stats span,
.stats small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stats strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.stats small {
  margin-top: 10px;
}

.toolbar {
  display: grid;
  grid-template-columns: 150px 150px minmax(220px, 1fr) auto auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px;
  background:
    linear-gradient(180deg, #ffffff, #f8fafc);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 11px;
  background:
    linear-gradient(180deg, #ffffff, #fbfcff);
  color: var(--text);
  outline: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
  min-height: 88px;
  padding: 10px 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(0 100 250 / 10%);
}

.primary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0 16px;
  background:
    linear-gradient(180deg, #2f7dff, var(--primary));
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgb(22 93 255 / 18%);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.primary:hover {
  background:
    linear-gradient(180deg, #216cff, var(--primary-hover));
  box-shadow: 0 6px 14px rgb(0 100 250 / 16%);
  transform: translateY(-1px);
}

.primary:disabled,
.secondary-button:disabled,
#exportBtn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.section-copy {
  display: grid;
  gap: 4px;
}

.section-copy h2 {
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
}

.section-copy p {
  color: var(--muted);
  font-size: 13px;
}

.bulk-actions,
.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.pagination-bar {
  justify-content: space-between;
  margin: 12px 0 0;
}

.select-all-row,
.pagination-bar label {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.select-all-row input,
.select-cell input {
  width: 16px;
  min-height: auto;
  accent-color: var(--primary);
}

.pagination-bar select {
  width: 96px;
}

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

.danger-action {
  color: var(--danger);
}

.row-actions button.danger-action:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #fff7f5;
  box-shadow: 0 8px 18px rgb(245 63 63 / 10%);
}

.table-wrap {
  overflow: auto;
  border-radius: 10px;
}

table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
}

.select-cell {
  width: 42px;
  text-align: center;
}

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

th {
  color: #596273;
  font-size: 12px;
  font-weight: 600;
  background:
    linear-gradient(180deg, #f7f9fc, #f1f4f9);
}

td {
  color: var(--text);
  font-size: 14px;
}

tbody tr:hover td {
  background: #f7fbff;
}

tbody tr.is-selected td {
  background: #f7fbff;
}

tbody tr.is-muted-row td {
  background: #fbfcff;
  color: var(--muted);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.consumer,
.cell-stack {
  display: grid;
  gap: 4px;
}

.consumer small,
.description,
.cell-muted {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge + .badge {
  margin-left: 5px;
}

.permission-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 260px;
}

.permission-badges .badge + .badge {
  margin-left: 0;
}

.wechat {
  background: #e8ffea;
  color: #00875a;
}

.alipay {
  background: #e8f3ff;
  color: var(--info);
}

.jingxiu {
  background: #fff7e8;
  color: #c45d00;
}

.paid,
.active,
.enabled {
  background: #e8ffea;
  color: var(--success);
}

.pending {
  background: #fff7e8;
  color: var(--warning);
}

.refunded {
  background: #edf3ff;
  color: var(--info);
}

.failed,
.inactive,
.disabled {
  background: #ffece8;
  color: var(--danger);
}

.closed {
  background: #f2f3f5;
  color: var(--muted);
}

.default {
  background: var(--primary-soft);
  color: var(--primary);
}

.row-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.row-actions button[data-action="refunded"] {
  color: var(--danger);
}

.empty {
  height: 180px;
  color: var(--muted);
  text-align: center;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.resource-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.resource-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.resource-card h3 {
  font-size: 16px;
  line-height: 1.35;
}

.resource-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.card-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.card-meta span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

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

.screen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#screenView .surface {
  position: relative;
  padding: 20px;
  border-color: #d5dce8;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8faff 46%, #eef4fb 100%);
  box-shadow:
    0 22px 60px rgb(31 36 48 / 10%),
    inset 0 1px 0 rgb(255 255 255 / 88%);
  overflow: hidden;
}

#screenView .surface::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 23px, rgb(22 93 255 / 4%) 23px 24px),
    linear-gradient(180deg, transparent 0 23px, rgb(22 93 255 / 4%) 23px 24px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgb(0 0 0 / 42%), transparent 58%);
  pointer-events: none;
}

#screenView .section-head,
#screenView .screen-embed-wrap {
  position: relative;
  z-index: 1;
}

.screen-embed-wrap {
  position: relative;
  width: min(100%, 1120px);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  min-height: 0;
  border: 1px solid #172032;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #172032, #0a1020 58%, #050914);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 12%),
    inset 0 -1px 0 rgb(0 0 0 / 42%),
    0 24px 68px rgb(15 23 42 / 20%);
  overflow: hidden;
  padding: 18px;
}

.screen-embed-wrap::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 82px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 28%), transparent);
  transform: translateX(-50%);
}

.screen-embed-wrap::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 8px;
  border: 1px solid rgb(111 203 255 / 18%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 4%);
  pointer-events: none;
}

.screen-embed-wrap:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #050914;
}

.screen-embed-wrap:fullscreen::before,
.screen-embed-wrap:fullscreen::after {
  display: none;
}

.screen-embed-wrap:fullscreen iframe {
  border-radius: 0;
}

.screen-embed-wrap iframe {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  border-radius: 8px;
  background: #050914;
}

.route-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: var(--shadow-soft);
}

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

.route-card-head strong,
.route-card-head small {
  display: block;
}

.route-card-head small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.route-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.route-card dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
}

.route-card dt {
  color: var(--subtle);
}

.route-card dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
}

.settings-panel {
  width: min(780px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--text);
}

.switch-row input {
  width: 16px;
  min-height: auto;
  accent-color: var(--primary);
}

.settings-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.settings-subhead {
  margin: 8px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.form-message,
#settingsMessage,
.dialog-message {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
}

#settingsMessage {
  color: var(--success);
  font-weight: 600;
}

dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  box-shadow: 0 24px 72px rgb(29 33 41 / 18%);
}

#routeDialog {
  width: min(920px, calc(100vw - 32px));
}

.wide-dialog {
  width: min(1120px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgb(29 33 41 / 42%);
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.dialog-head h2 {
  font-size: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
  overflow: auto;
}

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

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

.permission-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}

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

.permission-head strong {
  font-size: 14px;
}

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

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

.permission-check {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.permission-check input {
  width: 16px;
  min-height: auto;
  accent-color: var(--primary);
}

.permission-check span {
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
}

.span-2 {
  grid-column: span 2;
}

menu {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.dialog-message {
  margin-right: auto;
  align-self: center;
  font-weight: 600;
}

.logs-body {
  max-height: min(70vh, 760px);
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  overflow: auto;
  background: var(--surface-soft);
}

.log-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.log-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.log-card-head strong,
.log-card-head small {
  display: block;
}

.log-card-head small,
.log-message {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.log-payload-grid section {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(160px, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
}

.log-payload-grid h3 {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
}

.log-payload-grid pre {
  min-height: 160px;
  max-height: 320px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: #243043;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.pay-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgb(0 100 250 / 10%), transparent 30%),
    linear-gradient(180deg, #f7fbff 0%, #f5f6fa 46%, #eef1f6 100%);
}

.campaign-body {
  min-height: 100vh;
  background: #f2f2f2;
  overflow-x: hidden;
}

.pay-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 44px;
}

.campaign-body .pay-shell {
  position: relative;
  width: min(472px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 0 114px;
  background: #d34127;
  box-shadow: 0 20px 70px rgb(28 26 23 / 22%);
}

.campaign-page {
  min-height: 100vh;
  background: #d34127;
}

.campaign-poster {
  margin: 0;
  background: #d34127;
}

.campaign-poster img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.campaign-message {
  position: fixed;
  z-index: 24;
  left: 50%;
  bottom: calc(94px + env(safe-area-inset-bottom));
  width: min(420px, calc(100% - 34px));
  min-height: 0;
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
  border-radius: 8px;
  background: rgb(18 18 18 / 82%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
}

.campaign-message:not(:empty) {
  padding: 9px 12px;
}

.campaign-message[data-type="error"] {
  background: rgb(207 31 31 / 94%);
}

.campaign-message[data-type="success"] {
  background: rgb(0 168 112 / 94%);
}

.campaign-buybar {
  position: fixed;
  z-index: 25;
  right: max(0px, calc((100% - 472px) / 2));
  bottom: 0;
  width: min(472px, 100%);
  min-height: 84px;
  display: grid;
  grid-template-columns: auto minmax(96px, 1fr) clamp(124px, 36%, 168px);
  grid-template-areas: "price copy cta";
  align-items: stretch;
  padding: 0 0 env(safe-area-inset-bottom);
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 -8px 24px rgb(82 21 12 / 12%);
}

.campaign-buybar:disabled {
  cursor: wait;
}

.campaign-buybar:disabled .campaign-cta {
  filter: saturate(0.75);
}

.campaign-price {
  grid-area: price;
  align-self: center;
  padding-left: clamp(12px, 3.6vw, 18px);
  color: #eb302f;
  font-size: clamp(32px, 8.8vw, 40px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.campaign-copy {
  grid-area: copy;
  position: relative;
  z-index: 2;
  align-self: center;
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 0 18px 0 8px;
  color: #828282;
  font-size: clamp(12px, 3.4vw, 15px);
  line-height: 1.12;
  text-align: left;
  white-space: nowrap;
}

.campaign-copy strong {
  color: #535353;
  font-size: clamp(13px, 3.6vw, 16px);
}

.campaign-cta {
  position: relative;
  grid-area: cta;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px 0 28px;
  background: linear-gradient(180deg, #ff6941 0%, #f53335 100%);
  color: #ffffff;
  font-size: clamp(21px, 6.1vw, 28px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.campaign-cta::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 0;
  width: 36px;
  height: 100%;
  transform: skewX(-15deg);
  transform-origin: bottom;
  background: inherit;
}

.campaign-cta > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 390px) {
  .campaign-buybar {
    grid-template-columns: auto minmax(86px, 1fr) clamp(116px, 35%, 132px);
    min-height: 76px;
  }

  .campaign-price {
    padding-left: 10px;
    font-size: 30px;
  }

  .campaign-copy {
    gap: 3px;
    padding-left: 6px;
    padding-right: 14px;
    font-size: 12px;
  }

  .campaign-copy strong {
    font-size: 13px;
  }

  .campaign-cta {
    min-height: 76px;
    padding-left: 22px;
    padding-right: 6px;
    font-size: 20px;
  }

  .campaign-cta::before {
    left: -14px;
    width: 28px;
  }
}

@media (max-width: 350px) {
  .campaign-buybar {
    grid-template-columns: auto minmax(70px, 1fr) 108px;
  }

  .campaign-price {
    font-size: 27px;
  }

  .campaign-copy {
    white-space: normal;
  }

  .campaign-copy span,
  .campaign-copy strong {
    overflow-wrap: anywhere;
  }

  .campaign-cta {
    padding-left: 18px;
    font-size: 18px;
  }
}

.campaign-body .pay-nav,
.campaign-body .pay-hero,
.campaign-body .pay-layout {
  display: none;
}

.campaign-body .pay-result {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(94px + env(safe-area-inset-bottom));
  width: min(438px, calc(100% - 24px));
  max-height: min(70vh, 560px);
  margin: 0;
  overflow: auto;
  transform: translateX(-50%);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgb(0 0 0 / 28%);
}

.campaign-body .pay-result:not([hidden]) {
  display: grid;
  grid-template-columns: 1fr;
}

.pay-result-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.coupon-modal,
.payment-sheet {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
}

.coupon-backdrop,
.sheet-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgb(0 0 0 / 66%);
  cursor: pointer;
}

.coupon-card {
  position: relative;
  z-index: 1;
  width: min(346px, 74vw);
}

.coupon-open {
  width: 100%;
  display: block;
  padding: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 24px 38px rgb(0 0 0 / 34%));
}

.coupon-open img {
  width: 100%;
  display: block;
  border-radius: 18px;
}

.coupon-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: rgb(255 255 255 / 72%);
  font-size: 38px;
  font-weight: 200;
  line-height: 1;
}

.coupon-open::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 88px;
  height: 88px;
  transform: translate(-50%, 18%);
  border-radius: 999px;
  box-shadow: 0 0 0 0 rgb(255 217 72 / 42%);
  animation: couponPulse 1.6s ease-out infinite;
}

@keyframes couponPulse {
  0% {
    box-shadow: 0 0 0 0 rgb(255 217 72 / 42%);
  }

  100% {
    box-shadow: 0 0 0 24px rgb(255 217 72 / 0%);
  }
}

.payment-sheet {
  align-items: end;
}

.sheet-panel {
  position: relative;
  z-index: 1;
  width: min(472px, 100%);
  margin-left: auto;
  margin-right: auto;
  padding: 23px 20px 0;
  border-radius: 0;
  background: #ffffff;
  color: #202124;
  box-shadow: 0 -22px 52px rgb(0 0 0 / 18%);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sheet-header h2 {
  color: #222222;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.sheet-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  color: #c4c4c4;
  font-size: 42px;
  font-weight: 200;
  line-height: 1;
}

.campaign-route-options {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.campaign-route {
  min-height: 54px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
  color: #222222;
  text-align: left;
  cursor: pointer;
}

.campaign-route span:nth-child(2) {
  font-size: 24px;
  line-height: 1.2;
}

.route-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.route-icon.wechat {
  background: #36c445;
}

.route-icon.alipay {
  background: #23a8f2;
}

.route-icon.generic {
  background: #ff7d00;
}

.campaign-route i {
  width: 30px;
  height: 30px;
  justify-self: end;
  border: 2px solid #d4d4d4;
  border-radius: 999px;
}

.campaign-route.selected i {
  display: grid;
  place-items: center;
  border-color: #1f9fff;
  background: #1f9fff;
}

.campaign-route.selected i::before {
  content: "";
  width: 12px;
  height: 7px;
  transform: rotate(-45deg);
  border-left: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  margin-top: -2px;
}

.sheet-empty {
  margin: 0;
  padding: 18px 0;
  color: #888888;
  font-size: 16px;
}

.sheet-note {
  margin-top: 10px;
  color: #9a9a9a;
  font-size: 18px;
  line-height: 1.6;
}

.sheet-message {
  min-height: 0;
  margin-top: 8px;
  color: #666666;
  font-size: 14px;
  line-height: 1.5;
}

.sheet-message:not(:empty) {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f6f7f9;
}

.sheet-message[data-type="error"] {
  background: #fff1f0;
  color: #d93026;
}

.sheet-message[data-type="pending"] {
  background: #fff8e6;
  color: #9a6700;
}

.sheet-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(128px, 38%, 168px);
  align-items: stretch;
  min-height: 90px;
  margin: 34px -20px 0;
  padding: 0 0 env(safe-area-inset-bottom);
  background: #ffffff;
}

.sheet-footer > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-left: clamp(18px, 5vw, 30px);
}

.sheet-footer strong {
  color: #f12e36;
  font-size: clamp(34px, 9vw, 43px);
  line-height: 1;
  white-space: nowrap;
}

.sheet-footer span {
  color: #8e8e8e;
  font-size: clamp(13px, 3.8vw, 18px);
  text-decoration: line-through;
  white-space: nowrap;
}

.sheet-pay-button {
  min-height: 90px;
  background: #ee1f25;
  color: #ffffff;
  font-size: clamp(20px, 5.4vw, 24px);
  font-weight: 500;
  cursor: pointer;
}

.sheet-pay-button:disabled {
  opacity: 0.75;
  cursor: wait;
}

.pay-nav {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.pay-nav .brand {
  padding: 0;
}

.pay-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
  padding: 30px;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 96%), rgb(232 243 255 / 88%)),
    var(--surface);
  box-shadow: 0 20px 55px rgb(29 33 41 / 10%);
}

.pay-kicker {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.pay-hero h1 {
  max-width: 680px;
  margin-top: 12px;
  font-size: 34px;
  line-height: 1.16;
  letter-spacing: 0;
}

.pay-hero p {
  max-width: 720px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.pay-steps {
  display: grid;
  gap: 8px;
  min-width: 132px;
}

.pay-steps span {
  min-height: 34px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgb(255 255 255 / 72%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pay-steps span::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: #c9cdd4;
}

.pay-steps .active {
  border-color: rgb(0 100 250 / 28%);
  background: #ffffff;
  color: var(--primary);
}

.pay-steps .active::before {
  background: var(--primary);
}

.pay-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.pay-catalog,
.pay-panel,
.pay-result {
  border: 1px solid rgb(229 230 235 / 85%);
  border-radius: 16px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 14px 38px rgb(29 33 41 / 8%);
}

.pay-catalog {
  padding: 18px;
}

.pay-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.pay-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.pay-card-head h2 {
  margin-top: 8px;
  font-size: 20px;
}

.pay-card-head > strong {
  color: var(--primary);
  font-size: 28px;
  line-height: 1;
  white-space: nowrap;
}

.selected-summary {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.selected-summary span {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.selected-summary small {
  color: var(--muted);
  line-height: 1.5;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2,
.pay-panel h2 {
  font-size: 18px;
}

.section-title p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.pay-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.pay-product {
  position: relative;
  width: 100%;
  min-height: 168px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.pay-product:hover,
.pay-product.selected {
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgb(0 100 250 / 12%);
}

.pay-product:hover {
  transform: translateY(-2px);
}

.pay-product.selected::after {
  content: "✓";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
}

.pay-product-title {
  max-width: calc(100% - 36px);
  font-size: 16px;
  font-weight: 800;
}

.pay-product strong {
  color: var(--primary);
  font-size: 28px;
  line-height: 1.1;
}

.pay-product small {
  color: var(--muted);
  line-height: 1.55;
}

.pay-product em {
  justify-self: start;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.pay-product.selected em {
  background: var(--primary-soft);
  color: var(--primary);
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.trust-strip span {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pay-submit {
  min-height: 44px;
  font-size: 15px;
}

.pay-panel.is-submitting .pay-submit {
  opacity: 0.7;
  pointer-events: none;
}

.payment-action {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.cashier-card {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border: 1px solid rgb(22 93 255 / 16%);
  border-radius: 14px;
  padding: 16px;
  background:
    linear-gradient(135deg, #ffffff, #f6faff);
  box-shadow: 0 16px 34px rgb(22 93 255 / 10%);
}

.cashier-qr {
  width: 208px;
  height: 208px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.cashier-qr img,
.cashier-qr canvas,
.cashier-qr table {
  width: 184px;
  height: 184px;
}

.cashier-qr table {
  border-collapse: collapse;
}

.cashier-qr td {
  padding: 0;
}

.cashier-meta {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.cashier-meta strong {
  color: var(--text);
  font-size: 20px;
}

.cashier-meta span,
.cashier-meta small {
  color: var(--muted);
  line-height: 1.6;
}

.cashier-meta small {
  display: block;
  font-size: 12px;
}

.pay-success-note {
  color: var(--success);
  font-weight: 700;
}

.wechat-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-soft);
}

.wechat-profile img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.wechat-profile span,
.wechat-profile strong {
  display: block;
}

.wechat-profile span {
  color: var(--muted);
  font-size: 12px;
}

.action-link {
  width: fit-content;
}

.empty-block {
  margin: 0;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.product-option strong {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.pay-result {
  margin-top: 18px;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
}

.pay-result:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, auto);
  align-items: center;
  gap: 16px;
}

.pay-result h2 {
  margin-top: 10px;
  color: var(--text);
  font-size: 18px;
}

.pay-result p {
  margin-top: 6px;
}

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

  .toolbar {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .toolbar .search {
    grid-column: 1 / -1;
  }

  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .screen-embed-wrap {
    min-height: 440px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 5;
    top: 0;
    height: auto;
    gap: 12px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar .brand {
    padding: 0 4px;
  }

  nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    width: auto;
    flex: 0 0 auto;
  }

  .shell {
    padding: 18px 14px 28px;
  }

  .topbar {
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .route-form-grid,
  .employee-form-grid,
  .route-list,
  .form-grid,
  .log-payload-grid,
  .settings-panel {
    grid-template-columns: 1fr;
  }

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

  .span-2 {
    grid-column: auto;
  }

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

  .pay-panel {
    position: static;
  }

  .screen-embed-wrap {
    min-height: auto;
    padding: 12px;
  }

  .screen-embed-wrap::after {
    inset: 12px;
  }
}

@media (max-width: 720px) {
  .login-screen {
    padding: 16px;
    place-items: stretch;
    align-items: center;
  }

  .login-card {
    padding: 22px;
  }

  .stats,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .bulk-actions {
    align-items: stretch;
  }

  .bulk-actions .secondary-button,
  .pagination-actions {
    width: 100%;
  }

  .pagination-actions .secondary-button {
    flex: 1 1 0;
  }

  .screen-actions {
    width: 100%;
  }

  .screen-actions .primary,
  .screen-actions .secondary-button {
    flex: 1 1 150px;
  }

  .screen-embed-wrap {
    border-radius: 10px;
    padding: 8px;
  }

  .screen-embed-wrap::before {
    display: none;
  }

  .screen-embed-wrap::after {
    inset: 8px;
  }

  .topbar h1 {
    font-size: 23px;
  }

  .section-head,
  .pay-header,
  .pay-hero,
  .pay-nav,
  .section-title,
  .pay-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .pay-hero {
    display: flex;
    padding: 22px;
  }

  .pay-hero h1 {
    font-size: 28px;
  }

  .pay-steps {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pay-steps span {
    justify-content: center;
    padding: 0 8px;
  }

  .pay-products,
  .trust-strip {
    grid-template-columns: 1fr;
  }

  .pay-card-head > strong {
    font-size: 30px;
  }

  .pay-result:not([hidden]) {
    grid-template-columns: 1fr;
  }

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

  .cashier-qr {
    justify-self: center;
  }

  .permission-grid,
  .action-permission-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
  }

  td {
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 12px;
    padding: 11px 13px;
    white-space: normal;
  }

  td.select-cell {
    width: 100%;
    text-align: left;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
  }

  td.empty {
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
  }

  td.empty::before {
    content: "";
  }

  .row-actions {
    justify-content: flex-start;
  }

  .settings-actions,
  menu {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  menu button,
  menu .primary,
  .settings-actions .primary {
    width: 100%;
  }
}
