/* Admin panel styles (ADMIN_SPEC §5.1). System fonts only; light theme with a dark variant via
   prefers-color-scheme. No inline styles anywhere (CSP style-src 'self'). */

:root {
  color-scheme: light dark;
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f4;
  --border: #e2e5eb;
  --border-strong: #cdd2da;
  --text: #1b2230;
  --text-2: #475263;
  --muted: #6a7586;
  --accent: #2459d6;
  --accent-hover: #1c49b5;
  --accent-soft: #e9f0ff;
  --accent-text: #1d4fc4;
  --success: #15803d;
  --success-soft: #e6f5eb;
  --warning: #b45309;
  --warning-soft: #fdf1e1;
  --danger: #c42b2b;
  --danger-hover: #a82222;
  --danger-soft: #fdeceb;
  --info: #0b6aa2;
  --info-soft: #e5f2fa;
  --neutral: #5d6878;
  --neutral-soft: #eceff3;
  --sidebar-bg: #121826;
  --sidebar-text: #c6cfdb;
  --sidebar-muted: #7f8ba0;
  --sidebar-hover: #1b2335;
  --sidebar-active: #233150;
  --focus: 0 0 0 3px rgba(36, 89, 214, 0.32);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.22);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang HK", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", "Noto Sans TC", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  --chart-bar: #2459d6;
  --chart-bar-refund: #e0742b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1218;
    --surface: #161b23;
    --surface-2: #1b212b;
    --surface-3: #222a35;
    --border: #2a323e;
    --border-strong: #3a4452;
    --text: #e5e9ef;
    --text-2: #b6c0cc;
    --muted: #8c97a6;
    --accent: #5b8ef7;
    --accent-hover: #79a3fa;
    --accent-soft: #1b2a47;
    --accent-text: #93b6ff;
    --success: #43b86b;
    --success-soft: #15301f;
    --warning: #e3a245;
    --warning-soft: #372815;
    --danger: #f06763;
    --danger-hover: #f58784;
    --danger-soft: #3c1b1c;
    --info: #55b4ea;
    --info-soft: #132b3b;
    --neutral: #9aa5b4;
    --neutral-soft: #242c37;
    --sidebar-bg: #0a0d13;
    --sidebar-text: #c2cad6;
    --sidebar-muted: #77839a;
    --sidebar-hover: #151b26;
    --sidebar-active: #1c2840;
    --focus: 0 0 0 3px rgba(91, 142, 247, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
    --chart-bar: #5b8ef7;
    --chart-bar-refund: #e88a4a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.3;
}

