:root {
  color-scheme: light;
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #172033;
  --muted: #657084;
  --subtle: #9aa4b2;
  --line: #d9e0ea;
  --line-soft: #e8edf4;
  --accent: #1f6feb;
  --accent-dark: #1957b8;
  --accent-soft: #eef5ff;
  --success: #047857;
  --success-soft: #eafaf3;
  --warning: #b54708;
  --warning-soft: #fff7e8;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --violet: #6d28d9;
  --shadow: 0 10px 30px rgba(23, 32, 51, 0.08);
  --radius: 8px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button[aria-busy="true"] {
  cursor: wait;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.notice {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.export-compliance-notice {
  margin: -4px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(183, 106, 22, 0.22);
  border-radius: 8px;
  color: var(--warning);
  background: var(--warning-soft);
  font-weight: 800;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toast-in 0.16s ease-out;
}

.toast strong {
  color: var(--ink);
}

.toast span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.danger {
  border-left-color: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, calc(100vw - 64px));
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-form,
.drawer-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

textarea {
  min-height: 104px;
  resize: vertical;
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 800;
}

.button-primary {
  color: #fff;
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}

.button-danger {
  color: var(--danger);
  border-color: #ffd0cc;
  background: var(--danger-soft);
}

.icon-button {
  width: 36px;
  padding: 0;
  border-color: var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 22px;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 20px;
  border-right: 1px solid var(--line-soft);
  background: #fbfcfe;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line-soft);
}

.admin-nav {
  display: grid;
  gap: 6px;
}

.admin-nav button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.admin-nav button:hover,
.admin-nav button.is-active {
  color: var(--ink);
  background: var(--accent-soft);
}

.admin-main {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px;
}

.admin-topbar,
.panel,
.metric-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.admin-account,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-account span {
  color: var(--muted);
  font-weight: 800;
}

.admin-section {
  display: grid;
  gap: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 700;
}

.metric-card strong {
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}

.metric-card small {
  color: var(--subtle);
}

.panel {
  padding: 16px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.summary-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.summary-row span {
  color: var(--muted);
}

.toolbar {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.toolbar input {
  max-width: 320px;
}

.toolbar select {
  width: auto;
  min-width: 128px;
}

.export-image-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  background: #fff;
  white-space: nowrap;
}

.export-image-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.table-panel {
  width: 100%;
  max-width: calc(100vw - 288px);
  overflow: auto;
  padding: 0;
  scrollbar-gutter: stable both-edges;
}

.table-panel.is-virtual {
  max-height: min(64vh, 620px);
}

.admin-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.admin-table th,
.admin-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-table td {
  color: var(--ink);
  background: var(--surface);
}

.admin-table tbody tr:hover td {
  background: #fbfcfe;
}

.table-panel::-webkit-scrollbar,
.drawer-panel::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-panel::-webkit-scrollbar-thumb,
.drawer-panel::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #c7d1e0;
  background-clip: padding-box;
}

.table-panel::-webkit-scrollbar-track,
.drawer-panel::-webkit-scrollbar-track {
  background: #f3f6fa;
}

.table-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
}

.table-pager-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.table-pager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.table-pager-actions .button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.table-pager-actions label {
  display: inline-flex;
  grid-template-columns: none;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.table-pager-actions select {
  width: auto;
  min-width: 74px;
  min-height: 30px;
  padding: 4px 8px;
}

.cell-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cell-main small,
.hash-cell {
  color: var(--subtle);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 900;
}

.status-paid,
.status-true,
.status-configured,
.status-match-hit {
  color: var(--success);
  background: var(--success-soft);
}

.status-pending,
.status-trial,
.status-mock,
.status-match-suspect {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-disabled,
.status-expired,
.status-void,
.status-false,
.status-missing {
  color: var(--danger);
  background: var(--danger-soft);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions .button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.payment-config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.payment-config-form {
  display: grid;
  gap: 16px;
}

.config-panel {
  display: grid;
  gap: 14px;
}

.config-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.config-form .span-2 {
  grid-column: span 2;
}

.config-form .button {
  width: fit-content;
}

.ai-price-panel {
  gap: 12px;
}

.ai-price-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-price-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ai-price-strip {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.ai-price-strip span,
.ai-price-strip small,
.ai-price-muted {
  color: var(--muted);
}

.ai-price-strip strong,
.ai-price-model,
.ai-price-value {
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.ai-price-details {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.ai-price-details[hidden] {
  display: none !important;
}

.ai-price-table {
  min-width: 760px;
}

.ai-price-table th,
.ai-price-table td {
  padding: 10px 12px;
}

.ai-price-role {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-price-role span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
}

.tool-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-actions input {
  max-width: 260px;
}

.config-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.config-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.field-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
}

.field-status.is-configured {
  color: var(--success);
  background: var(--success-soft);
}

.field-status.is-missing {
  color: var(--danger);
  background: var(--danger-soft);
}

@media (max-width: 760px) {
  .ai-price-summary {
    grid-template-columns: 1fr;
  }

  .ai-price-header .button {
    width: 100%;
  }
}

.payment-actions {
  justify-content: flex-start;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.dialog-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 51, 0.42);
}

.dialog-panel {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  margin: 18vh auto 0;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 51, 0.38);
}

.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(720px, 100%);
  display: grid;
  align-content: start;
  gap: 16px;
  overflow: auto;
  padding: 20px;
  background: var(--surface);
  box-shadow: -12px 0 32px rgba(23, 32, 51, 0.16);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.drawer-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.drawer-form .button {
  align-self: end;
}

.drawer-section {
  display: grid;
  gap: 10px;
}

.danger-zone {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #ffd0cc;
  border-radius: var(--radius);
  background: var(--danger-soft);
}

.danger-zone h3 {
  color: var(--danger);
}

.drawer-list {
  display: grid;
  gap: 8px;
}

.drawer-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.match-drawer-panel {
  width: min(880px, 100%);
}

.match-screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.match-screenshot-grid figure {
  position: relative;
  min-height: 220px;
  display: grid;
  align-content: start;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.match-screenshot-grid figcaption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.match-screenshot-grid img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface);
  cursor: zoom-in;
}

.match-screenshot-grid img:focus-visible {
  outline: 3px solid rgba(45, 106, 230, 0.35);
  outline-offset: 3px;
}

.match-screenshot-grid figure.is-empty {
  align-content: center;
  text-align: center;
}

.match-screenshot-grid figure.is-empty::after {
  content: attr(data-empty);
  color: var(--subtle);
  font-weight: 800;
}

.match-screenshot-grid figure.is-empty img {
  display: none;
}

#matchEvidence {
  white-space: pre-wrap;
}

.image-preview {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 16px;
}

.image-preview[hidden] {
  display: none;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.84);
  cursor: zoom-out;
  backdrop-filter: blur(2px);
}

.image-preview img {
  position: relative;
  z-index: 1;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 90px rgba(15, 23, 42, 0.44);
  background: #0f172a;
}

.image-preview-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(15, 23, 42, 0.72);
}

html.preview-lock,
body.preview-lock {
  overflow: hidden;
}

html.export-lock,
body.export-lock {
  overflow: hidden;
}

.export-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 20, 30, 0.58);
  backdrop-filter: blur(4px);
  cursor: wait;
}

