﻿@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --bg: #c9d0d6;
  --bg-2: #d7dde2;
  --ink: #14120f;
  --muted: #6d675f;
  --accent: #21c56e;
  --accent-2: #f9b24e;
  --card: #b8c1c8;
  /* Higher contrast borders / separators. */
  --stroke: #d8cfbf;
  --stroke-strong: #b9ad97;
  /* Slightly crisper shadow so cards/controls read better on beige background. */
  --shadow: 0 26px 60px rgba(24, 20, 14, 0.10), 0 1px 0 rgba(255, 255, 255, 0.75) inset;
  --shadow-soft: 0 14px 34px rgba(24, 20, 14, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 0%, #d7dde2, var(--bg) 55%) fixed;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: -1;
}


.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  gap: 20px;
  flex-wrap: wrap;
}

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

.brand-dot {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(33, 197, 110, 0.18), 0 0 10px rgba(33, 197, 110, 0.28);
}

.brand-title {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  margin-right: 16px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.18s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}


.nav a:hover {
  color: var(--ink);
  border-color: rgba(33, 197, 110, 0.34);
  background: rgba(33, 197, 110, 0.10);
  box-shadow: 0 0 0 1px rgba(33, 197, 110, 0.16), 0 0 14px rgba(33, 197, 110, 0.24);
}

.nav a:active {
  transform: translateY(1px) scale(0.98);
}

.nav a.active {
  color: var(--ink);
  border-color: rgba(33, 197, 110, 0.44);
  background: rgba(33, 197, 110, 0.14);
  box-shadow: 0 0 0 1px rgba(33, 197, 110, 0.22), 0 0 18px rgba(33, 197, 110, 0.34);
  animation: nav-neon-pulse 1.9s ease-in-out infinite;
}

