:root {
  color-scheme: light;
  /* Slate / Zinc neutral palette (Tailwind + shadcn inspired) */
  --bg: #f1f5f9;            /* slate-100 page canvas */
  --panel: #ffffff;         /* card surface */
  --panel-soft: #f8fafc;    /* nested / muted surface (slate-50) */
  --ink: #0f172a;           /* slate-900 foreground */
  --muted: #64748b;         /* slate-500 muted foreground */
  --line: #e9edf3;          /* soft hairline (slate-200-ish) */
  --line-strong: #dbe2ea;
  --sidebar: #ffffff;       /* light sidebar */
  --sidebar-soft: #f1f5f9;  /* slate-100 active/hover pill */
  --primary: #0f9d76;       /* brand emerald/teal accent */
  --primary-dark: #0f766e;  /* teal-700 */
  --blue: #3b82f6;
  --amber: #b45309;         /* amber-700 (readable on light) */
  --danger: #dc2626;        /* red-600 */
  --radius: 14px;
  --radius-sm: 10px;
  /* layered soft shadow — no hard borders needed */
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: var(--sidebar);
  color: #f8fafc;
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: #10192b;
  color: white;
  font-weight: 800;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

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

.brand small,
.token-panel small {
  color: #aebbd0;
}

.nav-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-group-label {
  margin: 10px 4px 0;
  color: #8fa0ba;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  background: transparent;
  color: #dbe6f5;
  text-align: left;
}

.nav-item-primary {
  font-weight: 900;
}

.nav-item-child {
  min-height: 36px;
  padding-left: 22px;
  color: #c9d5e6;
  font-size: 13px;
}

.nav-item:hover,
.nav-item.active {
  background: var(--sidebar-soft);
  color: white;
}

.token-panel {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.token-panel label {
  color: #dbe6f5;
  font-size: 13px;
  font-weight: 700;
}

#genericIdentityLoginFields {
  display: grid;
  gap: 10px;
}

#genericIdentityLoginFields[hidden] {
  display: none;
}

.token-panel input,
.search,
.action-stack input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  outline: none;
}

.token-panel input {
  border-color: rgba(255, 255, 255, 0.18);
  background: #10192b;
  color: white;
}

.token-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.token-panel button,
.top-actions button,
.action-stack button {
  min-height: 40px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.token-panel .ghost {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #dbe6f5;
}

.ops-authenticated .token-panel {
  display: grid;
}

.operator-session-summary {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.12);
}

.operator-session-summary strong,
.operator-session-summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.operator-session-summary span {
  color: #aebbd0;
  font-size: 12px;
}

.operator-session-summary em {
  display: inline-block;
  margin: 3px 2px 0 0;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  color: #dbe6f5;
  font-style: normal;
  font-size: 10px;
}

.legacy-login-panel {
  padding: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #aebbd0;
  font-size: 12px;
}

.legacy-login-panel summary {
  cursor: pointer;
  color: #dbe6f5;
  font-weight: 700;
}

.legacy-login-panel p {
  margin: 8px 0;
  line-height: 1.45;
}

.legacy-login-panel button {
  width: 100%;
  margin-top: 8px;
}

.operator-approval-inbox {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow-y: auto;
}

.operator-approval-inbox[hidden] {
  display: none;
}

.approval-inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.approval-inbox-head button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 11px;
}

.approval-inbox-row {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.approval-inbox-row span,
.approval-inbox-row small,
.approval-inbox-empty {
  color: #aebbd0;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.approval-inbox-row button {
  min-height: 30px;
  margin-top: 4px;
}

.nav-item.permission-denied {
  opacity: 0.45;
}

main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  gap: 10px;
  padding: 12px 0;
  margin-bottom: 24px;
  background: rgba(244, 247, 251, 0.96);
  border-bottom: 1px solid rgba(219, 227, 238, 0.92);
  backdrop-filter: blur(12px);
}

.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.global-user-search {
  display: grid;
  flex: 1 1 420px;
  max-width: 620px;
  gap: 5px;
}

.global-user-search label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.global-user-search > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.global-user-search input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.global-user-search button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--blue);
  color: white;
  font-weight: 900;
}

.target-context-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(12, 26, 44, 0.06);
}

.target-context-bar > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 8px 12px;
  border-right: 1px solid var(--line);
}

.target-context-bar > span:last-child {
  border-right: 0;
}

.target-context-bar small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.target-context-bar strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-health-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -8px 0 18px;
  padding: 12px 14px;
  border: 1px solid #f1b7a8;
  border-radius: 8px;
  background: #fff1ec;
  color: #8f2e1e;
  box-shadow: 0 10px 24px rgba(142, 46, 30, 0.08);
}

.target-health-banner[hidden] {
  display: none;
}

.target-health-banner strong {
  flex: 0 0 auto;
  font-size: 13px;
}

.target-health-banner span {
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
}

.ops-target-locked main .section.active button,
.ops-target-locked main .section.active input,
.ops-target-locked main .section.active select,
.ops-target-locked main .section.active textarea {
  opacity: 0.52;
}

.ops-target-locked main .section.active button {
  pointer-events: none;
}

.ops-target-switching main .section.active button,
.ops-target-switching main .section.active input,
.ops-target-switching main .section.active select,
.ops-target-switching main .section.active textarea,
.ops-target-switching .modal-backdrop button,
.ops-target-switching .modal-backdrop input,
.ops-target-switching .modal-backdrop select,
.ops-target-switching .modal-backdrop textarea {
  pointer-events: none;
  opacity: 0.48;
}

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

.server-target-switch {
  position: relative;
  width: 214px;
  flex: 0 0 auto;
}

.server-target-trigger {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 46px;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 22px rgba(12, 26, 44, 0.08);
}

.server-target-trigger strong {
  font-size: 15px;
  line-height: 1.15;
}

.server-target-trigger small,
.server-target-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
}

.server-target-kicker {
  color: var(--primary-dark);
}

.server-target-chevron {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
}

.server-target-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 38px rgba(12, 26, 44, 0.18);
}

.server-target-switch.open .server-target-menu {
  display: grid;
}

.server-target-menu button {
  display: grid;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.server-target-menu button:hover {
  background: #f4f8fc;
}

.server-target-menu button.active {
  background: var(--primary);
  color: white;
}

.server-target-menu button.active small {
  color: rgba(255, 255, 255, 0.78);
}

.server-target-menu button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 16px;
}

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

.state-pill {
  min-width: 112px;
  padding: 9px 12px;
  border-radius: 999px;
  background: #fff4df;
  color: #8b5d14;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.state-pill.connected {
  background: #e6f7f1;
  color: var(--primary-dark);
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.situation-priority-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.05fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.situation-priority-grid .panel {
  margin-bottom: 0;
}

.action-count {
  color: var(--danger);
  font-size: 14px;
}

.situation-actions {
  display: grid;
  gap: 9px;
}

.situation-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #f0d5ae;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fff9ed;
}

.situation-action.danger {
  border-color: #f1c3c3;
  border-left-color: var(--danger);
  background: #fff4f4;
}

.situation-action strong,
.situation-action span {
  display: block;
}