.export-overlay-card {
  display: grid;
  width: min(380px, 100%);
  justify-items: center;
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: #14202d;
  text-align: center;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(18, 24, 33, 0.24);
}

.export-overlay-card strong {
  font-size: 18px;
}

.export-overlay-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.export-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #d7e2df;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: export-spin 0.8s linear infinite;
}

@keyframes export-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .admin-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .admin-nav button {
    flex: 0 0 auto;
    text-align: center;
    white-space: nowrap;
  }

  .table-panel {
    max-width: calc(100vw - 24px);
  }

  .metric-grid,
  .metric-grid.compact,
  .payment-config-grid,
  .two-column,
  .match-screenshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .login-view {
    justify-items: center;
    padding: 24px 16px;
  }

  .login-panel {
    width: min(460px, calc(100vw - 32px));
    max-width: 100%;
    padding: 28px 24px;
  }

  .admin-main,
  .admin-sidebar {
    padding: 12px;
  }

  .admin-topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar input,
  .toolbar select,
  .toolbar .export-image-toggle,
  .toolbar .button {
    width: 100%;
    max-width: none;
  }

  .table-pager {
    align-items: stretch;
    flex-direction: column;
  }

  .table-pager-actions {
    justify-content: stretch;
  }

  .table-pager-actions .button,
  .table-pager-actions label,
  .table-pager-actions select {
    width: 100%;
  }

  .metric-grid,
  .metric-grid.compact,
  .payment-config-grid,
  .config-form,
  .two-column,
  .match-screenshot-grid,
  .drawer-form {
    grid-template-columns: 1fr;
  }

  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .config-form .span-2 {
    grid-column: auto;
  }
}

/* 2026-06-05 premium operations console refresh */
:root {
  --bg: #edf2f4;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --ink: #121821;
  --muted: #5f6a7a;
  --subtle: #8d98a8;
  --line: #d8e0e8;
  --line-soft: #e8edf2;
  --accent: #087465;
  --accent-dark: #07564d;
  --accent-soft: #eaf7f4;
  --gold: #b88931;
  --success: #047857;
  --success-soft: #eafaf3;
  --warning: #b76a16;
  --warning-soft: #fff7e8;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --shadow: 0 16px 42px rgba(18, 24, 33, 0.1);
}