p {
  margin: 0 0 8px;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.small {
  font-size: 12.5px;
}

.nowrap {
  white-space: nowrap;
}

.wrap-any {
  overflow-wrap: anywhere;
}

.ellipsis {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.truncate {
  overflow-wrap: anywhere;
}

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

.text-warning {
  color: var(--warning);
}

.text-success {
  color: var(--success);
}

.icon {
  flex: 0 0 auto;
  vertical-align: middle;
}

/* ------------------------------------------------------------------ boot */

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

/* ------------------------------------------------------------------ shell */

.shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  z-index: 50;
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  flex: 0 0 auto;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}

.brand-site {
  font-size: 12px;
  color: var(--sidebar-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 14px;
}

.nav-link:hover {
  background: var(--sidebar-hover);
  text-decoration: none;
  color: #fff;
}

.nav-link.is-active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

.nav-link.is-active .icon {
  color: #8fb1ff;
}

.side-version {
  padding: 10px 16px 14px;
  font-size: 12px;
  color: var(--sidebar-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.side-version:empty {
  display: none;
}

.main {
  margin-left: 220px;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar .menu-toggle {
  display: none;
}

.topbar-title {
  font-size: 16px;
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.content {
  width: 100%;
  max-width: 1328px;
  margin: 0 auto;
  padding: 24px;
  flex: 1 0 auto;
}

.content:focus {
  outline: none;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.5);
  z-index: 45;
}

@media (max-width: 899px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease, visibility 0.2s;
    width: 260px;
    visibility: hidden;
  }

  .drawer-open .sidebar {
    transform: none;
    visibility: visible;
    box-shadow: var(--shadow-lg);
  }

  .main {
    margin-left: 0;
  }

  .topbar .menu-toggle {
    display: inline-flex;
  }

  .topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .content {
    padding: 16px 12px;
  }
}

@media (max-width: 639px) {
  .role-badge {
    display: none;
  }

  .account-slot .btn-label {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .online-badge {
    padding: 3px 8px;
  }
}

/* ------------------------------------------------------------------ page */

.page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-titles {
  min-width: 0;
  flex: 1 1 260px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}

.title-badges {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.page-subtitle {
  color: var(--muted);
  margin: 4px 0 0;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  width: max-content;
}

.status-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

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

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

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

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

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.card-titles {
  min-width: 0;
}

.card-title {
  font-size: 15px;
  font-weight: 650;
}

.card-subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.card-body {
  padding: 16px;
  min-width: 0;
}

/* Tables inside cards run edge to edge. */
.card-body .table-wrap {
  border: 0;
  border-radius: 0;
  margin-left: -16px;
  margin-right: -16px;
  width: calc(100% + 32px);
}

.card-body > .table-wrap:first-child,
.card-body > div:first-child > .table-wrap:first-child {
  margin-top: -16px;
}

.card-body > .table-wrap:last-child,
.card-body > div:last-child > .table-wrap:last-child {
  margin-bottom: -16px;
}

.card-body .table-wrap + .pagination {
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ------------------------------------------------------------------ stats */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  min-width: 0;
}

a.stat:hover,
.stat-link:hover {
  border-color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.stat-label {
  font-size: 12.5px;
  color: var(--muted);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.stat-sub {
  font-size: 12.5px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.stat-warning .stat-value {
  color: var(--warning);
}

.stat-accent .stat-value {
  color: var(--accent-text);
}

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

  .stat {
    padding: 10px 12px;
  }

  .stat-value {
    font-size: 18px;
  }
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

.btn-primary:not(:disabled):hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:not(:disabled):hover {
  background: var(--surface-2);
  border-color: var(--muted);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:not(:disabled):hover {
  background: var(--danger-hover);
}

.btn-danger-outline {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger-outline:not(:disabled):hover {
  background: var(--danger-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:not(:disabled):hover {
  background: var(--surface-3);
  color: var(--text);
}

.btn-link {
  background: none;
  border: 0;
  color: var(--accent-text);
  padding: 0;
  min-height: 0;
}

.btn-link:not(:disabled):hover {
  text-decoration: underline;
}

.btn-sm {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-icon {
  padding: 0;
  width: 36px;
}

.btn-sm.btn-icon {
  width: 30px;
}

.btn-block {
  width: 100%;
}

.btn-text {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--accent-text);
  cursor: pointer;
}

.btn-text:hover {
  text-decoration: underline;
}

.btn-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.topbar .btn-ghost {
  color: var(--text);
}

/* ------------------------------------------------------------------ badges & dots */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  background: var(--neutral-soft);
  color: var(--neutral);
}

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

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

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

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

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

.badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neutral);
  flex: 0 0 auto;
}

.dot-success {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.dot-neutral {
  background: var(--border-strong);
}

.dot-warning {
  background: var(--warning);
}

.dot-danger {
  background: var(--danger);
}

.with-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* ------------------------------------------------------------------ notices & states */

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--info-soft);
  color: var(--text);
  border: 1px solid transparent;
  font-size: 13.5px;
}

.notice-icon {
  color: var(--info);
  margin-top: 1px;
}

.notice-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.notice-warning {
  background: var(--warning-soft);
}

.notice-warning .notice-icon {
  color: var(--warning);
}

.notice-danger {
  background: var(--danger-soft);
}

.notice-danger .notice-icon {
  color: var(--danger);
}

.notice-success {
  background: var(--success-soft);
}

.notice-success .notice-icon {
  color: var(--success);
}

.state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
  flex-wrap: wrap;
}

.state-error {
  color: var(--text);
  flex-direction: column;
}

.state-error.state-inline {
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
}

.state-error.state-inline .state-text {
  flex: 1 1 200px;
}

.state-error .state-icon {
  color: var(--danger);
  width: 24px;
  height: 24px;
}

.state-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-wrap: anywhere;
}

.state-text span {
  color: var(--muted);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
}

.skeleton-row {
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-row:nth-child(2n) {
  width: 85%;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner,
  .skeleton-row {
    animation: none;
  }

  .sidebar {
    transition: none;
  }
}

/* ------------------------------------------------------------------ tables */

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

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  /* break-word (not anywhere): long words wrap only when they must, and the automatic table layout
     keeps columns at their natural width instead of squeezing them to one character. */
  overflow-wrap: break-word;
  /* Cells keep their content on one line (CJK text would otherwise break after every character
     when the automatic layout squeezes a column); free text wraps inside .wrap-any / .expandable. */
  white-space: nowrap;
}

.table td .wrap-any,
.table td .expandable,
.table td .truncate {
  white-space: normal;
  overflow-wrap: anywhere;
  display: inline-block;
  min-width: 6em;
  max-width: 16em;
  vertical-align: middle;
}

.table .host > .wrap-any {
  min-width: 4em;
  max-width: 12em;
}

.table .stack-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  vertical-align: middle;
}

.table .align-right .stack-cell {
  align-items: flex-end;
}

.table .sub {
  font-size: 12px;
  color: var(--muted);
}

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

.table tbody tr:hover td {
  background: var(--surface-2);
}

.table .align-right {
  text-align: right;
}

.table .align-center {
  text-align: center;
}

.table td.align-right {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px !important;
}

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

.th-sort:hover {
  color: var(--text);
}

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

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

.table .actions-cell {
  white-space: nowrap;
  text-align: right;
}

.table .actions-cell .btn + .btn,
.table .actions-cell .btn + .menu-wrap,
.table .actions-cell .menu-wrap + .btn {
  margin-left: 6px;
}

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

.detail-row td {
  background: var(--surface-2);
}

.table td.detail-cell {
  white-space: normal;
}

.table td.detail-cell .wrap-any {
  display: inline;
  max-width: none;
}

.table .mono.ellipsis {
  max-width: 170px;
}

.table th,
.table td {
  padding-left: 10px;
  padding-right: 10px;
}

.table th:first-child,
.table td:first-child {
  padding-left: 16px;
}

.table th:last-child,
.table td:last-child {
  padding-right: 16px;
}

@media (max-width: 639px) {
  .table-wrap {
    overflow-x: visible;
    background: transparent;
    border: 0;
  }

  .card-body > .table-wrap {
    margin: -8px -4px;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table thead {
    display: none;
  }

  .table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin-bottom: 8px;
  }

  .card-body .table tr {
    background: var(--surface-2);
  }

  .table tbody tr:hover td {
    background: transparent;
  }

  .table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border: 0;
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .table td:first-child,
  .table td:last-child {
    padding-left: 0;
    padding-right: 0;
  }

  .table td .wrap-any,
  .table td .expandable,
  .table td .truncate {
    overflow-wrap: anywhere;
    min-width: 0;
    max-width: none;
  }

  .table .host > .wrap-any {
    max-width: none;
  }

  .table .stack-cell {
    align-items: flex-end;
  }

  .card-body .table-wrap {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }

  .card-body > .table-wrap:first-child,
  .card-body > div:first-child > .table-wrap:first-child,
  .card-body > .table-wrap:last-child,
  .card-body > div:last-child > .table-wrap:last-child {
    margin-top: 0;
    margin-bottom: 0;
  }

  .card-body .table-wrap + .pagination {
    border-top: 0;
  }

  .table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 42%;
    text-align: left;
    color: var(--muted);
    font-size: 12.5px;
  }

  .table td > * {
    min-width: 0;
  }

  .table td.cell-primary {
    font-weight: 600;
    font-size: 14.5px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 4px;
  }

  .table td.cell-primary::before {
    display: none;
  }

  .table td.cell-primary {
    justify-content: flex-start;
    text-align: left;
  }

  .table td.actions-cell {
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: 8px;
  }

  .table td.actions-cell::before {
    display: none;
  }

  .table td.align-right {
    white-space: normal;
  }

  .table .mono.ellipsis {
    max-width: 58vw;
  }

  .table .row-empty {
    border: 0;
    background: transparent;
  }

  .table .row-empty td::before {
    display: none;
  }

  .table .row-empty td {
    justify-content: center;
  }

  .hide-mobile {
    display: none !important;
  }

  .table td.detail-cell {
    display: block;
    text-align: left;
  }

  .table td.detail-cell::before {
    display: none;
  }
}

/* ------------------------------------------------------------------ pagination */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-2);
}

.pg-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

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

@media (max-width: 639px) {
  .pagination {
    justify-content: center;
  }

  .pg-total {
    width: 100%;
    text-align: center;
  }
}

/* ------------------------------------------------------------------ filter bar */

.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.filter-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 130px;
  flex: 0 1 auto;
}

.filter-item.grow {
  flex: 1 1 200px;
}

.filter-item .input,
.filter-item .select {
  width: 100%;
}

.filter-label {
  font-size: 12px;
  color: var(--muted);
}

.filter-check {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 36px;
  cursor: pointer;
}

.filter-toggle {
  display: none;
}

.filter-reset {
  margin-left: auto;
}

.filter-summary {
  font-size: 13px;
  color: var(--text-2);
}

@media (max-width: 639px) {
  .filter-bar {
    padding: 8px;
  }

  .filter-toggle {
    display: inline-flex;
  }

  .filter-fields {
    display: none;
    margin-top: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar.is-open .filter-fields {
    display: flex;
  }

  .filter-item {
    min-width: 0;
  }

  .filter-reset {
    margin-left: 0;
  }
}

/* ------------------------------------------------------------------ forms */

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.form-alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.field-label .req {
  color: var(--danger);
}

.field-label .opt {
  font-weight: 400;
  color: var(--muted);
}

.field-control {
  position: relative;
  min-width: 0;
}

.field-help {
  font-size: 12.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.field-error {
  font-size: 12.5px;
  color: var(--danger);
  overflow-wrap: anywhere;
}

.field-counter {
  position: absolute;
  right: 8px;
  bottom: -18px;
  font-size: 11.5px;
  color: var(--muted);
}

.field-counter.over {
  color: var(--danger);
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .input-group {
  border-color: var(--danger);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  min-width: 0;
}

.select {
  padding-right: 28px;
}

.select-sm {
  min-height: 30px;
  padding: 3px 26px 3px 8px;
  font-size: 13px;
  width: auto;
}

.textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
  outline: none;
}

.input:disabled,
.select:disabled,
.textarea:disabled,
.input[readonly] {
  background: var(--surface-2);
  color: var(--muted);
}

.input-num {
  font-variant-numeric: tabular-nums;
}

.input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-width: 0;
}

.input-group:focus-within {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.input-group .input {
  border: 0;
  box-shadow: none;
  flex: 1 1 auto;
}

.input-group .input:focus {
  box-shadow: none;
}

.input-prefix,
.input-suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 13px;
  white-space: nowrap;
}

.input-prefix {
  border-right: 1px solid var(--border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-suffix {
  border-left: 1px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-addon {
  min-height: 34px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.check input {
  margin: 3px 0 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

input[type="radio"] {
  accent-color: var(--accent);
}

.radio-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

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

@media (max-width: 639px) {
  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.form.inline-form {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px 10px;
  flex-wrap: wrap;
}

.inline-form > .form-alert {
  flex: 1 0 100%;
}

.inline-form .field {
  flex: 1 1 160px;
  max-width: 280px;
}

.inline-form > .btn,
.inline-form > .btn-group,
.inline-form > .row {
  margin-top: 24px;
}

.quick-days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* switch */

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  vertical-align: middle;
}

.switch-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  transition: background-color 0.15s;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

.switch-input:checked + .switch-track {
  background: var(--success);
}

.switch-input:checked + .switch-track .switch-thumb {
  transform: translateX(16px);
}

.switch-input:focus-visible + .switch-track {
  box-shadow: var(--focus);
}

.switch-input:disabled + .switch-track {
  opacity: 0.5;
}

/* ------------------------------------------------------------------ key/value */

.kv {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.kv-row {
  display: grid;
  grid-template-columns: minmax(110px, 34%) minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
}

.kv-row:last-child {
  border-bottom: 0;
}

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

.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.kv-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}

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

@media (max-width: 639px) {
  .kv-row {
    grid-template-columns: minmax(90px, 38%) minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------------ tabs */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab {
  border: 0;
  background: none;
  font: inherit;
  padding: 9px 14px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: var(--accent-text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-count {
  font-size: 11.5px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 700;
}

/* ------------------------------------------------------------------ menus */

.menu-wrap {
  position: relative;
  display: inline-block;
}

.menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  min-width: 180px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.menu-item:hover:not(:disabled),
.menu-item:focus-visible {
  background: var(--surface-3);
  box-shadow: none;
}

.menu-item:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

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

.menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ------------------------------------------------------------------ modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 12, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  outline: none;
}

.modal-sm {
  width: min(440px, 100%);
}

.modal-lg {
  width: min(760px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 650;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  min-height: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.modal-footer:empty {
  display: none;
}

.confirm-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.confirm-message {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

@media (max-width: 639px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal,
  .modal-sm,
  .modal-lg {
    width: 100%;
    max-height: 92vh;
    border-radius: 14px 14px 0 0;
  }

  .modal-body {
    padding: 14px 16px;
  }

  .modal-footer {
    padding: 10px 16px 16px;
  }

  .modal-footer .btn {
    flex: 1 1 0;
  }
}

/* one-time password */

.otp {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.otp-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.otp-value {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

.cmd {
  flex: 1 1 200px;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ toasts */

/* Top centre, below the 56px top bar. At the bottom right the stack covered the action column of
   the last table rows, the settings save bar and the footer buttons of the bottom-sheet dialogs on
   phones; at the top right it covered the page-header actions and the close button of large dialogs. */
.toasts {
  position: fixed;
  left: 50%;
  top: 68px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 6px 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.18s ease-out;
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-info {
  border-left-color: var(--info);
}

.toast-icon {
  margin-top: 1px;
  color: var(--success);
}

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-info .toast-icon {
  color: var(--info);
}

.toast-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13.5px;
  padding-top: 1px;
}

.toast .btn {
  min-height: 24px;
  width: 24px;
}

.toast-out {
  opacity: 0;
  transition: opacity 0.2s;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (max-width: 639px) {
  .toasts {
    left: 12px;
    right: 12px;
    top: 64px;
    transform: none;
    width: auto;
  }
}

/* ------------------------------------------------------------------ avatar */

.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-3);
  flex: 0 0 auto;
  vertical-align: middle;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-lg {
  width: 48px;
  height: 48px;
}

.avatar-sm {
  width: 24px;
  height: 24px;
}

.avatar-empty::after {
  content: "";
  width: 45%;
  height: 45%;
  border-radius: 50%;
  background: var(--border-strong);
}

.host {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* ------------------------------------------------------------------ auth pages */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent), var(--bg);
}

.auth-main {
  width: 100%;
  display: grid;
  place-items: center;
}

.auth-main:focus {
  outline: none;
}

.auth-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card-wide {
  width: min(460px, 100%);
}

.auth-logo {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
}

.auth-logo .icon {
  width: 24px;
  height: 24px;
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
}

.auth-subtitle {
  color: var(--text-2);
  margin: -8px 0 0;
}

.auth-form {
  gap: 14px;
}

@media (max-width: 639px) {
  .auth-card {
    padding: 22px 16px 18px;
  }
}

/* ------------------------------------------------------------------ dashboard */

.chart {
  width: 100%;
}

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

.chart .bar {
  fill: var(--chart-bar);
}

.chart .bar-refund {
  fill: var(--chart-bar-refund);
}

.chart .bar:hover,
.chart .bar-refund:hover {
  opacity: 0.8;
}

.chart .axis {
  stroke: var(--border-strong);
  stroke-width: 1;
}

.chart .grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.chart text {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}

.chart .value-label {
  fill: var(--text-2);
  font-size: 10.5px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  flex-wrap: wrap;
}

.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
  background: var(--chart-bar);
}

.legend-swatch.refund {
  background: var(--chart-bar-refund);
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.check-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.check-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--success-soft);
  color: var(--success);
}

.check-mark .icon {
  width: 14px;
  height: 14px;
}

.check-line.is-bad .check-mark {
  background: var(--danger-soft);
  color: var(--danger);
}

.check-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.check-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.age-warn {
  color: var(--warning);
  font-weight: 600;
}

.age-bad {
  color: var(--danger);
  font-weight: 600;
}

.updated-at {
  font-size: 12.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ settings */

.settings-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

.setting {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: 6px 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.setting:first-child {
  padding-top: 0;
}

.setting:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.setting-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.setting-label label,
.setting-label .label {
  font-weight: 600;
  font-size: 13.5px;
}

.setting-key {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.setting-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.setting-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.setting.is-changed {
  box-shadow: inset 3px 0 0 var(--accent);
  padding-left: 12px;
  margin-left: -12px;
}

.setting-file {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.setting .input,
.setting .textarea,
.setting .select {
  max-width: 560px;
}

.setting .input-group {
  max-width: 260px;
}

.img-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.img-preview img {
  max-width: 160px;
  max-height: 64px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface) 0 50%) 0 0 / 12px 12px;
  object-fit: contain;
}

.marquee-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 560px;
}

.savebar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin: 0 -4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 -6px 18px rgba(16, 24, 40, 0.08);
}

.savebar-text {
  font-size: 13px;
  color: var(--text-2);
}

.plan-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.plan-tile {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
}

.plan-tile-name {
  font-weight: 600;
}

.plan-tile-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-text);
}

@media (max-width: 799px) {
  .setting {
    grid-template-columns: minmax(0, 1fr);
  }

  .setting.is-changed {
    padding-left: 10px;
    margin-left: -10px;
  }
}

/* ------------------------------------------------------------------ rooms */

.lookup-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.lookup-row .field {
  flex: 1 1 auto;
}

.lookup-row .btn {
  margin-top: 24px;
}

.lookup-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.lookup-host {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lookup-host-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ logs */

.log-view {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 0;
  max-height: 70vh;
  overflow: auto;
}

.log-line {
  display: block;
  padding: 1px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log-line:hover {
  background: var(--surface-3);
}

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

.log-level {
  font-weight: 700;
}

.log-debug .log-level {
  color: var(--muted);
}

.log-info .log-level {
  color: var(--info);
}

.log-warn .log-level {
  color: var(--warning);
}

.log-error .log-level {
  color: var(--danger);
}

.log-error {
  background: var(--danger-soft);
}

.log-scope {
  color: var(--accent-text);
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 4px;
}

.diff-table th,
.diff-table td {
  text-align: left;
  padding: 5px 8px;
  border: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: anywhere;
  font-family: var(--mono);
}

.diff-table th {
  font-family: var(--font);
  background: var(--surface-3);
  font-weight: 600;
}

.diff-changed {
  background: var(--warning-soft);
}

@media (max-width: 639px) {
  .diff-table {
    display: block;
    overflow-x: auto;
    max-width: calc(100vw - 72px);
  }
}

.json-value {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 12px;
}

/* ------------------------------------------------------------------ misc */

.expandable {
  overflow-wrap: anywhere;
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.section-title {
  font-size: 14px;
  font-weight: 650;
  margin: 4px 0 0;
}

.amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.amount-neg {
  color: var(--danger);
}

.info-line {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-2);
}

.counter-strong {
  font-weight: 700;
  color: var(--text);
}

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