@keyframes nav-neon-pulse {
  0% {
    box-shadow: 0 0 0 1px rgba(33, 197, 110, 0.18), 0 0 12px rgba(33, 197, 110, 0.24);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(33, 197, 110, 0.28), 0 0 22px rgba(33, 197, 110, 0.40);
  }
  100% {
    box-shadow: 0 0 0 1px rgba(33, 197, 110, 0.18), 0 0 12px rgba(33, 197, 110, 0.24);
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 14px 16px;
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand-title {
    max-width: 60vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-sub {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .user-chip {
    font-size: 12px;
    padding: 6px 10px;
  }

  .logout {
    font-size: 12px;
  }

  .nav {
    order: 3;
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 4px;
  }

  .nav a {
    flex: 0 0 auto;
    margin-right: 0;
    padding: 8px 10px;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
  }

  .nav a.active {
    border-bottom: none;
    padding-bottom: 8px;
    background: rgba(31, 122, 85, 0.12);
    border-color: rgba(31, 122, 85, 0.28);
  }

  .content {
    padding: 0 16px 28px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 16px;
  }

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

  .pill {
    align-self: flex-start;
    max-width: 100%;
    word-break: break-word;
  }

  .card-header {
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
  }

  .actions {
    flex-wrap: wrap;
  }

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

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

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .table {
    font-size: 13px;
  }

  .table th,
  .table td {
    padding: 8px 10px;
  }
}

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

.sound-toggle {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.sound-test {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.sound-toggle.on {
  border-color: rgba(249, 178, 78, 0.55);
  background: rgba(249, 178, 78, 0.16);
  color: #7a4a00;
}

.sound-toggle.off {
  background: rgba(120, 120, 120, 0.12);
  color: #4b4b4b;
  border: 1px solid rgba(120, 120, 120, 0.28);
}

.user-chip {
  background: #fff6e5;
  color: #8a5b11;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
}

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

.content {
  padding: 0 40px 40px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 6px 0;
  font-size: 32px;
}

.pill {
  padding: 6px 14px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.overview-top {
  /* Two primary cards on the dashboard (balance + profit). */
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

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

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}

@media (max-width: 520px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.triple {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .triple {
    grid-template-columns: 1fr;
  }
}

.mini-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.mini-card .big {
  font-size: 28px;
  line-height: 1.1;
}

.profit-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
  align-items: start;
}

.profit-right {
  border-left: 1px dashed var(--stroke);
  padding-left: 14px;
}

.profit-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.profit-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.profit-item .val {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.profit-item .val.neg {
  color: #b02020;
}

.profit-item .val.pos {
  color: var(--accent);
}

@media (max-width: 768px) {
  .profit-panel {
    grid-template-columns: 1fr;
  }
  .profit-right {
    border-left: none;
    padding-left: 0;
    border-top: 1px dashed var(--stroke);
    padding-top: 12px;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke-strong);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.card > h3 {
  margin: 0 0 10px 0;
}

.card-header h3 {
  margin: 0;
}

.card.compact {
  padding: 16px;
}

.card.compact .triple,
.card.compact .profit-panel {
  margin-top: 8px;
}

.balance-card,
.profit-card {
  min-height: 210px;
}

.balance-card {
  display: flex;
  flex-direction: column;
}

.balance-card .triple {
  /* Make the inner mini-cards stretch to fill the card height (no big empty bottom). */
  flex: 1;
  align-items: stretch;
}

.balance-card .mini-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
}

.balance-card .mini-card .muted {
  font-size: 12px;
  line-height: 1.35;
}

.balance-card .mini-card .total {
  margin-top: 10px;
}

.profit-card {
  display: flex;
  flex-direction: column;
}

.profit-card .profit-panel {
  flex: 1;
  align-items: stretch;
}

.profit-card .profit-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profit-card .profit-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.actions {
  display: flex;
  gap: 10px;
}

.btn {
  background: var(--accent);
  color: white;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(33, 197, 110, 0.44);
  box-shadow: 0 0 0 1px rgba(33, 197, 110, 0.24), 0 0 14px rgba(33, 197, 110, 0.30);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, border-color 120ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 0 0 1px rgba(33, 197, 110, 0.30), 0 0 20px rgba(33, 197, 110, 0.42);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid rgba(33, 150, 83, 0.25);
  outline-offset: 2px;
}

.btn-primary {
  box-shadow: 0 0 0 1px rgba(33, 197, 110, 0.28), 0 0 18px rgba(33, 197, 110, 0.38);
}

.btn-login {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
}

.btn.tiny {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.btn.danger {
  background: #b02020;
  border-color: rgba(176, 32, 32, 0.55);
  box-shadow: 0 0 0 1px rgba(176, 32, 32, 0.26), 0 0 16px rgba(176, 32, 32, 0.36);
}

.btn.ghost {
  background: rgba(33, 197, 110, 0.08);
  border: 1px solid rgba(33, 197, 110, 0.34);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(33, 197, 110, 0.14), 0 0 12px rgba(33, 197, 110, 0.20);
}

.btn.ghost:hover {
  background: rgba(33, 197, 110, 0.13);
  border-color: rgba(33, 197, 110, 0.44);
  box-shadow: 0 0 0 1px rgba(33, 197, 110, 0.22), 0 0 18px rgba(33, 197, 110, 0.32);
}

.btn.ghost:active {
  transform: translateY(1px);
}

.btn.ghost.danger {
  border-color: rgba(176, 32, 32, 0.35);
  background: rgba(176, 32, 32, 0.08);
  color: #7f1212;
  box-shadow: 0 0 0 1px rgba(176, 32, 32, 0.20), 0 0 14px rgba(176, 32, 32, 0.24);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.4;
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke-strong);
  text-align: left;
}

.table th {
  font-weight: 700;
  color: #2a2f33;
  background: rgba(79, 84, 87, 0.14);
  border-bottom: 1px solid var(--stroke-strong);
}

.table tr:hover td {
  background: rgba(249, 178, 78, 0.14);
}

.table tbody tr:nth-child(odd) td {
  background: rgba(79, 84, 87, 0.10);
}

.table tbody tr:nth-child(even) td {
  background: rgba(79, 84, 87, 0.06);
}

.table th.col-actions,
.table td.col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.ads-table th.col-actions,
.ads-table td.col-actions {
  /* Keep a stable width so action buttons don't reflow on status changes. */
  width: 280px;
  /* Allow the action buttons to wrap inside the cell (no horizontal scrolling). */
  white-space: normal;
}

.ads-table {
  table-layout: fixed; /* prevents long IDs from stretching columns */
  border-collapse: separate;
  border-spacing: 0 8px;
}

.ads-table th.col-methods,
.ads-table td.col-methods {
  width: 180px;
  max-width: 180px;
}

/* Card-like rows for ads list (as in reference style). */
.ads-table tbody tr.ads-row td {
  border-top: 1px solid rgba(79, 84, 87, 0.28);
  border-bottom: 1px solid rgba(79, 84, 87, 0.28);
  background: rgba(79, 84, 87, 0.08);
}

.ads-table tbody tr.ads-row td:first-child {
  border-left: 1px solid rgba(79, 84, 87, 0.28);
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.ads-table tbody tr.ads-row td:last-child {
  border-right: 1px solid rgba(79, 84, 87, 0.28);
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.ads-table tbody tr.ads-row-buy td {
  background: rgba(33, 197, 110, 0.10);
  border-top-color: rgba(33, 197, 110, 0.40);
  border-bottom-color: rgba(33, 197, 110, 0.40);
}

.ads-table tbody tr.ads-row-buy td:first-child {
  border-left-color: rgba(33, 197, 110, 0.40);
}

.ads-table tbody tr.ads-row-buy td:last-child {
  border-right-color: rgba(33, 197, 110, 0.40);
}

.ads-table tbody tr.ads-row-sell td {
  background: rgba(176, 32, 32, 0.09);
  border-top-color: rgba(176, 32, 32, 0.40);
  border-bottom-color: rgba(176, 32, 32, 0.40);
}

.ads-table tbody tr.ads-row-sell td:first-child {
  border-left-color: rgba(176, 32, 32, 0.40);
}

.ads-table tbody tr.ads-row-sell td:last-child {
  border-right-color: rgba(176, 32, 32, 0.40);
}

.ads-table tbody tr.ads-row:hover td {
  filter: brightness(1.015);
}

.ads-table .methods-clip {
  /* Show all payment methods (wrap; no truncation). */
  white-space: normal;
  overflow: visible;
  line-height: 1.25;
  word-break: break-word;
}

.ads-table .ads-limits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ads-table .ads-limits .limit-val {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 7px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1px;
  border-bottom: 2px solid rgba(176, 32, 32, 0.72);
}

.ads-table .ads-limits .limit-min {
  background: rgba(176, 32, 32, 0.12);
  border: 1px solid rgba(176, 32, 32, 0.30);
  color: #7f1212;
}

.ads-table .ads-limits .limit-max {
  background: rgba(176, 32, 32, 0.12);
  border: 1px solid rgba(176, 32, 32, 0.30);
  color: #7f1212;
}

.ads-table .ads-limits .limit-sep {
  color: rgba(45, 50, 54, 0.66);
  font-weight: 700;
}

.ads-table .col-order-num .ads-id-btn {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.cell-actions {
  display: inline-flex;
  gap: 8px;
  justify-content: flex-end;
}

.ads-actions {
  gap: 10px;
}

/* Ads page: pack action buttons into a compact, non-scrolling grid. */
.ads-table .cell-actions.ads-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  justify-content: end;
  align-items: center;
}

.ads-table .cell-actions.ads-actions .btn {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ads-table .cell-actions.ads-actions .ads-btn-price,
.ads-table .cell-actions.ads-actions .ads-btn-toggle,
.ads-table .cell-actions.ads-actions .ads-btn-dup,
.ads-table .cell-actions.ads-actions .ads-btn-auto {
  min-width: 0; /* override fixed min-widths used elsewhere */
}

.ads-actions .ads-btn-price {
  min-width: 56px;
  text-align: center;
}

.ads-actions .ads-btn-toggle {
  min-width: 104px; /* keeps rows stable */
  text-align: center;
}

.ads-actions .ads-btn-dup {
  min-width: 72px;
  text-align: center;
}

.ads-actions .ads-btn-auto {
  min-width: 104px; /* keep rows stable */
  text-align: center;
  position: relative; /* for open-deal indicator dot */
}

/* Side-based coloring in Ads table: BUY -> green, SELL -> red. */
.ads-actions.ads-side-buy .ads-btn-price,
.ads-actions.ads-side-buy .ads-btn-toggle,
.ads-actions.ads-side-buy .ads-btn-dup,
.ads-actions.ads-side-buy .ads-btn-auto:not(.ads-auto-on):not(.ads-auto-off):not(.ads-auto-paused) {
  background: rgba(33, 197, 110, 0.16);
  border: 1px solid rgba(33, 197, 110, 0.48);
  color: #0f5a37;
  box-shadow: 0 0 0 1px rgba(33, 197, 110, 0.20), 0 0 14px rgba(33, 197, 110, 0.28);
}

.ads-actions.ads-side-sell .ads-btn-price,
.ads-actions.ads-side-sell .ads-btn-toggle,
.ads-actions.ads-side-sell .ads-btn-dup,
.ads-actions.ads-side-sell .ads-btn-auto:not(.ads-auto-on):not(.ads-auto-off):not(.ads-auto-paused) {
  background: rgba(176, 32, 32, 0.16);
  border: 1px solid rgba(176, 32, 32, 0.48);
  color: #7f1212;
  box-shadow: 0 0 0 1px rgba(176, 32, 32, 0.20), 0 0 14px rgba(176, 32, 32, 0.28);
}

/* "Price" and "Duplicate" are always red for both BUY/SELL. */
.ads-actions .ads-btn-price,
.ads-actions .ads-btn-dup {
  background: rgba(176, 32, 32, 0.16) !important;
  border: 1px solid rgba(176, 32, 32, 0.48) !important;
  color: #7f1212 !important;
  box-shadow: 0 0 0 1px rgba(176, 32, 32, 0.20), 0 0 14px rgba(176, 32, 32, 0.28) !important;
}

.ads-actions .ads-btn-auto-settings {
  min-width: 44px;
  text-align: center;
  font-weight: 700;
}

.ads-actions .ads-btn-auto.ads-auto-open-deal::after,
.ads-actions .ads-btn-auto.ads-auto-open-appeal::after {
  content: "";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid #f7f2e8;
  box-shadow: 0 0 0 1px rgba(20, 20, 20, 0.06);
}

.ads-actions .ads-btn-auto.ads-auto-open-deal::after {
  background: rgba(249, 178, 78, 0.95);
}

.ads-actions .ads-btn-auto.ads-auto-open-appeal::after {
  background: rgba(126, 87, 194, 0.95);
}

.ads-actions .ads-btn-auto.ads-auto-on {
  background: rgba(27, 138, 74, 0.14);
  color: #145a34;
  border: 1px solid rgba(27, 138, 74, 0.28);
}

.ads-actions .ads-btn-auto.ads-auto-off {
  background: rgba(120, 120, 120, 0.12);
  color: #4b4b4b;
  border: 1px solid rgba(120, 120, 120, 0.28);
}

.ads-actions .ads-btn-auto.ads-auto-paused {
  background: rgba(249, 178, 78, 0.20);
  color: #6a3f00;
  border: 1px solid rgba(249, 178, 78, 0.45);
}

.auto-modal {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auto-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}

.auto-row.auto-row-actions {
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: center;
}

.auto-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.auto-check {
  width: 18px;
  height: 18px;
  margin-top: 8px;
}

.auto-info {
  font-size: 12px;
  line-height: 1.35;
  padding-top: 2px;
}

@media (max-width: 720px) {
  .auto-row {
    grid-template-columns: 1fr;
  }
  .auto-row.auto-row-actions {
    grid-template-columns: 1fr;
  }
}

.ads-actions .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.ads-actions .ads-btn-toggle.ads-toggle-on {
  /* Ad is online now (button says "Р’С‹РєР»СЋС‡РёС‚СЊ") */
  background: rgba(249, 178, 78, 0.25);
  color: #6a3f00;
  border: 1px solid rgba(249, 178, 78, 0.55);
}

.ads-actions .ads-btn-toggle.ads-toggle-off {
  /* Ad is offline now (button says "Р’РєР»СЋС‡РёС‚СЊ") */
  background: rgba(120, 120, 120, 0.12);
  color: #4b4b4b;
  border: 1px solid rgba(120, 120, 120, 0.28);
}

.ads-actions .ads-btn-toggle.ads-toggle-on:hover,
.ads-actions .ads-btn-toggle.ads-toggle-off:hover {
  filter: brightness(1.03);
}

.center-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.parser-preset {
  display: flex;
  flex-direction: column;
}

.parser-preset-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.parser-preset-actions .btn {
  padding: 7px 12px;
}

.multi-select {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.multi-select-top {
  display: flex;
  gap: 8px;
  align-items: center;
}

.multi-select-top input {
  flex: 1 1 auto;
}

.multi-select-top .btn.tiny {
  padding: 8px 10px;
  border-radius: 10px;
}

.multi-select-list {
  display: none;
  border: 1px solid var(--stroke);
  background: var(--card);
  border-radius: 10px;
  padding: 6px;
  max-height: 170px;
  overflow: auto;
}

.multi-select.open .multi-select-list {
  display: block;
}

.multi-select-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.multi-select-item:hover {
  background: rgba(31, 122, 85, 0.06);
}

.multi-select-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.filter-order-number input {
  width: 100%;
}

.col-order-num {
  width: 110px;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

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

.badge.appeal {
  border-color: rgba(176, 32, 32, 0.35);
  background: rgba(176, 32, 32, 0.08);
  color: #7f1212;
}

.badge.pending {
  border-color: rgba(249, 178, 78, 0.55);
  background: rgba(249, 178, 78, 0.16);
  color: #7a4a00;
}

.badge.trading {
  border-color: rgba(31, 122, 85, 0.45);
  background: rgba(31, 122, 85, 0.10);
  color: #0f5a3c;
}

@media (max-width: 768px) {
  .col-order-num {
    width: 90px;
    max-width: 90px;
  }
}

.filters label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

input,
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--stroke-strong);
  border-radius: 8px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(31, 122, 85, 0.55);
  box-shadow: 0 0 0 4px rgba(31, 122, 85, 0.14), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

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

.notice {
  border: 1px solid var(--stroke-strong);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  margin: 0 0 14px 0;
}

.notice-title {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.notice-body {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.notice-link {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(20, 18, 15, 0.25);
  padding-bottom: 1px;
  margin-left: 8px;
  white-space: nowrap;
}

.notice-link:hover {
  border-bottom-color: rgba(20, 18, 15, 0.5);
}

.notice-warn {
  border-color: rgba(249, 178, 78, 0.55);
  background: radial-gradient(circle at 30% 0%, rgba(249, 178, 78, 0.20), rgba(255, 255, 255, 0.78) 55%);
}

.notice-warn .notice-title {
  color: #7a4a00;
}

.big {
  font-size: 32px;
  font-weight: 600;
}

.total {
  margin-top: 10px;
  font-weight: 600;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 32px;
  width: min(420px, 90vw);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin-top: 16px;
}

.login-card form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.login-card button {
  margin-top: 6px;
}

.btn:disabled,
button.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}
.error {
  background: #ffe5e5;
  color: #b02020;
  padding: 8px 10px;
  border-radius: 8px;
  margin-top: 10px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.35);
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--card);
  padding: 20px;
  border-radius: 16px;
  width: min(420px, 90vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-body {
  overflow-y: auto;
  overflow-x: hidden; /* prevent horizontal scrolling inside modals */
  padding-right: 4px; /* keep scrollbar from overlapping content */
}

.modal-body .table-wrap {
  max-height: 60vh;
  overflow: auto;
}

.modal-body .table {
  table-layout: fixed;
}

.modal-body .table th,
.modal-body .table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-body .table td input,
.modal-body .table td select {
  min-width: 0;
}

.merge-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
  max-width: 100%;
  min-width: 0;
}

.merge-row > div {
  min-width: 0;
}

.merge-row select {
  width: 100%;
  min-width: 0;
}

.merge-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
  max-width: 100%;
}

.merge-confirm {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 10px;
  flex-wrap: wrap;
}

.merge-confirm .muted {
  margin-right: 6px;
}

/* Orders -> Chat modal */
.chat-modal-content {
  max-width: 720px;
  width: min(720px, 96vw);
}

.order-modal-content {
  max-width: 900px;
  width: min(900px, 96vw);
}

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

.order-modal-head h4 {
  margin: 0 0 4px 0;
}

.order-modal-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.order-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0 6px;
  border-bottom: 1px solid var(--stroke);
  margin-bottom: 10px;
}

.tab-btn {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(31, 122, 85, 0.12);
  border-color: rgba(31, 122, 85, 0.28);
}

.order-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.order-detail-card {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.65);
}

.order-detail-card.selected {
  border-color: rgba(31, 122, 85, 0.35);
  background: rgba(31, 122, 85, 0.06);
}

.pill {
  display: inline-block;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 700;
  color: var(--ink);
}

.pill.tiny {
  font-size: 11px;
  padding: 2px 8px;
}

.order-detail-card h5 {
  margin: 0 0 10px 0;
  font-size: 14px;
}

.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 6px 10px;
  font-size: 13px;
}

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

.kv .v {
  min-width: 0;
  word-break: normal;
  overflow-wrap: anywhere;
}

.chat-compose-files {
  grid-template-columns: 1fr auto;
  margin-top: 8px;
}

.chat-msg .bubble img.chat-image {
  display: block;
  max-width: 260px;
  max-height: 260px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  cursor: pointer;
}

.order-appeal-box {
  border: 1px dashed var(--stroke-strong);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.chat-messages {
  height: 340px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
}

.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 10px;
  align-items: center;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  max-width: 90%;
}

.chat-msg .meta {
  font-size: 11px;
  color: var(--muted);
}

.chat-msg .bubble {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--card);
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg.self {
  margin-left: auto;
  align-items: flex-end;
}

.chat-msg.self .bubble {
  background: rgba(31, 122, 85, 0.08);
  border-color: rgba(31, 122, 85, 0.30);
}

.chat-msg.sys .bubble {
  background: rgba(249, 178, 78, 0.10);
  border-color: rgba(249, 178, 78, 0.35);
}

@media (max-width: 768px) {
  .chat-modal-content {
    max-width: 96vw;
  }
  .order-modal-content {
    max-width: 96vw;
  }
  .order-detail-grid {
    grid-template-columns: 1fr;
  }
  .kv {
    grid-template-columns: 120px 1fr;
  }
  .chat-messages {
    height: 52vh;
  }
}

@media (max-width: 520px) {
  .merge-row {
    grid-template-columns: 1fr;
  }
  .merge-actions {
    justify-content: stretch;
  }
  .merge-actions button {
    width: 100%;
  }
  .merge-confirm {
    justify-content: stretch;
  }
  .merge-confirm button {
    width: 100%;
  }
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .content {
    padding: 0 20px 40px;
  }
}




/* === Kostyan Exchange Theme Override (Neon Dark) === */
:root {
  --bg: #080f1a;
  --bg-2: #0d1626;
  --ink: #e8f7ff;
  --muted: #8fb6cf;
  --accent: #11e3a1;
  --accent-2: #2aa8ff;
  --card: rgba(11, 20, 36, 0.84);
  --stroke: rgba(87, 196, 255, 0.28);
  --stroke-strong: rgba(87, 196, 255, 0.48);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(17, 227, 161, 0.08) inset;
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.30);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, rgba(40, 120, 255, 0.18), transparent 33%),
    radial-gradient(circle at 85% 0%, rgba(17, 227, 161, 0.14), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg-2)) fixed;
}

.bg-grid {
  background-image:
    linear-gradient(rgba(87, 196, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 196, 255, 0.08) 1px, transparent 1px);
}

.topbar {
  background: rgba(5, 12, 24, 0.86);
  border-bottom: 1px solid var(--stroke);
  box-shadow: 0 0 24px rgba(42, 168, 255, 0.16);
  backdrop-filter: blur(8px);
}

.brand-title {
  color: #e9fdff;
  text-shadow: 0 0 10px rgba(42, 168, 255, 0.6), 0 0 18px rgba(17, 227, 161, 0.26);
}

.brand-sub,
.logout,
.user-chip,
.nav a,
.card-head span,
label,
.kv .k,
.muted,
.small-muted {
  color: var(--muted) !important;
}

.brand-dot {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(17, 227, 161, 0.18), 0 0 12px rgba(17, 227, 161, 0.32);
}

.nav a {
  border: 1px solid transparent;
  border-radius: 999px;
}

.nav a:hover {
  color: #e8feff !important;
  border-color: rgba(42, 168, 255, 0.45);
  background: rgba(42, 168, 255, 0.10);
  box-shadow: 0 0 0 1px rgba(42, 168, 255, 0.25), 0 0 14px rgba(42, 168, 255, 0.24);
}

.nav a.active {
  color: #e8feff !important;
  border-color: rgba(17, 227, 161, 0.55);
  background: rgba(17, 227, 161, 0.14);
  box-shadow: 0 0 0 1px rgba(17, 227, 161, 0.25), 0 0 18px rgba(17, 227, 161, 0.34);
}

.hero h1,
.card h3,
.card h4,
.card h2,
.card > h3 {
  color: #eaf9ff;
  text-shadow: 0 0 18px rgba(42, 168, 255, 0.24);
}

.pill,
.user-chip {
  background: rgba(9, 18, 33, 0.7) !important;
  color: #c6ebff !important;
  border: 1px solid rgba(87, 196, 255, 0.38) !important;
}

.card,
.table-wrap,
.login-card,
.modal-content,
.notice {
  background: var(--card) !important;
  border: 1px solid var(--stroke) !important;
  box-shadow: var(--shadow);
}

.card:hover,
.login-card:hover {
  border-color: rgba(17, 227, 161, 0.5) !important;
  box-shadow: 0 0 0 1px rgba(17, 227, 161, 0.13) inset, 0 12px 34px rgba(0, 0, 0, 0.4), 0 0 18px rgba(17, 227, 161, 0.18);
}

.table {
  background: rgba(7, 14, 26, 0.72) !important;
}

.table th {
  background: rgba(19, 33, 57, 0.88) !important;
  color: #c9ebff !important;
  border-bottom-color: rgba(87, 196, 255, 0.35) !important;
}

.table td {
  border-bottom-color: rgba(143, 182, 207, 0.2) !important;
  color: #e8f7ff;
}

.table tr:hover td {
  background: rgba(30, 74, 119, 0.24) !important;
}

input,
select,
textarea,
.input,
.select {
  background: rgba(8, 16, 29, 0.85) !important;
  color: #e7fbff !important;
  border: 1px solid rgba(143, 182, 207, 0.4) !important;
}

input:focus,
select:focus,
textarea:focus,
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent-2) !important;
  box-shadow: 0 0 0 3px rgba(42, 168, 255, 0.2), 0 0 12px rgba(42, 168, 255, 0.4) !important;
}

.btn,
button.btn,
button {
  border: 1px solid rgba(17, 227, 161, 0.72) !important;
  background: linear-gradient(90deg, rgba(13, 147, 207, 0.9), rgba(17, 227, 161, 0.85)) !important;
  color: #f3ffff !important;
  box-shadow: 0 0 12px rgba(17, 227, 161, 0.32), 0 0 20px rgba(42, 168, 255, 0.24);
}

.btn:hover,
button.btn:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(17, 227, 161, 0.5), 0 0 26px rgba(42, 168, 255, 0.32);
}

.btn.ghost,
button.ghost,
.sound-toggle,
.sound-test {
  background: rgba(9, 18, 33, 0.72) !important;
  color: #c6ebff !important;
  border: 1px solid rgba(87, 196, 255, 0.45) !important;
  box-shadow: none !important;
}

.btn.danger,
button.danger {
  background: linear-gradient(90deg, rgba(184, 42, 42, 0.92), rgba(246, 87, 87, 0.86)) !important;
  border-color: rgba(255, 107, 107, 0.65) !important;
}

.notice-warn {
  background: rgba(255, 138, 61, 0.12) !important;
  border-color: rgba(255, 158, 102, 0.4) !important;
  color: #ffd7bf !important;
}

.footer,
.content .subtle,
.help,
.hint {
  color: var(--muted) !important;
}

/* === Light Neon Variant Override === */
:root {
  --bg: #edf4fb;
  --bg-2: #f7fbff;
  --ink: #15324a;
  --muted: #5b7b94;
  --accent: #14c48d;
  --accent-2: #3d95ff;
  --card: rgba(255, 255, 255, 0.86);
  --stroke: rgba(61, 149, 255, 0.30);
  --stroke-strong: rgba(61, 149, 255, 0.52);
  --shadow: 0 14px 34px rgba(24, 62, 94, 0.12), 0 0 0 1px rgba(20, 196, 141, 0.07) inset;
  --shadow-soft: 0 12px 28px rgba(24, 62, 94, 0.10);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, rgba(61, 149, 255, 0.16), transparent 32%),
    radial-gradient(circle at 85% 0%, rgba(20, 196, 141, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-2)) fixed;
}