.situation-action span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.raw-detail {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.raw-detail > summary {
  padding: 12px 14px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.raw-detail > :not(summary) {
  margin: 0 12px 12px;
}

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

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

.metric {
  min-height: 132px;
  padding: 20px;
  display: grid;
  align-content: space-between;
}

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

.ops-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-height: 124px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.ops-card strong {
  font-size: 28px;
  line-height: 1;
}

.metric span,
.panel-head span,
.detail-list dt,
.time-grid span,
.event-meta {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
}

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

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

.chart-card {
  min-height: 184px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.chart-head span,
.chart-head small {
  color: var(--muted);
  font-size: 12px;
}

.chart-head strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.sparkline {
  width: 100%;
  height: 112px;
}

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

.sparkline text {
  fill: var(--muted);
  font-size: 10px;
}

.chart-axis {
  stroke: #cfd8e6;
  stroke-width: 1;
}

.chart-grid {
  stroke: #edf2f8;
  stroke-width: 1;
}

.chart-dot {
  cursor: help;
  stroke: white;
  stroke-width: 1.5;
}

.spark-empty {
  height: 112px;
  display: grid;
  place-items: center;
  padding: 0;
}

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

.panel {
  padding: 18px;
}

.health-panel {
  margin-bottom: 18px;
}

.health-main {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.health-label {
  min-width: 72px;
  padding: 9px 12px;
  border-radius: 999px;
  color: white;
  font-size: 15px;
  text-align: center;
}

.health-label.stable {
  background: var(--primary);
}

.health-label.warning {
  background: var(--amber);
}

.health-label.danger {
  background: var(--danger);
}

.health-main span {
  color: var(--muted);
}

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

.health-check {
  min-height: 76px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.health-check.stable {
  border-left-color: var(--primary);
}

.health-check.warning {
  border-left-color: var(--amber);
}

.health-check.danger {
  border-left-color: var(--danger);
}

.health-check span,
.health-check strong {
  display: block;
}

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

.health-check strong {
  margin-top: 8px;
  overflow-wrap: anywhere;
}

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

.panel-help {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-top {
  display: flex;
  justify-content: space-between;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.bar-row.compact {
  padding: 8px 0;
}

.breakdown-block {
  display: grid;
  gap: 10px;
}

.breakdown-block + .breakdown-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.breakdown-block h3 {
  margin: 0;
  font-size: 14px;
}

.dropoff-version-panel,
.quest-dropoff-panel {
  margin-bottom: 18px;
}

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

.dropoff-version-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.dropoff-version-top,
.dropoff-cause-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.dropoff-version-top strong {
  font-size: 24px;
}

.dropoff-version-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.version-rank {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 999px;
  background: #172033;
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.version-pill {
  max-width: 100%;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropoff-version-period,
.dropoff-insight,
.dropoff-mini-empty {
  color: var(--muted);
  font-size: 12px;
}

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

.dropoff-stat-grid div {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.dropoff-stat-grid span,
.dropoff-stat-grid b {
  display: block;
}

.dropoff-stat-grid span {
  color: var(--muted);
  font-size: 11px;
}

.dropoff-stat-grid b {
  margin-top: 4px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropoff-cause-row {
  padding: 8px 9px;
  border: 1px solid #d7e0ec;
  border-radius: 8px;
  background: white;
  font-size: 12px;
  font-weight: 800;
}

.dropoff-cause-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropoff-insight {
  min-height: 48px;
  margin: 0;
  line-height: 1.45;
}

.dropoff-mini-bars {
  display: grid;
  gap: 6px;
}

.dropoff-mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.dropoff-mini-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropoff-mini-row b {
  color: var(--ink);
}

.dropoff-mini-row i {
  grid-column: 1 / -1;
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.dropoff-mini-row em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

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

.quest-dropoff-period-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.quest-dropoff-period-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.quest-dropoff-period-head span,
.quest-dropoff-period-head small {
  display: block;
}

.quest-dropoff-period-head span {
  font-size: 14px;
  font-weight: 900;
}

.quest-dropoff-period-head small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.quest-dropoff-period-head strong {
  color: #b42318;
  font-size: 26px;
  line-height: 1;
}

.quest-dropoff-period-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.quest-dropoff-period-stats div {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.quest-dropoff-period-stats span,
.quest-dropoff-period-stats b {
  display: block;
}

.quest-dropoff-period-stats span {
  color: var(--muted);
  font-size: 10px;
}

.quest-dropoff-period-stats b {
  margin-top: 4px;
  font-size: 13px;
}

.quest-dropoff-chart {
  display: grid;
  gap: 12px;
}

.quest-dropoff-bar-row {
  display: grid;
  gap: 5px;
}

.quest-dropoff-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
}

.quest-dropoff-bar-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quest-dropoff-bar-label b {
  flex: 0 0 auto;
  color: #b42318;
}

.quest-dropoff-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.quest-dropoff-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2a65a, #d64545);
}

.quest-dropoff-bar-row small {
  color: var(--muted);
  font-size: 11px;
}

#dropoffVersionTitle,
#dropoffVersionStage,
#dropoffVersionMinute {
  overflow-wrap: anywhere;
  font-size: 23px;
}

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

.time-grid div {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.time-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.config-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.config-hero h2 {
  font-size: 24px;
}

.config-metrics .metric {
  min-height: 110px;
}

.config-layout {
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  align-items: start;
}

.config-list-panel,
.config-detail-panel,
.config-reward-panel {
  margin-bottom: 18px;
}

.config-item-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(118px, 1fr));
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.config-item-card {
  min-height: 112px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.config-item-card:hover,
.config-item-card.active {
  border-color: var(--blue);
  background: #edf5ff;
}

.config-item-card.disabled {
  opacity: 0.55;
}

.config-item-card strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-item-card small {
  color: var(--muted);
  font-size: 11px;
}

.config-item-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #c9d4e5;
  border-radius: 8px;
  background: #101820;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 900;
}

.config-item-icon.large {
  width: 54px;
  height: 54px;
  font-size: 20px;
}

.config-detail {
  display: grid;
  gap: 13px;
}

.config-detail label,
.config-multiplier-row label,
.cash-range-row label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.config-detail input,
.config-detail select,
.config-detail textarea,
.config-multiplier-row input,
.cash-range-row input,
.compact-select,
.config-reward-table input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  outline: none;
}

.config-detail textarea {
  resize: vertical;
}

.config-selected-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.config-selected-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.config-multiplier-row,
.cash-range-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.cash-range-row {
  grid-template-columns: repeat(2, minmax(0, 220px));
}

.config-table-wrap {
  overflow: auto;
}

.config-reward-table {
  min-width: 900px;
}

.config-reward-table input {
  min-height: 34px;
}

.config-reward-table td:nth-child(2) {
  width: 110px;
}

.config-reward-table td:nth-child(4) {
  width: 260px;
}

.config-reward-table td:nth-child(4) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.reward-group-cell {
  max-width: 440px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-config-quick-panel {
  grid-column: 1 / -1;
  padding: 12px 14px;
}

.ops-config-quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ops-config-quick-head h2 {
  margin: 0;
  font-size: 16px;
}

.ops-config-quick-head .panel-actions {
  gap: 8px;
}

.ops-config-quick-rows {
  display: grid;
  gap: 8px;
}

.ops-config-quick-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.42fr) minmax(260px, 1fr) 96px;
  gap: 8px;
  align-items: end;
}

.ops-config-current {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.ops-config-current span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ops-config-current strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-config-quick-row label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ops-config-quick-row input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--ink);
  background: white;
  font-size: 13px;
  outline: none;
}

.ops-config-quick-row button {
  min-height: 36px;
}

.balance-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.balance-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.balance-card.disabled {
  opacity: 0.66;
}

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

.balance-card-head strong,
.balance-card-head span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-card-head strong {
  font-size: 13px;
}

.balance-card-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.compact-check {
  flex: 0 0 auto;
}

.balance-default-line {
  min-height: 18px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-stat-list {
  display: grid;
  gap: 5px;
}

.balance-stat-row,
.balance-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(66px, 0.75fr) 30px;
  gap: 5px;
  min-width: 0;
}

.balance-empty {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.balance-note {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.balance-stat-row select,
.balance-stat-row input,
.balance-add-row select,
.balance-add-row input,
.balance-note input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--ink);
  background: white;
  font-size: 12px;
  outline: none;
}

.balance-mini-button {
  width: 30px;
  min-width: 30px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.balance-mini-button.add {
  border-color: rgba(23, 95, 214, 0.25);
  color: var(--primary-dark);
}

.balance-mini-button.danger {
  color: var(--danger);
}

.coupon-panel {
  grid-column: 1 / -1;
}

.compact-panel-head {
  margin-bottom: 10px;
}

.update-notes-panel {
  grid-column: 1 / -1;
}

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

.update-note-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.update-note-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.update-note-card-head strong {
  flex: 1;
  color: var(--ink);
  font-size: 13px;
}

.update-note-core-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(180px, 1.3fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr);
  gap: 8px;
}

.update-note-style-grid {
  display: grid;
  grid-template-columns: minmax(100px, 0.7fr) minmax(86px, 0.5fr) minmax(110px, 0.7fr) minmax(100px, 0.7fr) minmax(86px, 0.5fr) minmax(110px, 0.7fr);
  gap: 8px;
  align-items: end;
}

.update-note-card label,
.update-note-body-label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.update-note-card input,
.update-note-card select,
.update-note-card textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--ink);
  background: white;
  font-size: 12px;
  outline: none;
}

.update-note-card input[type="color"] {
  padding: 3px;
}

.update-note-card textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.45;
}

.update-note-board {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 12px;
  min-height: 360px;
}

.update-note-board .update-note-list {
  display: grid;
  align-content: start;
  gap: 7px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.update-note-row {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.update-note-row:hover,
.update-note-row.active {
  border-color: var(--blue);
  background: #edf5ff;
}

.update-note-row strong,
.update-note-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-note-row span,
.update-note-row em,
.update-note-detail-head span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.update-note-row em {
  color: var(--danger);
  font-weight: 900;
}

.update-note-detail {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.update-note-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.update-note-detail-head h3 {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.update-note-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.update-note-preview {
  max-height: 430px;
  overflow: auto;
  color: #273247;
  line-height: 1.65;
  white-space: normal;
}

.note-red {
  color: var(--danger);
  font-weight: 900;
}

.note-blue {
  color: var(--blue);
  font-weight: 900;
}

.note-green {
  color: var(--primary-dark);
  font-weight: 900;
}

.note-yellow {
  color: var(--amber);
  font-weight: 900;
}

.note-big {
  font-size: 1.25em;
  font-weight: 900;
}

.note-small {
  color: var(--muted);
  font-size: 0.88em;
}

.update-note-modal-panel {
  width: min(880px, 100%);
}

.update-note-editor {
  gap: 10px;
}

.note-editor-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(110px, 0.45fr));
  gap: 8px;
}

.note-format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.note-format-toolbar button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.update-note-editor textarea {
  min-height: 260px;
  resize: vertical;
  line-height: 1.55;
}

.note-rich-editor {
  width: 100%;
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  outline: none;
  white-space: pre-wrap;
}

.note-rich-editor:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 95, 214, 0.12);
}

.note-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.note-rich-editor strong {
  font-weight: 900;
}

.coupon-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.coupon-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.coupon-list > .empty {
  grid-column: 1 / -1;
}

.coupon-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.coupon-card-head {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) 72px minmax(56px, auto) 42px;
  align-items: end;
  gap: 6px;
  min-width: 0;
}

.coupon-reward-head {
  display: flex;
  align-items: end;
  gap: 6px;
  min-width: 0;
}

.coupon-card-head label {
  min-width: 0;
}

.coupon-card-head button {
  min-height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.coupon-card-head .ghost.danger {
  width: 42px;
  padding: 0;
  border: 1px solid #fecaca;
}

.coupon-card-head .compact-check {
  justify-content: center;
  min-height: 32px;
  padding: 0 4px;
}

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

.coupon-card label,
.coupon-reward-head strong {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.coupon-card input,
.coupon-card select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--ink);
  background: white;
  font-size: 12px;
  outline: none;
}

.coupon-reward-head {
  justify-content: space-between;
  margin-top: 0;
}

.coupon-reward-list {
  display: grid;
  gap: 6px;
}

.coupon-reward-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.8fr) minmax(52px, 0.55fr) minmax(68px, 0.62fr) minmax(74px, 0.7fr) 30px;
  gap: 5px;
  align-items: center;
}

.retention-version-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(260px, 1.3fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.retention-version-row strong,
.retention-version-row span {
  display: block;
}

.retention-version-row > div:first-child span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.retention-day-grid span {
  min-width: 0;
  padding: 9px;
  border-radius: 8px;
  background: white;
}

.retention-day-grid b,
.retention-day-grid em,
.retention-day-grid small {
  display: block;
  font-style: normal;
}

.retention-day-grid em {
  margin-top: 3px;
  color: var(--primary-dark);
  font-weight: 900;
}

.retention-day-grid small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.check-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button-row.single {
  grid-template-columns: 1fr;
}

.primary-button,
.ghost-button,
.warning-button {
  min-height: 40px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 800;
}

.compact {
  min-height: 34px;
  padding: 0 12px;
}

.ghost-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.warning-button {
  background: var(--amber);
}

.danger-button {
  min-height: 40px;
  border-radius: 8px;
  background: var(--danger);
  color: white;
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.split.single-pane {
  grid-template-columns: minmax(0, 1fr);
}

.chat-split {
  grid-template-columns: minmax(0, 1fr) 380px;
}

.chat-split.single-pane {
  grid-template-columns: minmax(0, 1fr);
}

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

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

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

th {
  background: #f7f9fc;
  color: var(--muted);
  font-size: 12px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: #eef8f5;
}

.name-cell {
  display: grid;
  gap: 3px;
}

.name-cell strong {
  font-size: 14px;
}

.name-cell small {
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.detail {
  align-self: start;
}

.user-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: 10px;
}

.dashboard-users-panel {
  margin-bottom: 18px;
}

.dashboard-user-grid > .empty {
  grid-column: 1 / -1;
}

.dashboard-online-pager {
  display: inline-grid;
  grid-template-columns: 34px minmax(112px, auto) 34px;
  align-items: center;
  gap: 6px;
}

.dashboard-online-pager span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.dashboard-online-pager button {
  width: 34px;
  min-width: 34px;
  min-height: 32px;
  padding: 0;
}

.user-card {
  display: grid;
  min-height: 86px;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.user-card:hover,
.user-card.selected {
  border-color: var(--primary);
  background: #eef8f5;
}

.user-card strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.mini-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 14px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.mini-tabs button {
  min-height: 34px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mini-tabs button.active {
  background: white;
  color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(23, 32, 51, 0.08);
}

.activity-filter-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 8px;
}

.activity-filter-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 28px;
  font-size: 12px;
}

.activity-filter-tabs em {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e8eef7;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.activity-filter-tabs button.active em {
  background: #dbeafe;
  color: var(--primary-dark);
}

.user-tab-pane {
  display: none;
}

.user-tab-pane.active {
  display: block;
}

.detail-list {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0 0 16px;
  padding: 0;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.detail-list.slim {
  grid-template-columns: 90px minmax(0, 1fr);
  font-size: 13px;
}

.action-stack {
  display: grid;
  gap: 8px;
}

.compact-actions {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.rename-row,
.moderation-row {
  display: grid;
  gap: 8px;
}

.rename-row {
  grid-template-columns: minmax(0, 1fr) 74px;
}

.moderation-row {
  grid-template-columns: 70px 1fr 74px;
}

.compact-actions input {
  min-height: 36px;
  border-radius: 8px;
}

.compact-actions button {
  min-height: 36px;
  border-radius: 8px;
  font-size: 13px;
}

.action-stack .warning {
  background: var(--amber);
}

.action-stack .danger {
  background: var(--danger);
}

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

.logs-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: start;
}

.logs-panel,
.bans-panel {
  min-width: 0;
}

.dense-log-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

#reportStatusTabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.reports-grid {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  align-items: start;
}

.report-card {
  min-width: 0;
  align-content: start;
}

.report-card > div:not(.report-action-row),
.report-card .event-meta {
  min-width: 0;
  overflow-wrap: anywhere;
}

#reportsList .report-action-row {
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr) auto;
  align-items: center;
}

#reportsList .report-action-row > * {
  min-width: 0;
}

#reportsList .report-action-row button {
  min-width: 78px;
  white-space: nowrap;
}