.admin-body {
  background:
    linear-gradient(180deg, #f8fafb 0%, #edf2f4 54%, #f5f2eb 100%);
}

.eyebrow {
  color: var(--gold);
  font-weight: 900;
  text-transform: none;
}

.login-view {
  background:
    linear-gradient(135deg, rgba(16, 22, 32, 0.96), rgba(17, 42, 43, 0.94)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 80px);
}

.login-panel {
  width: min(460px, calc(100vw - 64px));
  padding: 32px;
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 250, 0.94));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.24);
}

input,
select,
textarea {
  min-height: 40px;
  border-color: rgba(18, 24, 33, 0.12);
  border-radius: 8px;
  background: #fbfcfd;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(8, 116, 101, 0.54);
  box-shadow: 0 0 0 3px rgba(8, 116, 101, 0.12);
}

.button,
.icon-button {
  border-radius: 8px;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button:not(:disabled):hover,
.icon-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, #101620, #1a2b31 52%, var(--accent));
  box-shadow: 0 12px 28px rgba(18, 24, 33, 0.16);
}

.button-primary:hover {
  background: linear-gradient(135deg, #101620, #203136 52%, var(--accent-dark));
}

.button-secondary {
  border-color: rgba(18, 24, 33, 0.12);
  background: rgba(255, 255, 255, 0.94);
}

.admin-shell {
  grid-template-columns: 268px minmax(0, 1fr);
}

.admin-sidebar {
  gap: 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, #101620 0%, #122326 64%, #0f1a20 100%);
  box-shadow: 12px 0 36px rgba(18, 24, 33, 0.12);
}

.admin-sidebar .brand {
  padding: 4px 2px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-color: rgba(184, 137, 49, 0.32);
  box-shadow: 0 12px 28px rgba(8, 116, 101, 0.16);
}

.admin-sidebar h1,
.admin-sidebar .eyebrow {
  color: #fff;
}

.admin-sidebar .eyebrow {
  opacity: 0.72;
}

.admin-nav {
  gap: 5px;
}

.admin-nav button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-weight: 850;
}

.admin-nav button:hover,
.admin-nav button.is-active {
  color: #fff;
  border-color: rgba(184, 137, 49, 0.22);
  background: linear-gradient(90deg, rgba(184, 137, 49, 0.2), rgba(8, 116, 101, 0.2));
}

.admin-main {
  gap: 18px;
  padding: 22px;
}

.admin-topbar {
  border-color: rgba(18, 24, 33, 0.08);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.admin-topbar h2 {
  color: #101620;
  font-size: 24px;
}

.panel,
.metric-card,
.toolbar,
.dialog-panel,
.drawer-panel,
.config-card {
  border-color: rgba(18, 24, 33, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 250, 0.95));
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 18px;
}

.metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, var(--gold), var(--accent));
}

.metric-card span,
.summary-row span,
.admin-account span,
label {
  color: var(--muted);
}

.metric-card strong {
  color: #101620;
  font-size: 30px;
}

.toolbar {
  padding: 14px;
}

.table-panel {
  max-width: calc(100vw - 310px);
  border-color: rgba(18, 24, 33, 0.08);
  background: #fff;
}

.admin-table th {
  color: #5d6878;
  background:
    linear-gradient(180deg, #fbfcfd, #f3f7f6);
}

.admin-table td {
  color: #172033;
}

.admin-table tbody tr:hover td {
  background: #f7faf9;
}

.status-pill {
  min-height: 26px;
  border-radius: 8px;
  font-weight: 900;
}

.drawer-backdrop,
.dialog-backdrop {
  background: rgba(16, 22, 32, 0.54);
  backdrop-filter: blur(2px);
}

.drawer-panel {
  box-shadow: -24px 0 70px rgba(18, 24, 33, 0.18);
}

.drawer-form,
.drawer-item,
.match-screenshot-grid figure {
  border-color: rgba(18, 24, 33, 0.08);
  background: #f8fbfa;
}

.toast {
  border-radius: 8px;
  box-shadow: 0 20px 54px rgba(18, 24, 33, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    background: linear-gradient(180deg, #101620, #122326);
  }

  .table-panel {
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 640px) {
  .login-view {
    width: 100%;
    justify-items: center;
    padding: 24px 16px;
  }

  .login-panel {
    width: min(460px, calc(100vw - 64px));
    max-width: 460px;
    min-width: 0;
    padding: 28px 24px;
  }
}