.bg-grid {
  background-image:
    linear-gradient(rgba(61, 149, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 149, 255, 0.08) 1px, transparent 1px);
}

.topbar {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--stroke);
  box-shadow: 0 0 22px rgba(61, 149, 255, 0.12);
}

.brand-title {
  color: #184668;
  text-shadow: 0 0 9px rgba(61, 149, 255, 0.35), 0 0 14px rgba(20, 196, 141, 0.18);
}

.brand-sub,
.logout,
.user-chip,
.nav a,
.card-head span,
label,
.kv .k,
.muted,
.small-muted {
  color: var(--muted) !important;
}

.nav a:hover {
  color: #1a4e74 !important;
  border-color: rgba(61, 149, 255, 0.45);
  background: rgba(61, 149, 255, 0.10);
}

.nav a.active {
  color: #0e395a !important;
  border-color: rgba(20, 196, 141, 0.55);
  background: rgba(20, 196, 141, 0.14);
}

.card,
.table-wrap,
.login-card,
.modal-content,
.notice {
  background: var(--card) !important;
  border: 1px solid var(--stroke) !important;
  box-shadow: var(--shadow);
}

.table {
  background: rgba(255, 255, 255, 0.86) !important;
}

.table th {
  background: rgba(232, 242, 253, 0.95) !important;
  color: #23577f !important;
}