.reports-grid > .auction-pager,
.reports-grid > .empty {
  grid-column: 1 / -1;
}

.dense-ban-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

#section-logs .event-item {
  min-width: 0;
  align-content: start;
  gap: 5px;
  padding: 10px;
}

#section-logs .event-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px;
}

#section-logs .event-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#section-logs .event-tag {
  padding: 3px 7px;
}

#section-logs .event-meta {
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.3;
}

#section-logs .event-item > div:last-child:not(.event-title):not(.event-meta) {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#section-logs .inline-action {
  min-height: 28px;
  margin-top: 2px;
  border: 1px solid #f1b8b8;
  border-radius: 7px;
  background: #fff8f8;
  color: #a52f2f;
  font-size: 12px;
  font-weight: 800;
}

.compact-event-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.compact-event-grid > .empty {
  grid-column: 1 / -1;
}

.compact-event-grid .event-item {
  min-width: 0;
  align-content: start;
  padding: 11px;
}

.compact-event-grid .event-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px;
}

.compact-event-grid .event-title b,
.compact-event-grid .event-tag {
  white-space: nowrap;
}

.compact-event-grid .event-meta {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

.compact-event-grid .iap-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-event-grid .iap-actions button {
  min-width: 0;
  padding-inline: 8px;
  white-space: normal;
}

.iap-panel {
  margin-top: 18px;
}

.refund-list {
  margin-bottom: 12px;
}

.iap-order-lookup {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 8px;
  margin: 8px 0 12px;
}

.iap-order-result {
  margin-bottom: 12px;
}

.json-preview {
  max-height: 220px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 10px;
  background: #0f172a;
  color: #dbeafe;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.refund-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.refund-live-summary {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  margin: 12px 0;
}

.refund-detail-table {
  min-width: 1280px;
}

.refund-actions {
  flex-wrap: nowrap;
  margin-top: 0;
}

.refund-summary-grid article {
  display: grid;
  gap: 8px;
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.refund-summary-grid span,
.refund-block-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.refund-summary-grid strong {
  font-size: 21px;
}

.refund-warning {
  padding: 12px 14px;
  border: 1px solid #ffd79b;
  border-radius: 8px;
  background: #fff8eb;
  color: #8b5d14;
  font-size: 13px;
  font-weight: 800;
}

.refund-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

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

.refund-block h3 {
  margin: 0;
  font-size: 15px;
}

.ops-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.ops-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.compact-table {
  min-width: 720px;
}

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

.ops-table th {
  background: #f6f8fb;
  color: var(--muted);
  font-size: 12px;
}

.table-link,
.payment-item {
  color: inherit;
  text-align: left;
}

.table-link {
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
}

.payment-item {
  width: 100%;
}

.payment-item:hover {
  border-color: var(--primary);
  background: #eef8f5;
}

.refund-item.matched {
  border-color: rgba(205, 61, 61, 0.28);
  background: #fff8f8;
}

.iap-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.activity-list,
.chat-log-list {
  display: grid;
  gap: 8px;
}

.chat-log-list {
  max-height: min(52vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}

.chat-log-actions {
  display: flex;
  justify-content: center;
  min-height: 32px;
  margin-bottom: 8px;
}

.chat-log-actions button[hidden] {
  display: none;
}

.activity-item {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.chat-log-item {
  display: flex;
  align-items: stretch;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.chat-log-open {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px 0 0 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-log-delete {
  flex: 0 0 auto;
  align-self: stretch;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.chat-log-delete:hover {
  background: #fef2f2;
  color: #991b1b;
}

.activity-item.chat {
  border-left: 3px solid #3b82f6;
}

.activity-item.item {
  border-left: 3px solid #16a34a;
}

.activity-item.ops {
  border-left: 3px solid #b45309;
}

.activity-item.death {
  border-left: 3px solid #7c3aed;
}

.activity-death-detail {
  cursor: pointer;
}

.activity-death-detail summary {
  display: grid;
  gap: 5px;
  list-style: none;
}

.activity-death-detail summary::-webkit-details-marker {
  display: none;
}

.activity-death-detail[open] {
  background: #faf7ff;
}

.activity-death-items {
  display: grid;
  gap: 8px;
  margin-top: 5px;
  padding-top: 10px;
  border-top: 1px solid #ddd6fe;
}

.activity-death-items > b {
  color: #5b21b6;
  font-size: 12px;
}

.activity-death-item-list {
  display: grid;
  gap: 6px;
}

.activity-death-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #fff;
}

.activity-death-item-row strong {
  white-space: normal;
}

.activity-death-item-row span {
  flex: 0 1 auto;
  overflow-wrap: anywhere;
  text-align: right;
}

.activity-item.payment {
  border-left: 3px solid #dc2626;
}

.activity-item strong,
.chat-log-item strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item span,
.chat-log-item small,
.chat-name {
  color: var(--muted);
  font-size: 12px;
}

.chat-log-item:hover {
  border-color: var(--primary);
  background: #eef8f5;
}

.chat-name {
  font-weight: 800;
}

.chat-sender-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.chat-sender-mode button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.chat-sender-mode button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.chat-sender-mode span {
  min-width: 0;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chat-dispatch-card {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #f8fbfa;
}

.chat-scope-mode {
  flex-wrap: wrap;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.chat-scope-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.chat-global-target {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.chat-global-target strong {
  font-size: 13px;
}

.chat-global-target span,
.chat-global-target small {
  color: var(--muted);
  font-size: 12px;
}

.chat-global-target.offline {
  border-color: #f2b8b5;
  background: #fff6f5;
}

.chat-scope-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.chat-scope-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.chat-scope-fields label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chat-scope-fields select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}

.chat-dispatch-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-dispatch-preview {
  flex: 1 1 auto;
  border-left: 3px solid var(--primary);
  padding: 8px 10px;
  background: #eef8f5;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.chat-dispatch-preview.invalid {
  border-left-color: #dc2626;
  background: #fff1f1;
  color: #991b1b;
}

.chat-dispatch-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.chat-dispatch-result span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.chat-dispatch-result strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
}

.system-chat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
  margin-top: 8px;
}

.system-chat-row input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
}

.system-chat-row button {
  min-height: 40px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 15, 26, 0.44);
}

.modal-panel {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 70px rgba(12, 20, 33, 0.24);
}

/* U8: reusable confirm modal (replaces blocking window.confirm) */
.confirm-modal-panel {
  width: min(440px, 100%);
}

.confirm-modal-body {
  white-space: pre-line;
  line-height: 1.55;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 20px 20px;
}

.global-user-search {
  position: relative;
}

.global-user-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 25;
  width: min(620px, calc(100vw - 48px));
  max-height: min(540px, calc(100vh - 180px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: 0 18px 50px rgba(12, 20, 33, 0.2);
}

.global-search-result-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

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

.global-search-result-row {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: white;
  color: var(--ink);
  text-align: left;
}

.global-search-result-row:hover,
.global-search-result-row:focus-visible {
  background: #f3f8ff;
}

.global-search-result-row > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.global-search-result-row small {
  color: var(--muted);
}

#userModal .modal-panel {
  width: min(1040px, 100%);
}

.modal-main-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-main-tabs button {
  flex: 1 1 140px;
}

.cs-tab-panel,
.cs-action-summary,
.cs-target-card,
.cs-action-result {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.cs-source-strip {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 7px;
  background: #f5f8fc;
  color: var(--muted);
  font-size: 12px;
}

.cs-action-row,
.cs-section-head,
.cs-action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cs-action-row small,
.cs-section-head p,
.cs-target-card span,
.cs-target-card small {
  color: var(--muted);
  font-size: 12px;
}

.cs-section-head h3,
.cs-section-head p {
  margin: 0;
}

.cs-section-head p {
  margin-top: 3px;
}

.cs-readonly-list {
  display: grid;
  gap: 6px;
  max-height: 430px;
  overflow: auto;
}

.cs-readonly-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbfd;
}

.cs-readonly-row span {
  min-width: 0;
}

.cs-readonly-row strong,
.cs-readonly-row small {
  display: block;
  overflow-wrap: anywhere;
}

.cs-readonly-row small,
.cs-readonly-row em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.cs-death-row button {
  flex: 0 0 auto;
}

.cs-action-modal-panel {
  width: min(720px, 100%);
}

.cs-action-modal-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cs-action-modal-panel input,
.cs-action-modal-panel select,
.cs-action-modal-panel textarea {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
}

.cs-action-modal-panel textarea {
  min-height: 96px;
  resize: vertical;
}

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

.cs-action-summary {
  background: #f3f8ff;
}

.cs-action-summary span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.cs-action-summary strong {
  font-size: 18px;
}

.cs-action-warning {
  padding: 10px 12px;
  border: 1px solid #f0d69c;
  border-radius: 8px;
  background: #fff8e8;
  color: #775414;
  font-size: 12px;
  line-height: 1.5;
}

.cs-action-result.success {
  border-color: #abd9bf;
  background: #effaf3;
}

.cs-action-result.failure {
  border-color: #e5b8b8;
  background: #fff3f3;
}

.cs-action-result p {
  margin: 0;
  color: var(--muted);
}

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

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.modal-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.modal-detail-grid {
  display: grid;
  gap: 12px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ops-user-grant-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(180px, 240px) 72px;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.ops-user-grant-row strong,
.ops-user-grant-row small {
  display: block;
}

.ops-user-grant-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ops-user-grant-row input,
.ops-user-grant-row select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
}

.ops-user-teleport-room-row {
  grid-template-columns: minmax(210px, 1.2fr) minmax(190px, 1fr) minmax(150px, 0.8fr) minmax(190px, 1fr) 126px;
}

.ops-room-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ops-room-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ops-room-field select {
  width: 100%;
  min-width: 0;
}

.ops-inventory-block {
  display: grid;
  gap: 12px;
}

.ops-item-add-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 110px 92px;
  gap: 8px;
}

.grant-window-button {
  min-height: 36px;
}

.ops-item-add-row input,
.ops-item-actions input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
}

.ops-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 6px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.ops-inventory-item {
  display: grid;
  gap: 7px;
  min-height: 76px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.ops-suspicious-item {
  border-color: #f1a3a3;
  background: #fff5f5;
}

.ops-inventory-item strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ops-inventory-item span,
.ops-inventory-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-inventory-item-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ops-inventory-grid > .empty {
  grid-column: 1 / -1;
}

.ops-inventory-item-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.ops-item-actions {
  display: grid;
  grid-template-columns: 72px 1fr 1fr 64px;
  gap: 6px;
  align-items: center;
}

.ops-item-detail-button {
  min-height: 34px;
  padding: 0 8px;
}

.ops-item-remove-button {
  min-height: 34px;
  padding: 0 8px;
}

.auction-history-controls {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(240px, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.auction-listing-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.auction-sub-tabs {
  justify-content: flex-start;
}

.auction-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auction-pager.compact {
  justify-content: flex-end;
}

.auction-pager button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.auction-pager button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.auction-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.auction-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.auction-history-card {
  align-content: start;
}

.auction-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.auction-card-top span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auction-card-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.auction-card-field > span:first-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.auction-card-field .table-link,
.auction-item-link,
.auction-value-text,
.auction-price {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auction-user-link {
  min-height: 30px;
  padding: 0;
  font-size: 13px;
}

.auction-item-link {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.auction-item-link:hover,
.auction-user-link:hover {
  text-decoration: underline;
}

.auction-value-text {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.auction-price {
  color: var(--ink);
  font-size: 15px;
}

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

@media (max-width: 1680px) {
  .balance-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

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

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

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

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

@media (max-width: 980px) {
  .coupon-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .retention-version-row,
  .retention-day-grid,
  .balance-list,
  .ops-config-quick-row,
  .coupon-card-head {
    grid-template-columns: 1fr;
  }

  .ops-config-quick-head {
    align-items: stretch;
    flex-direction: column;
  }

  .coupon-toolbar,
  .coupon-reward-head {
    align-items: stretch;
    flex-direction: column;
  }

  .coupon-core-grid,
  .coupon-reward-row,
  .update-note-board,
  .note-editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .auction-history-controls,
  .auction-card-grid {
    grid-template-columns: 1fr;
  }
}

.item-modal-panel {
  width: min(720px, 100%);
}

.item-grant-modal-panel {
  width: min(1040px, 100%);
}

.item-grant-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 360px);
  gap: 14px;
  align-items: start;
}

.item-grant-picker,
.item-grant-form {
  display: grid;
  gap: 10px;
}

.item-grant-category-tabs,
.item-grant-weapon-tabs,
.item-grant-equipment-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.item-grant-category-tab,
.item-grant-weapon-tab,
.item-grant-equipment-tab {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.item-grant-category-tab span,
.item-grant-weapon-tab span,
.item-grant-equipment-tab span {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #edf2f7;
  color: #526177;
  font-size: 10px;
}

.item-grant-category-tab:hover,
.item-grant-category-tab.active {
  border-color: var(--primary);
  background: #eaf7f3;
  color: var(--primary-dark);
}

.item-grant-category-tab.active span {
  background: var(--primary);
  color: white;
}

.item-grant-weapon-tabs,
.item-grant-equipment-tabs {
  padding: 8px;
  border: 1px solid #dbe9f7;
  border-radius: 8px;
  background: #f4f8fd;
}

.item-grant-weapon-tab,
.item-grant-equipment-tab {
  min-height: 30px;
  padding: 5px 9px;
  background: transparent;
}

.item-grant-weapon-tab:hover,
.item-grant-weapon-tab.active,
.item-grant-equipment-tab:hover,
.item-grant-equipment-tab.active {
  border-color: var(--blue);
  background: white;
  color: var(--blue);
}

.item-grant-search-row input,
.item-grant-form input,
.item-grant-form select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
}

.item-grant-list {
  display: grid;
  gap: 8px;
  max-height: min(560px, calc(100vh - 260px));
  overflow: auto;
  padding-right: 4px;
}

.item-grant-list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.item-grant-list-summary strong {
  color: var(--ink);
}

.item-grant-row {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.item-grant-row:hover,
.item-grant-row.active {
  border-color: var(--primary);
  background: #eef6ff;
}

.item-grant-row.disabled {
  opacity: 0.55;
}

.item-grant-row span,
.item-grant-selected span,
.item-grant-selected small {
  color: var(--muted);
  font-size: 12px;
}

.item-grant-row .item-grant-row-title {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.item-grant-row-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-grant-row-title em {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: #e7f3ff;
  color: var(--blue);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.item-grant-selected {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.item-grant-selected strong {
  font-size: 18px;
}

.item-grant-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.item-grant-form button {
  min-height: 42px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 900;
}

.item-detail-layout {
  display: grid;
  gap: 14px;
}

.item-detail-summary {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.item-detail-summary strong {
  font-size: 18px;
}

.item-detail-summary span,
.item-detail-summary em {
  color: var(--muted);
  font-size: 12px;
}

.item-detail-summary em {
  color: var(--danger);
  font-style: normal;
  font-weight: 800;
}

.item-detail-list {
  grid-template-columns: 108px minmax(0, 1fr);
}

.item-detail-section {
  display: grid;
  gap: 8px;
}

.item-detail-section h3 {
  margin: 0;
  font-size: 14px;
}

.item-detail-part {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.item-detail-part span,
.item-detail-part small {
  color: var(--muted);
  font-size: 12px;
}

.item-detail-option-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 1fr);
  gap: 6px 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.item-detail-option-grid span {
  color: var(--muted);
}

.item-edit-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.item-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.item-edit-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.item-edit-grid input,
.item-edit-grid select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.item-edit-potential {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.item-edit-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item-edit-subhead span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.item-edit-potential-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(110px, 150px);
  gap: 8px;
}

.item-edit-potential-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.item-edit-potential-row input,
.item-edit-potential-row select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.item-edit-actions {
  display: flex;
  justify-content: flex-end;
}

.event-item {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.event-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}

.event-title span {
  overflow-wrap: anywhere;
}

.event-tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8eef7;
  color: #334155;
  font-size: 11px;
}

.event-tag.danger {
  background: #ffe6e6;
  color: #a52f2f;
}

.event-tag.ok {
  background: #e6f7f1;
  color: var(--primary-dark);
}

.event-tag.warning {
  background: #fff4df;
  color: #8b5d14;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.compact-empty {
  padding: 16px;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 16px;
  border-radius: 8px;
  background: #172033;
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* G4: categorize operator feedback by severity so 권한없음/2차승인/필드누락/서버오류를
   한눈에 구분한다. 기본(kind 없음)은 기존 중립 스타일 유지. */
.toast.kind-info { border-left: 4px solid #3d7bd9; }
.toast.kind-success { border-left: 4px solid #2f9e6f; }
.toast.kind-warn { border-left: 4px solid #d9a13d; }
.toast.kind-error { border-left: 4px solid #d95757; }

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .metric-grid,
  .content-grid,
  .chart-strip,
  .config-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .config-item-grid {
    grid-template-columns: repeat(3, minmax(118px, 1fr));
  }

  .config-summary-grid,
  .config-tier-grid,
  .config-entry-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

  .user-card-grid {
    grid-template-columns: repeat(3, minmax(128px, 1fr));
  }

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

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

}

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

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

  main {
    padding: 20px;
  }

  .topbar-main,
  .panel-head,
  .config-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-left {
    align-items: flex-start;
    flex-direction: column;
  }

  .target-context-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .target-context-bar > span:nth-child(2) {
    border-right: 0;
  }

  .target-context-bar > span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .top-actions,
  .token-actions {
    grid-template-columns: 1fr 1fr;
    display: grid;
  }

  .metric-grid,
  .content-grid,
  .compact-event-grid,
  .dense-log-grid,
  .dense-ban-grid,
  .chart-strip,
  .health-grid,
  .time-grid,
  .user-card-grid,
  .system-chat-row,
  .chat-global-targets,
  .chat-scope-fields,
  .chat-dispatch-result,
  .ops-item-add-row,
  .item-grant-layout,
  .config-layout,
  .config-multiplier-row,
  .cash-range-row,
  .config-item-grid,
  .config-summary-grid,
  .config-tier-grid,
  .config-entry-form,
  .config-reward-item-row {
    grid-template-columns: 1fr;
  }

  #reportStatusTabs {
    display: flex;
    overflow-x: auto;
  }

  #reportStatusTabs button {
    flex: 0 0 auto;
  }

  .reports-grid,
  #reportsList .report-action-row {
    grid-template-columns: 1fr;
  }

  .chat-sender-mode {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-sender-mode span {
    margin-left: 0;
  }

  .config-subhead,
  .config-reward-card-head,
  .config-entry-weight-line {
    align-items: stretch;
    flex-direction: column;
  }

  .config-reward-tags {
    justify-content: flex-start;
  }

  .config-reward-actual {
    text-align: left;
  }

  .health-main {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

#section-game-config .config-layout,
#section-game-config .config-multiplier-row,
#section-game-config .config-metrics .metric:nth-child(1),
#section-game-config .config-metrics .metric:nth-child(3),
#section-game-config .config-metrics .metric:nth-child(4) {
  display: none;
}

#section-game-config .config-metrics {
  grid-template-columns: minmax(180px, 300px);
}

.config-chance-summary,
.config-ticket-row {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.config-chance-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px 14px;
}

.config-chance-summary span {
  color: var(--muted);
  font-size: 12px;
}

.config-ticket-row {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.config-ticket-row label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 6px;
}

.config-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.config-summary-card {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.config-summary-card span,
.config-summary-card small,
.config-subhead span,
.config-entry-weight-line span,
.config-reward-card-head span,
.config-reward-item-name span,
.config-reward-actual span {
  color: var(--muted);
  font-size: 12px;
}

.config-summary-card strong {
  font-size: 22px;
}

.config-total-badge.ok {
  color: var(--primary-dark);
}

.config-total-badge.warning {
  color: var(--amber);
}

.config-total-badge.danger {
  color: var(--danger);
}

.config-tier-editor,
.config-reward-card {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.config-subhead,
.config-reward-card-head,
.config-entry-weight-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.config-subhead h3 {
  margin: 0;
  font-size: 14px;
}

.config-tier-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 8px;
}

.config-tier-grid label,
.config-entry-form label,
.config-reward-item-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.config-tier-grid input,
.config-entry-form input,
.config-reward-item-row input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  outline: none;
}

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

.config-reward-card {
  background: white;
}

.config-reward-card-head strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.config-reward-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.config-entry-form {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) repeat(3, minmax(110px, 0.7fr));
  gap: 8px;
  margin-bottom: 10px;
}

.config-entry-weight-line {
  min-height: 34px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.config-reward-items {
  display: grid;
  gap: 8px;
}

.config-reward-item-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 160px) minmax(90px, 120px);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.config-reward-item-name {
  min-width: 0;
}

.config-reward-item-name strong,
.config-reward-item-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-reward-actual {
  display: grid;
  gap: 4px;
  text-align: right;
}

.config-reward-actual strong {
  font-size: 16px;
}

/* Ops console common dense layout. Keep new tools on shared modal/chart patterns. */
.metric {
  min-height: 104px;
  padding: 14px 16px;
}

.metric strong {
  margin-top: 6px;
  font-size: 25px;
}

.panel {
  padding: 14px;
}

.chart-card {
  min-height: 158px;
  padding: 13px;
}

.sparkline {
  height: 94px;
}

.panel-head {
  margin-bottom: 12px;
}

.compact-toolbar,
.modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.donut-breakdown {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 4px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.donut-breakdown svg {
  width: 92px;
  height: 92px;
  transform: rotate(-90deg);
}

.donut-breakdown text {
  transform: rotate(90deg);
  transform-origin: center;
  fill: var(--ink);
  font-size: 6px;
  font-weight: 900;
}

.donut-breakdown text + text {
  fill: var(--muted);
  font-size: 4px;
}

.donut-legend {
  display: grid;
  gap: 6px;
}

.donut-legend span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.donut-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.donut-legend b {
  color: var(--ink);
}

@media (max-width: 1120px) {
  .config-summary-grid,
  .config-tier-grid,
  .config-entry-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .cs-action-field-grid {
    grid-template-columns: 1fr;
  }

  .cs-section-head,
  .cs-action-row,
  .cs-action-footer,
  .cs-readonly-row {
    align-items: stretch;
    flex-direction: column;
  }

  .config-summary-grid,
  .config-tier-grid,
  .config-entry-form,
  .config-reward-item-row {
    grid-template-columns: 1fr;
  }

  .config-subhead,
  .config-reward-card-head,
  .config-entry-weight-line {
    align-items: stretch;
    flex-direction: column;
  }

  .config-reward-tags {
    justify-content: flex-start;
  }

  .config-reward-actual {
    text-align: left;
  }
}

.config-reward-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.config-reward-board {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.config-prefix-package-board {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.config-reward-board-head > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.config-reward-board-head strong {
  font-size: 16px;
}

.config-reward-board-head span {
  color: var(--muted);
  font-size: 12px;
}

.config-reward-toolbar div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.config-reward-toolbar strong {
  font-size: 14px;
}

.config-reward-toolbar span,
.config-item-tier-head span {
  color: var(--muted);
  font-size: 12px;
}

.config-reward-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.config-entry-item-add {
  display: grid;
  grid-template-columns: minmax(160px, 220px) auto;
  gap: 8px;
  margin-bottom: 0;
}

.config-entry-item-add input {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  outline: none;
}

.config-prefix-package-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.config-prefix-package-row {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #cfd9e8;
  border-radius: 8px;
  background: #f8fbff;
}

.config-prefix-package-row.locked {
  border-color: #bfe5db;
  background: #f3fbf8;
}

.config-prefix-package-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.config-prefix-package-head .event-tag,
.config-prefix-package-head .ghost {
  grid-column: 2;
  justify-self: end;
}

.config-prefix-package-head input,
.config-prefix-weight-grid input,
.config-reward-package-line select {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 6px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  outline: none;
}

.config-prefix-package-head input[readonly],
.config-prefix-weight-grid input[readonly],
.config-reward-package-line select:disabled {
  border-color: #d6e5df;
  background: #eef8f5;
  color: #0f766e;
  font-weight: 900;
  opacity: 1;
}

.prefix-package-bar {
  display: flex;
  overflow: hidden;
  height: 24px;
  border: 1px solid #d7e0ec;
  border-radius: 8px;
  background: #eef2f7;
}

.prefix-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
  color: white;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.prefix-bar-segment b {
  overflow: hidden;
  padding: 0 8px;
  text-overflow: ellipsis;
}

.prefix-bar-segment.tier-normal {
  background: #8f98a6;
}

.prefix-bar-segment.tier-advanced {
  background: #169b81;
}

.prefix-bar-segment.tier-special {
  background: #2f80c8;
}

.prefix-bar-segment.tier-rare {
  background: #c1841d;
}

.prefix-bar-segment.tier-legendary {
  background: #c94747;
}

.prefix-bar-empty {
  display: grid;
  width: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

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

.config-prefix-weight-grid label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.config-prefix-weight-grid input {
  min-height: 26px;
  padding: 3px 5px;
  text-align: right;
}

.config-reward-items {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}

.config-reward-items > .empty {
  grid-column: 1 / -1;
}

.config-reward-item-row {
  grid-template-columns: 1fr;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border-color: #cfd9e8;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.config-reward-item-head,
.config-item-tier-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.config-reward-item-actions {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.config-reward-item-actions .config-reward-tags {
  justify-content: flex-end;
}

.config-reward-item-head .ghost,
.config-reward-card-actions .ghost {
  min-height: 26px;
  padding: 4px 7px;
  font-size: 11px;
  white-space: nowrap;
}

.ghost.danger {
  border-color: #fecaca;
  color: var(--danger);
  background: #fff5f5;
}

.config-reward-item-row.normal-tier-locked {
  border-color: #bfe5db;
  background: #fbfffd;
}

.config-item-tier-panel {
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.config-item-tier-panel.locked {
  border-color: #cce9e1;
  background: #f3fbf8;
}

.config-reward-core-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 5px;
}

.config-reward-core-grid label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.config-reward-core-grid input {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 5px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  text-align: right;
  outline: none;
}

.config-reward-item-row > label,
.config-reward-package-line {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.config-reward-item-row > label input,
.config-reward-package-line select {
  min-height: 28px;
  padding: 4px 6px;
  font-size: 12px;
}

.config-entry-form.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 0;
}

.config-entry-form.compact label {
  gap: 3px;
  font-size: 10px;
}

.config-entry-form.compact input {
  min-height: 27px;
  padding: 4px 3px;
  font-size: 12px;
  text-align: right;
}

.config-item-tier-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.config-item-tier-grid label {
  display: grid;
  grid-template-columns: 44px 46px;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.config-item-tier-grid label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-item-tier-grid input {
  min-height: 26px;
  width: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 4px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  text-align: right;
  outline: none;
}

.config-item-tier-grid input:disabled {
  border-color: #d6e5df;
  background: #eef8f5;
  color: #0f766e;
  font-weight: 900;
  opacity: 1;
}

@media (max-width: 1280px) {
  .config-reward-items {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .config-reward-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .config-reward-toolbar,
  .config-reward-board-head,
  .config-reward-card-head,
  .config-reward-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .config-entry-item-add,
  .config-prefix-package-list,
  .config-reward-items,
  .config-reward-core-grid {
    grid-template-columns: 1fr;
  }

  .config-prefix-weight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1320px) {
  .dropoff-version-grid,
  .quest-dropoff-period-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  .dropoff-version-grid,
  .dropoff-stat-grid,
  .quest-dropoff-period-grid,
  .quest-dropoff-period-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 118px;
  }

  body {
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 25;
    height: auto;
    gap: 8px;
    padding: 10px 12px 8px;
    box-shadow: 0 10px 24px rgba(12, 20, 33, 0.22);
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand strong {
    font-size: 13px;
    line-height: 1.2;
  }

  .brand small {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: 6px;
    margin: 0 -2px;
    padding: 2px 2px 7px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-group-label {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .nav-item:hover,
  .nav-item.active {
    background: #f8fafc;
    color: var(--ink);
  }

  .token-panel {
    margin-top: 2px;
    gap: 7px;
    padding-top: 8px;
  }

  .token-panel label,
  .token-panel small {
    font-size: 11px;
  }

  .token-panel input,
  .token-panel button {
    min-height: 36px;
  }

  main {
    padding: 12px;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 12px;
  }

  .topbar-main {
    gap: 10px;
  }

  .topbar-left {
    gap: 8px;
  }

  .eyebrow {
    display: none;
  }

  h1 {
    font-size: 20px;
    line-height: 1.2;
  }

  h2 {
    font-size: 15px;
  }

  .server-target-switch {
    width: 100%;
  }

  .top-actions {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .top-actions button,
  .state-pill {
    min-height: 36px;
  }

  .state-pill {
    min-width: 0;
    padding: 8px 10px;
    border-radius: 8px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .metric {
    min-height: 82px;
    padding: 10px;
  }

  .metric strong {
    margin-top: 4px;
    font-size: 22px;
  }

  .metric span,
  .metric small {
    font-size: 11px;
    line-height: 1.25;
  }

  .panel {
    padding: 10px;
    box-shadow: 0 8px 22px rgba(23, 32, 51, 0.06);
  }

  .panel-head {
    gap: 8px;
    margin-bottom: 10px;
  }

  .dashboard-online-pager {
    width: 100%;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .dashboard-online-pager button {
    width: 42px;
    min-width: 42px;
  }

  .panel-help {
    line-height: 1.42;
  }

  .panel-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 6px;
    width: 100%;
  }

  .panel-actions button,
  .panel-actions .compact,
  .compact,
  .ghost-button,
  .primary-button,
  .warning-button,
  .danger-button,
  .secondary {
    min-width: 0;
    min-height: 34px;
    padding-inline: 8px;
    white-space: normal;
  }

  .chart-strip,
  .content-grid,
  .event-list,
  .logs-layout {
    gap: 10px;
  }

  .chart-card {
    min-height: 128px;
    padding: 10px;
  }

  .sparkline {
    height: 76px;
  }

  .health-grid,
  .time-grid,
  .config-summary-grid {
    gap: 8px;
  }

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

  .user-card {
    min-height: 74px;
    gap: 5px;
    padding: 9px;
  }

  .user-card strong {
    font-size: 13px;
  }

  .user-card span,
  .user-card small {
    font-size: 11px;
  }

  .dense-log-grid,
  .dense-ban-grid,
  .compact-event-grid,
  .auction-card-grid,
  .ops-inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .event-item,
  .auction-card,
  .coupon-card,
  .balance-card,
  .config-reward-card,
  .config-prefix-package-card,
  .ops-inventory-item {
    padding: 9px;
  }

  .activity-filter-tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .activity-filter-tabs button {
    flex: 0 0 auto;
    min-width: 64px;
  }

  input,
  select,
  textarea,
  .search {
    min-width: 0;
    font-size: 16px;
  }

  .search {
    width: 100%;
  }

  .table-wrap,
  .ops-table-wrap,
  .config-table-wrap {
    margin-inline: -2px;
  }

  .ops-table,
  .compact-table,
  .config-reward-table {
    min-width: 680px;
  }

  .modal-backdrop {
    align-items: stretch;
    padding: 8px;
  }

  .modal-panel {
    width: 100%;
    max-height: calc(100dvh - 16px);
  }

  .modal-head {
    padding: 10px 12px;
  }

  .modal-close {
    width: 34px;
    height: 34px;
  }

  .modal-body {
    gap: 10px;
    padding: 12px;
  }

  .modal-actions,
  .ops-user-grant-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .metric-grid,
  .user-card-grid,
  .dense-log-grid,
  .dense-ban-grid,
  .compact-event-grid,
  .auction-card-grid,
  .ops-inventory-grid {
    grid-template-columns: 1fr;
  }

  .top-actions,
  .token-actions {
    grid-template-columns: 1fr;
  }
}

.mini-login-history {
  display: grid;
  gap: 4px;
  margin: 8px 0 10px;
  padding: 8px;
  border: 1px solid #d6e0ef;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
}

.mini-login-history span {
  display: block;
  line-height: 1.35;
}
.victor-config-panel {
  margin-top: 18px;
  border-color: rgba(155, 48, 55, 0.45);
  background: linear-gradient(145deg, rgba(75, 20, 24, 0.14), rgba(255, 255, 255, 0.98));
}

.victor-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
}

.victor-config-grid .victor-wide-field {
  grid-column: span 3;
}

@media (max-width: 900px) {
  .victor-config-grid .victor-wide-field {
    grid-column: 1 / -1;
  }
}

.death-log-panel,
.death-breakdown-panel {
  margin-bottom: 18px;
}

.death-log-tabs {
  max-width: 420px;
  margin: 16px 0 12px;
}

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

.death-event-grid .event-item,
.death-breakdown-grid > div {
  min-width: 0;
}

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

@media (max-width: 1200px) {
  .death-breakdown-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .death-log-tabs {
    max-width: none;
  }

  .death-event-grid {
    grid-template-columns: 1fr;
  }
}

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

.data-region-status {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid #64748b;
  border-radius: 12px;
  background: var(--panel);
}

.data-region-status.success {
  border-left-color: #1b8f73;
}

.data-region-status.loading {
  border-left-color: #2f6fde;
}

.data-region-status.error,
.data-region-status.stale {
  border-left-color: #d64545;
}

.data-region-status > div:first-child,
.data-region-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.data-region-status > div:first-child > span,
.data-region-meta span,
.data-region-status small {
  color: var(--muted);
  font-size: 12px;
}

.data-region-status > div:first-child > strong {
  font-size: 15px;
}

.data-region-meta {
  align-items: flex-end;
  text-align: right;
}

.data-region-meta button {
  margin-top: 4px;
}

.data-state-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 18px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 11px;
}

.data-state-legend b {
  color: var(--ink);
}

.data-card-meta {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.last-success-data {
  box-shadow: inset 0 0 0 1px rgba(183, 121, 31, 0.35);
}

.last-success-data .data-card-meta {
  color: #b7791f;
}

.data-connection-failed .data-card-meta {
  color: #d64545;
}

.health-label.unavailable {
  color: var(--muted);
  background: rgba(100, 116, 139, 0.12);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sidebar {
    padding: 20px 16px;
  }

  main {
    padding: 22px;
  }

  .topbar-main {
    flex-wrap: wrap;
  }

  .global-user-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .situation-priority-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .data-region-grid {
    grid-template-columns: 1fr;
  }

  .data-region-status {
    flex-direction: column;
  }

  .data-region-meta {
    align-items: flex-start;
    text-align: left;
  }
}

.game-config-workflow-host {
  margin: 18px 0;
}

.game-config-workflow-panel {
  border-color: rgba(91, 137, 255, 0.32);
  background:
    radial-gradient(circle at 90% 0%, rgba(70, 112, 255, 0.11), transparent 36%),
    var(--panel);
}

.config-draft-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(86, 204, 139, 0.35);
  border-radius: 999px;
  color: #b9f2d1;
  background: rgba(49, 157, 101, 0.12);
  font-size: 12px;
}

.config-draft-badge.empty,
.config-draft-badge.validation_failed,
.config-draft-badge.green_verification_failed {
  border-color: rgba(255, 184, 77, 0.35);
  color: #ffd59a;
  background: rgba(171, 101, 18, 0.12);
}

.config-stage-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.config-stage-track article {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 3px 9px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.config-stage-track article b {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.config-stage-track article span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.config-stage-track article small {
  color: var(--muted);
  font-size: 11px;
}

.config-stage-track article.complete {
  border-color: rgba(86, 204, 139, 0.38);
  background: rgba(49, 157, 101, 0.09);
}

.config-stage-track article.complete b {
  color: #dcffea;
  background: #258957;
}

.config-stage-track article.error {
  border-color: rgba(255, 107, 107, 0.42);
  background: rgba(179, 50, 50, 0.09);
}

.config-stage-track article.error b {
  color: #fff;
  background: #b54444;
}

.config-change-reason {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr);
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.config-change-reason input {
  width: 100%;
}

.config-workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.config-workflow-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.config-safety-note {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 184, 77, 0.28);
  border-radius: 10px;
  color: #ffd59a;
  background: rgba(171, 101, 18, 0.08);
  font-size: 12px;
}

.config-workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 12px;
  margin-top: 14px;
}

.config-workflow-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.config-workflow-grid details {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
}

.config-workflow-grid summary {
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.config-diff-summary,
.config-validation-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 11px;
}

.config-validation-summary strong,
.config-diff-summary strong {
  color: var(--text);
  font-size: 13px;
}

.config-validation-summary.ok strong {
  color: #8be7b4;
}

.config-validation-summary.danger strong {
  color: #ff9a9a;
}

.config-diff-table {
  overflow: auto;
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.config-diff-head,
.config-diff-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(180px, 1fr) minmax(180px, 1fr);
}

.config-diff-head {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #181b23;
  font-size: 11px;
  font-weight: 800;
}

.config-diff-head span,
.config-diff-row > * {
  min-width: 0;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.config-diff-row code {
  color: #b8c9ff;
  word-break: break-all;
}

.config-diff-row pre {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}

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

.config-check-grid article {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 11px;
}

.config-check-grid article.ok {
  border-color: rgba(86, 204, 139, 0.28);
}

.config-check-grid article.ok span {
  color: #8be7b4;
}

.config-check-grid article.danger {
  border-color: rgba(255, 107, 107, 0.32);
}

.config-check-grid article.danger span {
  color: #ff9a9a;
}

.config-issue-list,
.config-history-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
  margin-top: 10px;
}

.config-issue-list > div,
.config-history-list > div {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
}

.config-issue-list > div.danger {
  border-color: rgba(255, 107, 107, 0.28);
}

.config-issue-list > div.warning {
  border-color: rgba(255, 184, 77, 0.24);
}

.config-issue-list code {
  color: #b8c9ff;
}

.config-history-list strong {
  color: var(--text);
}

@media (max-width: 1100px) {
  .config-stage-track {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .config-workflow-grid,
  .config-workflow-grid.compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .config-stage-track,
  .config-check-grid {
    grid-template-columns: 1fr;
  }

  .config-change-reason {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   MODERN REDESIGN LAYER — Tailwind / shadcn-inspired reskin (2026-07-28)
   Appended override sheet. Preserves every id/class app.js depends on; only
   touches visual props (color, background, border, shadow, radius, spacing).
   Layout grids + responsive breakpoints stay owned by the earlier rules.
   ============================================================================ */

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Typography scale --------------------------------------------------- */
h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.eyebrow {
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.panel-help { color: var(--muted); }

/* ============================================================================
   1. SIDEBAR — light Slate/Zinc tone, airy spacing, calm nav
   ============================================================================ */
.sidebar {
  gap: 18px;
  padding: 22px 14px;
  background: var(--sidebar);
  color: var(--ink);
  border-right: 1px solid var(--line);
}
.brand { padding: 2px 8px; }
.brand strong { color: var(--ink); font-weight: 800; }
.brand small,
.token-panel small { color: var(--muted); }
.brand-mark {
  border: 1px solid var(--line);
  background: #0f172a;
  border-radius: 10px;
}

.nav-list { gap: 2px; }
.nav-group-label {
  margin: 14px 12px 4px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-item {
  min-height: 38px;
  border-radius: var(--radius-sm);
  color: #475569;
  font-weight: 600;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.nav-item-primary { font-weight: 700; }
.nav-item-child {
  min-height: 34px;
  color: #64748b;
  font-weight: 500;
}
.nav-item:hover {
  background: var(--sidebar-soft);
  color: var(--ink);
}
.nav-item.active {
  background: var(--sidebar-soft);
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
}

/* ---- Account / auth + approval inbox pinned at the bottom ---------------- */
.token-panel {
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.token-panel label { color: #334155; }
.token-panel input,
.token-panel .ghost {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.token-panel .ghost { color: #475569; font-weight: 600; }
.token-panel .ghost:hover { background: var(--sidebar-soft); }
.operator-session-summary {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f0fdf9;
}
.operator-session-summary strong { color: var(--ink); }
.operator-session-summary span { color: var(--muted); }
.operator-session-summary em {
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary-dark);
}
.legacy-login-panel {
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}
.legacy-login-panel summary { color: #475569; }
.approval-inbox-head button {
  background: var(--panel-soft);
  color: #475569;
  border: 1px solid var(--line);
}
.approval-inbox-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}
.approval-inbox-row span,
.approval-inbox-row small,
.approval-inbox-empty { color: var(--muted); }

/* ============================================================================
   2. TOP HEADER — separated hierarchy: search / server / status
   ============================================================================ */
main { padding: 24px 28px 40px; }

.topbar {
  gap: 14px;
  padding: 14px 0 12px;
  margin-bottom: 20px;
  background: rgba(241, 245, 249, 0.86);
  border-bottom: 1px solid var(--line);
}
.topbar-main { gap: 20px; }

.global-user-search { gap: 6px; }
.global-user-search label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.global-user-search input {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
}
.global-user-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 157, 118, 0.14);
}
.global-user-search button {
  min-height: 42px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  font-weight: 700;
}
.global-user-search button:hover { background: #1e293b; }

/* Server target selector */
.server-target-trigger {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.server-target-trigger:hover { border-color: var(--primary); }
.server-target-menu {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}
.server-target-menu button.active { background: var(--primary); }

/* Connection state + refresh */
.top-actions { gap: 8px; }
.state-pill {
  min-width: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
}
.state-pill.connected { background: #dcfce7; color: #166534; }
.top-actions button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #334155;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.top-actions button:hover { background: var(--panel-soft); border-color: var(--primary); }

/* Target context strip — borderless divider row, not a heavy card */
.target-context-bar {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.target-context-bar > span {
  padding: 2px 18px 2px 0;
  margin-right: 18px;
  border-right: 1px solid var(--line-strong);
}
.target-context-bar > span:last-child { margin-right: 0; }
.target-context-bar small {
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.target-context-bar strong { color: var(--ink); font-weight: 700; }

/* ============================================================================
   3. DATA-REGION status + legend — soft cards, subtle status rail
   ============================================================================ */
.data-region-status {
  border: 0;
  border-left: 3px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.data-region-status.idle { border-left-color: #cbd5e1; }

/* ============================================================================
   4. PANELS / METRICS / CHARTS — remove borders, soft background separation
   ============================================================================ */
.metric,
.panel,
.chart-card,
.ops-card {
  border: 0;
  border-radius: var(--radius);
}
.panel,
.chart-card {
  background: var(--panel);
  box-shadow: var(--shadow);
}
.panel { padding: 20px 22px; }
.chart-card { padding: 18px 20px; }

/* Metric tiles — compact, borderless, key numbers bold */
.metric {
  padding: 18px 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.metric strong {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.metric small { color: var(--muted); }
/* Only the key money metric gets the primary accent */
.metric[data-metric="revenue"] strong { color: var(--primary-dark); }

.ops-card {
  background: var(--panel-soft);
  box-shadow: none;
}
.ops-card strong { color: var(--ink); font-weight: 800; letter-spacing: -0.02em; }

.chart-head strong { color: var(--ink); font-weight: 800; letter-spacing: -0.01em; }

/* ============================================================================
   5. SITUATION ("action needed") — clean inline alert cards
   ============================================================================ */
.situation-priority-grid { gap: 20px; margin-bottom: 20px; }
.situation-action {
  border: 0;
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  background: #fffbeb;
  padding: 12px 14px;
}
.situation-action.danger { border-left-color: var(--danger); background: #fef2f2; }
.situation-action strong { color: var(--ink); font-weight: 700; font-size: 13px; }
.situation-action span { color: var(--muted); }
.action-count { color: var(--danger); font-weight: 800; }

/* ============================================================================
   6. SERVER HEALTH — compact metric grid, soft tiles
   ============================================================================ */
.health-panel { margin-bottom: 20px; }
.health-label {
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}
.health-check {
  border: 0;
  border-left: 3px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}
.health-check span { color: var(--muted); font-weight: 600; }
.health-check strong { color: var(--ink); font-weight: 700; }

/* ============================================================================
   7. ONLINE USERS — avatar badge + label hierarchy
   ============================================================================ */
.dashboard-users-panel { margin-bottom: 20px; }
.user-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.user-card:hover,
.user-card.selected {
  border-color: var(--primary);
  background: var(--panel);
  box-shadow: 0 4px 16px rgba(15, 157, 118, 0.14);
  transform: translateY(-1px);
}
.user-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}
.user-card-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.user-card-body strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-card-body span,
.user-card-body small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================================
   8. Section rhythm — generous whitespace between regions
   ============================================================================ */
.metric-grid { gap: 16px; margin-bottom: 20px; }
.chart-strip { gap: 16px; margin-bottom: 20px; }
.content-grid { gap: 20px; }
.panel { margin-bottom: 20px; }