.table td {
  color: #173f60;
}

.table tr:hover td {
  background: rgba(61, 149, 255, 0.10) !important;
}

input,
select,
textarea,
.input,
.select {
  background: rgba(255, 255, 255, 0.93) !important;
  color: #163f5f !important;
  border: 1px solid rgba(61, 149, 255, 0.35) !important;
}

input:focus,
select:focus,
textarea:focus,
.input:focus,
.select:focus {
  border-color: var(--accent-2) !important;
  box-shadow: 0 0 0 3px rgba(61, 149, 255, 0.18), 0 0 10px rgba(61, 149, 255, 0.24) !important;
}

.btn,
button.btn,
button {
  border: 1px solid rgba(20, 196, 141, 0.62) !important;
  background: linear-gradient(90deg, rgba(61, 149, 255, 0.86), rgba(20, 196, 141, 0.78)) !important;
  color: #f7feff !important;
}

.btn.ghost,
button.ghost,
.sound-toggle,
.sound-test {
  background: rgba(247, 251, 255, 0.9) !important;
  color: #2a5c82 !important;
  border: 1px solid rgba(61, 149, 255, 0.4) !important;
}

/* === Theme Toggle (Day/Night) === */
body.theme-light {
  --bg: #edf4fb;
  --bg-2: #f7fbff;
  --ink: #15324a;
  --muted: #5b7b94;
  --accent: #14c48d;
  --accent-2: #3d95ff;
  --card: rgba(255, 255, 255, 0.86);
  --stroke: rgba(61, 149, 255, 0.30);
  --stroke-strong: rgba(61, 149, 255, 0.52);
  --shadow: 0 14px 34px rgba(24, 62, 94, 0.12), 0 0 0 1px rgba(20, 196, 141, 0.07) inset;
  --shadow-soft: 0 12px 28px rgba(24, 62, 94, 0.10);
}

body.theme-dark {
  --bg: #080f1a;
  --bg-2: #0d1626;
  --ink: #e8f7ff;
  --muted: #8fb6cf;
  --accent: #11e3a1;
  --accent-2: #2aa8ff;
  --card: rgba(11, 20, 36, 0.84);
  --stroke: rgba(87, 196, 255, 0.28);
  --stroke-strong: rgba(87, 196, 255, 0.48);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(17, 227, 161, 0.08) inset;
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.30);
}

body.theme-light,
body.theme-dark {
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, color-mix(in srgb, var(--accent-2) 24%, transparent), transparent 33%),
    radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg-2)) fixed;
}

body.theme-light .bg-grid,
body.theme-dark .bg-grid {
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent-2) 20%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent-2) 20%, transparent) 1px, transparent 1px);
}

body.theme-light .topbar,
body.theme-dark .topbar {
  background: color-mix(in srgb, var(--card) 86%, transparent);
  border-bottom: 1px solid var(--stroke);
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent-2) 20%, transparent);
  backdrop-filter: blur(8px);
}

body.theme-light .brand-title,
body.theme-dark .brand-title {
  color: var(--ink);
  text-shadow: 0 0 9px color-mix(in srgb, var(--accent-2) 38%, transparent), 0 0 14px color-mix(in srgb, var(--accent) 20%, transparent);
}

body.theme-light .brand-dot,
body.theme-dark .brand-dot {
  background: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 26%, transparent), 0 0 12px color-mix(in srgb, var(--accent) 34%, transparent);
}

body.theme-light .nav a,
body.theme-dark .nav a,
body.theme-light .brand-sub,
body.theme-dark .brand-sub,
body.theme-light .logout,
body.theme-dark .logout,
body.theme-light .user-chip,
body.theme-dark .user-chip,
body.theme-light .card-head span,
body.theme-dark .card-head span,
body.theme-light label,
body.theme-dark label {
  color: var(--muted) !important;
}

body.theme-light .nav a:hover,
body.theme-dark .nav a:hover {
  color: var(--ink) !important;
  border-color: color-mix(in srgb, var(--accent-2) 48%, transparent);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
}

body.theme-light .nav a.active,
body.theme-dark .nav a.active {
  color: var(--ink) !important;
  border-color: color-mix(in srgb, var(--accent) 58%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

body.theme-light .card,
body.theme-dark .card,
body.theme-light .table-wrap,
body.theme-dark .table-wrap,
body.theme-light .login-card,
body.theme-dark .login-card,
body.theme-light .modal-content,
body.theme-dark .modal-content,
body.theme-light .notice,
body.theme-dark .notice {
  background: var(--card) !important;
  border: 1px solid var(--stroke) !important;
  box-shadow: var(--shadow);
}

body.theme-light .table,
body.theme-dark .table {
  background: color-mix(in srgb, var(--card) 94%, transparent) !important;
}

body.theme-light .table th,
body.theme-dark .table th {
  background: color-mix(in srgb, var(--accent-2) 13%, var(--card)) !important;
  color: color-mix(in srgb, var(--ink) 86%, var(--accent-2)) !important;
}

body.theme-light .table td,
body.theme-dark .table td {
  color: var(--ink);
  border-bottom-color: color-mix(in srgb, var(--muted) 25%, transparent) !important;
}

body.theme-light input,
body.theme-dark input,
body.theme-light select,
body.theme-dark select,
body.theme-light textarea,
body.theme-dark textarea,
body.theme-light .input,
body.theme-dark .input,
body.theme-light .select,
body.theme-dark .select {
  background: color-mix(in srgb, var(--card) 96%, transparent) !important;
  color: var(--ink) !important;
  border: 1px solid color-mix(in srgb, var(--accent-2) 34%, transparent) !important;
}

body.theme-light input:focus,
body.theme-dark input:focus,
body.theme-light select:focus,
body.theme-dark select:focus,
body.theme-light textarea:focus,
body.theme-dark textarea:focus,
body.theme-light .input:focus,
body.theme-dark .input:focus,
body.theme-light .select:focus,
body.theme-dark .select:focus {
  border-color: var(--accent-2) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 18%, transparent), 0 0 10px color-mix(in srgb, var(--accent-2) 26%, transparent) !important;
}

body.theme-light .btn,
body.theme-dark .btn,
body.theme-light button.btn,
body.theme-dark button.btn,
body.theme-light button,
body.theme-dark button {
  border: 1px solid color-mix(in srgb, var(--accent) 62%, transparent) !important;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-2) 86%, white), color-mix(in srgb, var(--accent) 82%, white)) !important;
  color: #f7feff !important;
}

body.theme-light .btn.ghost,
body.theme-dark .btn.ghost,
body.theme-light button.ghost,
body.theme-dark button.ghost,
body.theme-light .sound-toggle,
body.theme-dark .sound-toggle,
body.theme-light .sound-test,
body.theme-dark .sound-test,
body.theme-light .theme-toggle,
body.theme-dark .theme-toggle {
  background: color-mix(in srgb, var(--card) 92%, transparent) !important;
  color: color-mix(in srgb, var(--ink) 80%, var(--accent-2)) !important;
  border: 1px solid color-mix(in srgb, var(--accent-2) 40%, transparent) !important;
  box-shadow: none !important;
}

/* === Auto-price state buttons: force distinct colors === */
.ads-actions .ads-btn-auto.ads-auto-on {
  background: linear-gradient(90deg, #1ea85f, #33d17a) !important;
  border-color: #25c26f !important;
  color: #f4fff9 !important;
  box-shadow: 0 0 12px rgba(38, 197, 111, 0.35) !important;
}

.ads-actions .ads-btn-auto.ads-auto-paused {
  background: linear-gradient(90deg, #d38b16, #f0b24a) !important;
  border-color: #e3a539 !important;
  color: #2a1b00 !important;
  box-shadow: 0 0 12px rgba(240, 178, 74, 0.35) !important;
}

.ads-actions .ads-btn-auto.ads-auto-off {
  background: linear-gradient(90deg, #b74242, #e96565) !important;
  border-color: #d65555 !important;
  color: #fff5f5 !important;
  box-shadow: 0 0 12px rgba(233, 101, 101, 0.30) !important;
}

/* If there is an active deal/appeal, keep state color but add stronger pulse cue. */
.ads-actions .ads-btn-auto.ads-auto-open-deal::after,
.ads-actions .ads-btn-auto.ads-auto-open-appeal::after {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.35));
}
