﻿/* =========================================================
   ARZMAX - style.css
   نسخه اصلاح‌شده و آماده برای جایگزینی
========================================================= */

/* =========================
   VARIABLES
========================= */
:root {
  --bg: #0b0e11;
  --bg-elev: #12161c;
  --bg-card: #1e2329;
  --bg-card-hover: #242a32;
  --border: #30363d;
  --border-soft: #262c33;

  --primary: #f3ba2f;
  --primary-dim: rgba(243, 186, 47, 0.14);
  --primary-dark: #c99a20;
  --primary-rgb: 243, 186, 47;

  --text: #eaecef;
  --text-muted: #848e9c;
  --text-faint: #6b7482;

  --success: #0ecb81;
  --success-dim: rgba(14, 203, 129, 0.14);
  --success-rgb: 14, 203, 129;

  --danger: #f6465d;
  --danger-dim: rgba(246, 70, 93, 0.14);
  --danger-rgb: 246, 70, 93;

  --radius: 14px;
  --mono: "JetBrains Mono", monospace;
  --sans: "Vazirmatn", sans-serif;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);

  --3d-gold: #f3ba2f;
  --3d-gold-soft: rgba(243, 186, 47, 0.22);
  --3d-shadow: rgba(0, 0, 0, 0.55);
}

html[data-theme="light"]
  --bg: #f4f5f8;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f3f7;
  --border: #e2e5eb;
  --border-soft: #eceef2;

  --primary: #b8860f;
  --primary-dim: rgba(184, 134, 15, 0.1);
  --primary-dark: #96700c;
  --primary-rgb: 184, 134, 15;

  --text: #161a20;
  --text-muted: #5b6472;
  --text-faint: #667085;

  --success: #0a9c63;
  --success-dim: rgba(10, 156, 99, 0.1);
  --success-rgb: 10, 156, 99;

  --danger: #c42a63;
  --danger-dim: rgba(196, 42, 99, 0.1);
  --danger-rgb: 196, 42, 99;

  --shadow: 0 10px 24px -14px rgba(30, 40, 80, 0.18);
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

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

::selection {
  background: var(--primary);
  color: #111;
}

/* =========================
   FOCUS / ACCESSIBILITY
========================= */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.search-box input:focus-visible,
.modal-box input:focus-visible,
.admin-table input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.btn:focus-visible,
.ref-btn:focus-visible,
.tool-item:focus-visible,
.news-item:focus-visible,
.blog-card:focus-visible,
.nav-btn:focus-visible,
.social-vertical a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* =========================
   SCROLLBAR
========================= */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* =========================
   APP
========================= */
.app {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 0 60px;
}

/* =========================
   HEADER / TOPBAR
========================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(18, 22, 28, 0.94);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 5px 20px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.025) inset;
}

.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 26px;
  flex-wrap: wrap;
}

/* =========================
   BRAND
========================= */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: 0.3s ease;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.1) inset,
    0 -3px 7px rgba(0, 0, 0, 0.35) inset,
    0 8px 20px rgba(0, 0, 0, 0.35),
    0 0 18px rgba(var(--primary-rgb), 0.1);
}

.brand-mark:hover {
  transform: rotate(8deg) scale(1.06);
  border-color: var(--primary);
}

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

.brand .logo {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
}

.brand .logo .arz {
  color: var(--primary);
}

.brand .logo .max {
  color: var(--text);
}

.brand p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--success-dim);
  color: var(--success);
  font-size: 11px;
  white-space: nowrap;
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

/* =========================
   NAV
========================= */
.nav-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.nav-group a {
  text-decoration: none;
}

.nav-dropdown {
  position: relative;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.caret {
  font-size: 9px;
  opacity: 0.7;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 235px;
  max-width: 300px;
  max-height: 60vh;
  overflow: auto;
  padding: 10px;
  display: none;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.07),
      rgba(0, 0, 0, 0.16)
    ),
    var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.05) inset,
    0 18px 35px rgba(0, 0, 0, 0.4),
    0 30px 60px rgba(0, 0, 0, 0.28);
  z-index: 50;
}

.nav-dropdown.open .dropdown-panel {
  display: block;
}

.ex-list-readonly {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ex-list-readonly li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
}

.ex-list-readonly li:hover {
  background: var(--bg-card-hover);
}

.ex-list-readonly .dotx {
  flex-shrink: 0;
}

.ex-list-readonly .ex-name {
  flex: 1;
}

.tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tool-item {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  transition: 0.15s ease;
}

.tool-item:hover {
  background: var(--bg-card-hover);
}

.tool-item.active {
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-dim);
}

/* =========================
   BUTTONS
========================= */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 15px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -2px 0 rgba(0, 0, 0, 0.22),
    0 4px 10px rgba(0, 0, 0, 0.18);
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.7s;
}

.btn:hover::after {
  left: 160%;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.22),
    0 8px 18px rgba(0, 0, 0, 0.28),
    0 0 16px rgba(var(--primary-rgb), 0.08);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

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

.btn.primary,
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #111;
}

.btn.primary:hover,
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn.danger,
.btn-danger {
  background: var(--danger-dim);
  border-color: var(--danger);
  color: var(--danger);
}

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

.btn.icon-only {
  width: 36px;
  height: 36px;
  padding: 8px;
}

.btn.small {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 11.5px;
}

/* =========================
   AUTH
========================= */
.auth-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.user-chip .avatar {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-dim);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

/* =========================
   SOCIAL
========================= */
.social-vertical {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 12px;
  margin-right: 2px;
  border-right: 1px solid var(--border-soft);
}

.social-vertical a {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: 0.15s ease;
}

.social-vertical a:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-dim);
}

/* =========================
   TICKER
========================= */
.ticker-strip {
  position: relative;
  height: 34px;
  overflow: hidden;
  white-space: nowrap;
  background: var(--bg);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  direction: ltr;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.ticker-strip::before,
.ticker-strip::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 65px;
  z-index: 2;
  pointer-events: none;
}

.ticker-strip::before {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}

.ticker-strip::after {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  height: 34px;
  animation: scrollTicker 40s linear infinite;
}

.ticker-strip:hover .ticker-track {
  animation-play-state: paused;
}

.tick-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  font-family: var(--mono);
  font-size: 11px;
  direction: ltr;
}

.tick-glyph {
  color: var(--primary);
  font-size: 9px;
  opacity: 0.8;
}

.tick-sym {
  color: var(--text-muted);
  font-family: var(--sans);
}

.tick-val.up {
  color: var(--success);
}

.tick-val.down {
  color: var(--danger);
}

@keyframes scrollTicker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* =========================
   PAGE / PANEL
========================= */
.page {
  padding: 22px 26px;
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.panel:hover {
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(var(--primary-rgb), 0.05);
}

/* =========================
   GLASS / GLOW
========================= */
.glass {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glow {
  position: relative;
}

.glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(var(--primary-rgb), 0.25),
    rgba(var(--primary-rgb), 0),
    rgba(var(--success-rgb), 0.18)
  );
  filter: blur(16px);
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  padding: 17px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--primary-rgb), 0.35);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.4),
    0 0 22px rgba(var(--primary-rgb), 0.12);
}

.stat-card.accented {
  border-color: rgba(var(--primary-rgb), 0.28);
}

.stat-card.accented::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.5);
}

.stat-card small {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 11.5px;
}

.stat-card > span {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--mono);
}

.stat-card .sub {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 10.5px;
}

#bestOpp {
  font-size: 18px !important;
  font-weight: 900;
  letter-spacing: 0.3px;
}

#bestOppSub {
  font-size: 10px !important;
  line-height: 1.7;
}

.best-opportunity-none {
  color: var(--text-muted) !important;
  font-size: 14px !important;
}

/* =========================
   TOOLBAR
========================= */
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 180px;
}

.search-box input {
  width: 100%;
  min-height: 40px;
  padding: 11px 14px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.045),
      rgba(0, 0, 0, 0.1)
    ),
    var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.12);
}

.search-box input::placeholder {
  color: var(--text-faint);
}

.search-box input:focus {
  transform: translateY(-1px);
  border-color: rgba(var(--primary-rgb), 0.55);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.2),
    0 0 0 3px rgba(var(--primary-rgb), 0.09),
    0 8px 20px rgba(0, 0, 0, 0.2);
}

select {
  padding: 9px 11px;
  min-height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

select:focus {
  border-color: var(--primary);
}

select option {
  background: var(--bg-elev);
  color: var(--text);
}

.toolbar-check {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.toolbar-check input {
  accent-color: var(--primary);
}

/* =========================
   TABLE BASE
========================= */
.table-wrap {
  position: relative;
  overflow: auto;
  border-radius: 18px;
  animation: tableAppear 0.45s ease;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 17px 16px;
  background: rgba(18, 24, 32, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #aeb8c5;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: right;
  white-space: nowrap;
}

thead th.num,
tbody td.num {
  text-align: left;
}

tbody td {
  padding: 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
  vertical-align: middle;
  line-height: 1.5;
}

tbody tr.main-row {
  position: relative;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

tbody tr.main-row:nth-child(4n + 1) {
  background: rgba(255, 255, 255, 0.012);
}

tbody tr.main-row:hover {
  background: rgba(var(--primary-rgb), 0.06);
}

tbody tr.main-row.row-profit {
  box-shadow: inset 3px 0 0 var(--success);
}

tbody tr.main-row.row-loss {
  box-shadow: inset 3px 0 0 var(--danger);
}

.table-wrap tbody tr.main-row:last-child td,
.table-wrap tbody tr.detail-row:last-child td {
  border-bottom: none;
}

/* =========================
   SYMBOL
========================= */
.sym-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.sym-badge {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-dim);
  border-radius: 9px;
  color: var(--primary);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 800;
  transition: 0.25s ease;
}

.sym-name {
  font-size: 15px;
  font-weight: 700;
}

.sym-pair {
  margin-top: 1px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

/* =========================
   PRICE
========================= */
td.num,
.mono {
  direction: ltr;
  text-align: left;
  font-family: var(--mono);
}

.price-value {
  display: block;
  color: #fff;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.ex-tag {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 9px;
  border-radius: 20px;
  direction: rtl;
  font-size: 10.5px;
  font-weight: 600;
}

.ex-tag.iran {
  background: rgba(124, 156, 255, 0.14);
  color: #7c9cff;
}

.ex-tag.foreign {
  background: var(--primary-dim);
  color: var(--primary);
}

/* =========================
   PERCENTAGES
========================= */
.pct {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 900;
}

.pct.pos {
  color: var(--success);
  text-shadow: 0 0 12px rgba(var(--success-rgb), 0.25);
}

.pct.neg {
  color: var(--danger);
  text-shadow: 0 0 12px rgba(var(--danger-rgb), 0.25);
}

/* =========================
   BADGES
========================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 3px 8px rgba(0, 0, 0, 0.15);
}

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

.badge.mixed {
  background: var(--primary-dim);
  color: var(--primary);
}

.badge.demo {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.dotx {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}

.dotx.pulse {
  animation: pulse 1.6s ease-in-out infinite;
}

.badge-profit {
  padding: 5px 10px;
  background: rgba(var(--success-rgb), 0.12);
  border-radius: 20px;
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
}

.badge-loss {
  padding: 5px 10px;
  background: rgba(var(--danger-rgb), 0.12);
  border-radius: 20px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

/* =========================
   EXPANDABLE TABLE
========================= */
.expand-arrow {
  display: inline-block;
  color: var(--text-muted);
  font-size: 13px;
  transition:
    transform 0.15s ease,
    color 0.15s ease;
}

tr.main-row.expanded .expand-arrow {
  transform: rotate(90deg);
  color: var(--primary);
}

tr.detail-row td {
  padding: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-soft);
}

.detail-inner {
  padding: 14px 22px 18px;
}

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

.detail-table th {
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  text-align: right;
}

.detail-table th.num,
.detail-table td.num {
  text-align: left;
}

.detail-table td {
  padding: 9px 10px;
  border-top: 1px solid var(--border-soft);
}

.detail-table tr.best-buy td:first-child {
  border-right: 3px solid var(--success);
}

.detail-table tr.best-sell td:first-child {
  border-right: 3px solid var(--danger);
}

/* =========================
   REFERRAL
========================= */
.action-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 118px;
}

.ref-btn {
  padding: 6px 9px;
  overflow: hidden;
  background: var(--primary-dim);
  border: 1px solid var(--primary);
  border-radius: 7px;
  color: var(--primary);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: 0.15s ease;
}

.ref-btn:hover {
  background: var(--primary);
  color: #151515;
}

.ref-btn:disabled {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-faint);
  cursor: not-allowed;
}

.ref-btn-sm {
  padding: 3px 8px;
  font-size: 10px;
}

/* =========================
   STATUS
========================= */
.status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--danger-dim);
  border: 1px solid var(--danger);
  border-radius: 10px;
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.8;
}

.status-banner b {
  color: var(--danger);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
}

.status-chip.live,
.status-chip.published {
  background: var(--success-dim);
  color: var(--success);
}

.status-chip.demo {
  background: var(--danger-dim);
  color: var(--danger);
}

.status-chip.draft {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-faint);
}

/* =========================
   SITE LAYOUT
========================= */
.site-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

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

.sidebar-widget {
  padding: 13px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: 0.25s ease;
  overflow: hidden;
}

.sidebar-widget:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--primary-rgb), 0.2);
}

.sidebar-widget h4 {
  position: relative;
  margin: 0 0 9px;
  padding-bottom: 9px;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0;
}

.sidebar-widget h4::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 45px;
  height: 2px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    var(--primary),
    transparent
  );
}

.ad-banner-slot a {
  display: block;
}

.ad-banner-slot img {
  width: 100%;
  border-radius: 10px;
}

.ad-banner-placeholder {
  padding: 20px 10px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  color: var(--text-faint);
  font-size: 10.5px;
  text-align: center;
}

.news-item {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  text-decoration: none;
}

.news-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.news-item:first-child {
  padding-top: 0;
}

.news-item .news-title {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0;
}

.news-item .news-date {
  margin-top: 4px;
  color: var(--text-faint);
  direction: ltr;
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

/* =========================
   FOOTER
========================= */
.footer-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.9;
}

.footer-note b {
  color: var(--text-muted);
}

footer {
  margin-top: 40px;
  padding: 25px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}

/* =========================
   HINT / DIVIDER
========================= */
.hint {
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.6;
}

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

/* =========================
   BLOG
========================= */
.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.blog-card {
  display: block;
  padding: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: 0.15s ease;
}

.blog-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.blog-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: 0;
}

.blog-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.blog-card .meta {
  margin-top: 12px;
  color: var(--text-faint);
  direction: ltr;
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: right;
}

.blog-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 30px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.blog-article h1 {
  margin: 0 0 10px;
  font-size: 24px;
  letter-spacing: 0;
}

.blog-article .meta {
  margin-bottom: 22px;
  color: var(--text-faint);
  direction: ltr;
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}

.blog-article .content {
  color: var(--text);
  font-size: 15px;
  line-height: 2;
}

.blog-article .content p {
  margin: 0 0 16px;
}

.blog-article .content h2 {
  margin: 26px 0 12px;
  font-size: 19px;
  letter-spacing: 0;
}

.blog-article .content img {
  max-width: 100%;
  border-radius: 10px;
}

/* =========================
   FORMS
========================= */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  margin-bottom: 14px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
}

.field textarea {
  resize: vertical;
}

/* =========================
   LOGIN
========================= */
.login-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 360px;
  max-width: 100%;
  padding: 30px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0 0 4px;
  font-size: 19px;
}

.login-card p {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.error-box {
  display: none;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--danger-dim);
  border-radius: 8px;
  color: var(--danger);
  font-size: 12.5px;
}

.error-box.show {
  display: block;
}

/* =========================
   ADMIN
========================= */
.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.admin-tab {
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.admin-tab.active {
  border-color: var(--primary);
  color: var(--primary);
}

.admin-panel-section {
  display: none;
}

.admin-panel-section.active {
  display: block;
}

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

.admin-table th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 11px;
  text-align: right;
}

.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

.admin-table input[type="number"],
.admin-table input[type="text"] {
  width: 100%;
  min-width: 70px;
  padding: 5px 7px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}

/* =========================
   MODAL
========================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 20, 0.65);
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  position: relative;
  width: 360px;
  max-width: 100%;
  padding: 26px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-box .modal-x {
  position: absolute;
  top: 14px;
  left: 14px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 18px;
  cursor: pointer;
}

.modal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.modal-tab {
  flex: 1;
  padding: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  text-align: center;
}

.modal-tab.active {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
}

.modal-box input {
  width: 100%;
  margin-bottom: 11px;
  padding: 10px 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  outline: none;
}

.modal-error {
  display: none;
  margin-bottom: 10px;
  color: var(--danger);
  font-size: 12px;
}

.modal-error.show {
  display: block;
}

/* =========================
   TOAST
========================= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 200;
  max-width: 90vw;
  padding: 10px 18px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  text-align: center;
  transition: opacity 0.25s ease;
}

.toast.show {
  opacity: 1;
}

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

/* =========================
   ANIMATIONS
========================= */
.fade-up {
  animation: fadeUp 0.45s ease;
}

.fade-in {
  animation: fadeIn 0.45s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes tableAppear {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* =========================
   SKELETON
========================= */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.18),
    transparent
  );
  animation: skeleton 1.3s infinite;
}

@keyframes skeleton {
  100% {
    left: 170%;
  }
}

/* =========================
   PRICE ANIMATION
========================= */
.price-up {
  animation: priceUp 0.6s;
  color: var(--success);
}

.price-down {
  animation: priceDown 0.6s;
  color: var(--danger);
}

@keyframes priceUp {
  0% {
    background: rgba(var(--success-rgb), 0.28);
  }
  100% {
    background: transparent;
  }
}

@keyframes priceDown {
  0% {
    background: rgba(var(--danger-rgb), 0.25);
  }
  100% {
    background: transparent;
  }
}

/* =========================
   UTILITY
========================= */
.card-hover {
  transition: 0.25s;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

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

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

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

/* =========================================================
   PREMIUM 3D CARDS
========================================================= */
.panel,
.stat-card,
.table-wrap,
.sidebar-widget,
.blog-card,
.blog-article,
.login-card,
.modal-box {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.075) 0%,
      rgba(255, 255, 255, 0.025) 35%,
      rgba(0, 0, 0, 0.12) 100%
    ),
    var(--bg-elev);
  border: 1px solid rgba(255, 255, 255, 0.085);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.035) inset,
    0 -1px 0 rgba(0, 0, 0, 0.35) inset,
    0 10px 20px rgba(0, 0, 0, 0.22),
    0 22px 45px rgba(0, 0, 0, 0.3);
  transform: translateZ(0);
  transition:
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

.panel::before,
.stat-card::before,
.table-wrap::before,
.sidebar-widget::before,
.blog-card::before,
.blog-article::before,
.login-card::before,
.modal-box::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.11),
      transparent 25%,
      transparent 70%,
      rgba(var(--primary-rgb), 0.035)
    );
  opacity: 0.7;
}

.panel::after,
.stat-card::after,
.sidebar-widget::after,
.blog-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--primary-rgb), 0.45),
    transparent
  );
  opacity: 0.55;
  pointer-events: none;
}

.panel:hover,
.stat-card:hover,
.sidebar-widget:hover,
.blog-card:hover {
  transform:
    translateY(-6px)
    perspective(900px)
    rotateX(1deg);
  border-color: rgba(var(--primary-rgb), 0.25);
  box-shadow:
    0 3px 0 rgba(255, 255, 255, 0.04) inset,
    0 -2px 0 rgba(0, 0, 0, 0.35) inset,
    0 16px 28px rgba(0, 0, 0, 0.32),
    0 30px 60px rgba(0, 0, 0, 0.36),
    0 0 30px rgba(var(--primary-rgb), 0.07);
}

.stat-card {
  min-height: 125px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.08),
      rgba(255, 255, 255, 0.025) 45%,
      rgba(0, 0, 0, 0.16)
    ),
    var(--bg-elev);
}

.stat-card.accented {
  border-color: rgba(var(--primary-rgb), 0.25);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.04) inset,
    0 15px 30px rgba(0, 0, 0, 0.3),
    0 0 35px rgba(var(--primary-rgb), 0.08);
}

.stat-card.accented:hover {
  border-color: rgba(var(--primary-rgb), 0.48);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.05) inset,
    0 22px 45px rgba(0, 0, 0, 0.38),
    0 0 40px rgba(var(--primary-rgb), 0.14);
}

/* =========================================================
   PREMIUM TABLE
========================================================= */
.table-wrap {
  border-radius: 18px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.055),
      rgba(255, 255, 255, 0.015) 45%,
      rgba(0, 0, 0, 0.16)
    ),
    var(--bg-elev);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25),
    0 14px 35px rgba(0, 0, 0, 0.28),
    0 28px 60px rgba(0, 0, 0, 0.18);
}

.table-wrap table {
  border-collapse: separate;
  border-spacing: 0 7px;
  padding: 0 8px 8px;
  font-size: 12px;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.075),
      rgba(0, 0, 0, 0.16)
    ),
    var(--bg-card);
  color: var(--text-muted);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.18);
  padding: 13px 12px;
  height: 44px;
  font-size: 10.5px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 5px 12px rgba(0, 0, 0, 0.15);
}

.table-wrap thead th:first-child {
  border-radius: 0 12px 12px 0;
}

.table-wrap thead th:last-child {
  border-radius: 12px 0 0 12px;
}

.table-wrap tbody tr.main-row {
  position: relative;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.045),
      rgba(255, 255, 255, 0.012) 55%,
      rgba(0, 0, 0, 0.12)
    ) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 5px 13px rgba(0, 0, 0, 0.16);
}

.table-wrap tbody tr.main-row td {
  border-top: 1px solid rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  padding: 11px 12px;
  font-size: 11.5px;
}

.table-wrap tbody tr.main-row td:first-child {
  position: relative;
  border-radius: 0 14px 14px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.035);
}

.table-wrap tbody tr.main-row td:last-child {
  border-radius: 14px 0 0 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.035);
}

.table-wrap tbody tr.main-row:hover {
  transform: translateY(-2px);
  background:
    linear-gradient(
      100deg,
      rgba(var(--primary-rgb), 0.075),
      rgba(255, 255, 255, 0.025),
      rgba(var(--success-rgb), 0.025)
    ) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 10px 24px rgba(0, 0, 0, 0.24),
    0 0 22px rgba(var(--primary-rgb), 0.045);
}

.table-wrap .sym-cell {
  min-width: 180px;
}

.table-wrap .sym-badge {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 12px;
  background:
    linear-gradient(
      145deg,
      rgba(var(--primary-rgb), 0.24),
      rgba(var(--primary-rgb), 0.055)
    );
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -3px 5px rgba(0, 0, 0, 0.25),
    0 6px 14px rgba(0, 0, 0, 0.22);
}

.table-wrap tbody tr.main-row:hover .sym-badge {
  transform:
    translateY(-2px)
    scale(1.05);
  border-color: rgba(var(--primary-rgb), 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 8px 18px rgba(0, 0, 0, 0.3),
    0 0 18px rgba(var(--primary-rgb), 0.12);
}

.table-wrap .sym-name {
  font-size: 12.5px;
  font-weight: 800;
}

.table-wrap .sym-pair {
  font-size: 10px;
  opacity: 0.7;
}

.table-wrap td:nth-child(3),
.table-wrap td:nth-child(4) {
  min-width: 145px;
}

.table-wrap .price-value {
  font-size: 12.5px;
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.04);
}

.table-wrap .ex-tag {
  font-size: 10px;
  padding: 2px 7px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 3px 7px rgba(0, 0, 0, 0.12);
}

.table-wrap td:nth-child(5) {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.025),
    transparent
  );
}

.table-wrap td:nth-child(5) .pct {
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(var(--primary-rgb), 0.055);
  display: inline-block;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.table-wrap td:nth-child(6) .pct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  padding: 7px 12px;
  border-radius: 10px;
  background:
    linear-gradient(
      145deg,
      rgba(var(--success-rgb), 0.13),
      rgba(var(--success-rgb), 0.035)
    );
  border: 1px solid rgba(var(--success-rgb), 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 5px 12px rgba(0, 0, 0, 0.14);
}

.table-wrap td:nth-child(6) .pct.neg {
  background:
    linear-gradient(
      145deg,
      rgba(var(--danger-rgb), 0.13),
      rgba(var(--danger-rgb), 0.035)
    );
  border-color: rgba(var(--danger-rgb), 0.15);
}

.table-wrap td:nth-child(7) .badge {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 4px 10px rgba(0, 0, 0, 0.15);
}

.table-wrap .badge {
  font-size: 10px;
  padding: 4px 9px;
}

.table-wrap .ref-btn {
  min-width: 90px;
  font-size: 10px;
  padding: 5px 7px;
  background:
    linear-gradient(
      145deg,
      rgba(var(--primary-rgb), 0.16),
      rgba(var(--primary-rgb), 0.035)
    );
  border: 1px solid rgba(var(--primary-rgb), 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 4px 10px rgba(0, 0, 0, 0.15);
}

.table-wrap .ref-btn:hover {
  transform: translateY(-2px);
  background:
    linear-gradient(
      145deg,
      var(--primary),
      #d99d16
    );
  color: #111;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.25),
    0 0 18px rgba(var(--primary-rgb), 0.12);
}

.table-wrap tbody tr.row-profit {
  box-shadow:
    inset 3px 0 0 var(--success),
    0 5px 15px rgba(0, 0, 0, 0.16);
}

.table-wrap tbody tr.row-loss {
  box-shadow:
    inset 3px 0 0 var(--danger),
    0 5px 15px rgba(0, 0, 0, 0.16);
}

.table-wrap tbody tr.detail-row td {
  padding: 0;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.025),
      rgba(0, 0, 0, 0.12)
    );
  border-top: 0;
}

.table-wrap .detail-inner {
  margin: 0 8px 5px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 14px;
  background:
    linear-gradient(
      145deg,
      rgba(0, 0, 0, 0.14),
      rgba(255, 255, 255, 0.018)
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 7px 18px rgba(0, 0, 0, 0.18);
}

.table-wrap .detail-table {
  border-spacing: 0;
}

.table-wrap .detail-table th {
  background: transparent;
  box-shadow: none;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.table-wrap .detail-table td {
  background: transparent;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.035);
}

.table-wrap .detail-table tr.best-buy {
  background: rgba(var(--success-rgb), 0.045);
}

.table-wrap .detail-table tr.best-sell {
  background: rgba(var(--danger-rgb), 0.045);
}

.table-wrap .expand-arrow {
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.055);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 3px 8px rgba(0, 0, 0, 0.15);
  transition: 0.25s ease;
}

.table-wrap tr.main-row.expanded .expand-arrow {
  background: var(--primary-dim);
  border-color: rgba(var(--primary-rgb), 0.25);
  color: var(--primary);
  transform: rotate(90deg);
}

.table-wrap tbody tr.main-row td:first-child::before {
  content: "";
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  border-radius: 10px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(var(--primary-rgb), 0.35),
    transparent
  );
  opacity: 0;
  transition: 0.25s;
}

.table-wrap tbody tr.main-row:hover td:first-child::before {
  opacity: 1;
}

/* =========================
   TOP MARKET PANEL
========================= */
.page > .panel:first-of-type {
  min-height: 150px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 18px;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(var(--primary-rgb), 0.055),
      transparent 55%
    ),
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.035),
      rgba(255, 255, 255, 0.012)
    );
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px) {
  .topbar-main {
    gap: 12px;
  }

  .brand {
    min-width: 250px;
  }

  .site-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
}

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

  .sidebar {
    order: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

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

  .social-vertical {
    flex-direction: row;
    width: 100%;
    justify-content: center;
    padding-top: 8px;
    padding-right: 0;
    margin-top: 8px;
    border-top: 1px solid var(--border-soft);
    border-right: none;
  }
}

@media (max-width: 900px) {
  .topbar-main {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .nav-group {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .controls {
    width: 100%;
    justify-content: space-between;
  }

  .table-wrap table {
    min-width: 980px;
  }
}

@media (max-width: 768px) {
  .app {
    padding-bottom: 30px;
  }

  .page {
    padding: 15px;
  }

  .topbar-main {
    padding: 13px 15px;
  }

  .brand p {
    display: none;
  }

  .brand .logo {
    font-size: 19px;
  }

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

  .status-pill {
    display: none;
  }

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

  .toolbar > * {
    width: 100%;
  }

  .toolbar-check {
    justify-content: center;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 15px;
  }

  .table-wrap table {
    min-width: 100%;
    border-spacing: 0 6px;
  }

  .table-wrap thead th {
    padding: 13px 11px;
  }

  .table-wrap tbody tr.main-row td {
    padding: 13px 11px;
  }

  .table-wrap .sym-cell {
    min-width: 155px;
  }

  .table-wrap .sym-badge {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .table-wrap .detail-inner {
    margin: 0 5px 4px;
    padding: 12px;
  }

  .thead th {
    font-size: 10px;
  }

  .price-value,
  .pct {
    font-size: 12px;
  }

  .sidebar {
    margin-top: 20px;
  }

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

  .blog-article {
    padding: 20px;
  }

  .panel,
  .stat-card,
  .sidebar-widget,
  .blog-card {
    transform: none !important;
  }

  .panel:hover,
  .stat-card:hover,
  .sidebar-widget:hover,
  .blog-card:hover {
    transform: translateY(-2px) !important;
  }
}

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

  .page > .panel:first-of-type {
    padding: 14px;
  }

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

  .stat-card {
    min-height: 100px;
    padding: 13px;
  }
}

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

  .toolbar {
    align-items: stretch;
  }

  .toolbar > * {
    width: 100%;
  }
}

/* =========================================================
   LIGHT MODE FINAL OVERRIDES
========================================================= */
html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: var(--border-soft);
  box-shadow:
    0 5px 20px rgba(30, 40, 80, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

html[data-theme="light"] .panel,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .sidebar-widget,
html[data-theme="light"] .blog-card,
html[data-theme="light"] .blog-article,
html[data-theme="light"] .login-card,
html[data-theme="light"] .modal-box,
html[data-theme="light"] .dropdown-panel {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.82),
      rgba(246, 247, 250, 0.94)
    ),
    var(--bg-card);
  border-color: var(--border);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(0, 0, 0, 0.04) inset,
    0 10px 25px rgba(30, 40, 80, 0.1),
    0 20px 45px rgba(30, 40, 80, 0.08);
}

html[data-theme="light"] .panel:hover,
html[data-theme="light"] .stat-card:hover,
html[data-theme="light"] .sidebar-widget:hover,
html[data-theme="light"] .blog-card:hover {
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95) inset,
    0 15px 30px rgba(30, 40, 80, 0.13),
    0 25px 55px rgba(30, 40, 80, 0.1);
}

html[data-theme="light"] .panel::before,
html[data-theme="light"] .stat-card::before,
html[data-theme="light"] .table-wrap::before,
html[data-theme="light"] .sidebar-widget::before,
html[data-theme="light"] .blog-card::before,
html[data-theme="light"] .blog-article::before,
html[data-theme="light"] .login-card::before,
html[data-theme="light"] .modal-box::before {
  opacity: 0.18;
}

html[data-theme="light"] .panel::after,
html[data-theme="light"] .stat-card::after,
html[data-theme="light"] .sidebar-widget::after,
html[data-theme="light"] .blog-card::after {
  opacity: 0.25;
}

html[data-theme="light"] .glass {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .btn {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08),
    0 4px 10px rgba(30, 40, 80, 0.1);
}

html[data-theme="light"] .search-box input {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.9),
      rgba(0, 0, 0, 0.02)
    ),
    var(--bg-elev);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 4px 12px rgba(30, 40, 80, 0.08);
}

html[data-theme="light"] thead th,
html[data-theme="light"] .table-wrap thead th {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(241, 243, 247, 0.98)
    ),
    var(--bg-card);
  color: var(--text-muted);
  border-bottom-color: var(--border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 5px 12px rgba(30, 40, 80, 0.06);
}

html[data-theme="light"] .price-value {
  color: var(--text);
}

html[data-theme="light"] .table-wrap {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.94),
      rgba(246, 247, 250, 0.98)
    ),
    var(--bg-card);
  border-color: var(--border);
}

html[data-theme="light"] .table-wrap tbody tr.main-row {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.98),
      rgba(246, 247, 250, 0.98)
    ) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 5px 15px rgba(30, 40, 80, 0.07);
}

html[data-theme="light"] .table-wrap tbody tr.main-row:hover {
  background:
    linear-gradient(
      100deg,
      rgba(var(--primary-rgb), 0.07),
      rgba(255, 255, 255, 1)
    ) !important;
  box-shadow: 0 10px 25px rgba(30, 40, 80, 0.1);
}

html[data-theme="light"] .table-wrap tbody tr.main-row td {
  border-top-color: rgba(0, 0, 0, 0.03);
  border-bottom-color: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .table-wrap tbody tr.main-row td:first-child {
  border-right-color: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .table-wrap tbody tr.main-row td:last-child {
  border-left-color: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .table-wrap .detail-inner {
  background:
    linear-gradient(
      145deg,
      rgba(0, 0, 0, 0.02),
      rgba(255, 255, 255, 0.8)
    );
  border-color: rgba(0, 0, 0, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 7px 18px rgba(30, 40, 80, 0.07);
}

html[data-theme="light"] .table-wrap .detail-table th {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .table-wrap .detail-table td {
  border-top-color: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .table-wrap .expand-arrow {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .skeleton {
  background: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.7),
    transparent
  );
}

/* =========================================================
   REDUCED MOTION
========================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ticker-track,
  .dotx.pulse,
  .status-pill .dot,
  .skeleton::after {
    animation: none !important;
  }

  .panel:hover,
  .stat-card:hover,
  .sidebar-widget:hover,
  .blog-card:hover,
  .table-wrap tbody tr.main-row:hover,
  .table-wrap tbody tr.main-row:hover .sym-badge,
  .table-wrap .ref-btn:hover {
    transform: none !important;
  }
}/* =========================================================
/* =========================================================
   QUICK FIX PATCH
========================================================= */

:root {
  --primary-rgb: 243, 186, 47;
  --success-rgb: 14, 203, 129;
  --danger-rgb: 246, 70, 93;
}

html[data-theme="light"] {
  --primary-rgb: 184, 134, 15;
  --success-rgb: 10, 156, 99;
  --danger-rgb: 196, 42, 99;
}

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

html {
  scroll-behavior: smooth;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.search-box input:focus-visible,
.modal-box input:focus-visible,
.admin-table input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

/* Light mode main boxes */
html[data-theme="light"] .panel,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .sidebar-widget,
html[data-theme="light"] .blog-card,
html[data-theme="light"] .blog-article,
html[data-theme="light"] .login-card,
html[data-theme="light"] .modal-box,
html[data-theme="light"] .dropdown-panel {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: 0 10px 25px rgba(30, 40, 80, 0.10);
}

html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: var(--border-soft);
}

html[data-theme="light"] thead th,
html[data-theme="light"] .table-wrap thead th {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-muted);
  border-bottom-color: var(--border);
}

html[data-theme="light"] .price-value {
  color: var(--text);
}

html[data-theme="light"] .table-wrap tbody tr.main-row {
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 5px 15px rgba(30, 40, 80, 0.07);
}

html[data-theme="light"] .table-wrap tbody tr.main-row:hover {
  background: rgba(184, 134, 15, 0.07) !important;
  box-shadow: 0 10px 25px rgba(30, 40, 80, 0.10);
}

/* Table fixes */
.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap tbody tr.main-row td:first-child {
  position: relative;
}

.table-wrap tbody tr.main-row:last-child td,
.table-wrap tbody tr.detail-row:last-child td {
  border-bottom: none;
}

@media (max-width: 900px) {
  .table-wrap table {
    min-width: 980px;
  }
}

@media (max-width: 768px) {
  .table-wrap table {
    min-width: 100%;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ticker-track,
  .dotx.pulse,
  .status-pill .dot,
  .skeleton::after {
    animation: none !important;
  }
}
/* =========================================================
   FINAL QA PATCH — انتهای style.css
========================================================= */

/* Reset درست */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* فوکوس کیبورد */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* تایپوگرافی فارسی */
.sidebar-widget h4 {
  letter-spacing: 0;
  text-transform: none;
}

thead th {
  letter-spacing: 0;
}

#bestOpp {
  letter-spacing: 0;
}

/* خوانایی بهتر */
.table-wrap .ex-tag,
.table-wrap .badge,
.table-wrap .ref-btn {
  font-size: 10px;
}

.news-item .news-date {
  font-size: 10px;
}

/* محدود کردن min-width جدول به جدول اصلی */
@media (max-width: 900px) {
  table {
    min-width: 0;
  }

  .table-wrap table {
    min-width: 980px;
  }
}

/* لنگر خط طلایی جدول */
.table-wrap tbody tr.main-row td:first-child {
  position: relative;
}

/* حذف border ردیف آخر */
.table-wrap tbody tr:last-child td {
  border-bottom: none;
}

/* اصلاح سایه‌های حالت روشن */
html[data-theme="light"] .panel,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .sidebar-widget,
html[data-theme="light"] .blog-card,
html[data-theme="light"] .blog-article,
html[data-theme="light"] .login-card,
html[data-theme="light"] .modal-box {
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(0, 0, 0, 0.04) inset,
    0 10px 25px rgba(30, 40, 80, 0.1),
    0 20px 45px rgba(30, 40, 80, 0.08);
}

html[data-theme="light"] .panel:hover,
html[data-theme="light"] .stat-card:hover,
html[data-theme="light"] .sidebar-widget:hover,
html[data-theme="light"] .blog-card:hover {
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95) inset,
    0 15px 30px rgba(30, 40, 80, 0.13),
    0 25px 55px rgba(30, 40, 80, 0.1);
}

/* کاهش حرکت کامل */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ticker-track,
  .dotx.pulse,
  .status-pill .dot,
  .skeleton::after {
    animation: none !important;
  }
}
.coin-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  direction: rtl;
}

.coin-logo-wrap {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111820;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 3px 10px rgba(0,0,0,.35);
}

.coin-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.coin-logo-fallback {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
}

.coin-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.coin-name {
  font-size: 14px;
  font-weight: 700;
  color: #f1f4f8;
}

.coin-symbol {
  direction: ltr;
  font-size: 11px;
  color: #778292;
}

.toman-price {
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #f3f6fa;
}

.toman-unit {
  margin-left: 5px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
  color: #aab3c0;
}

  font-family: Arial, Tahoma, sans-serif !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;

  color: #f1f4f8 !important;
  white-space: nowrap !important;
  letter-spacing: .3px !important;
}


  margin-left: 5px !important;
  margin-right: 0 !important;

  direction: rtl !important;
  unicode-bidi: isolate !important;

  font-family: Tahoma, Arial, sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;

  color: #aeb7c4 !important;
  white-space: nowrap !important;
}
/* قیمت تومان - نسخه سبک */
.price-value{
  display:block;
  font-family:var(--mono);
  font-size:14px;
  font-weight:800;
  direction:ltr;
  unicode-bidi:isolate;
  white-space:nowrap;
}

.price-value .toman-unit{
  margin-left:4px;
  font-family:Tahoma,Arial,sans-serif;
  font-size:11px;
  font-weight:600;
  color:var(--text3);
}
'<span class="price-value mono" dir="ltr">' +
ARZ.fmtToman(
  safeNumber(sell.price)
) +
'<span class="toman-unit"> ت</span>' +
'</span>' +
/* ===== بهبود ظاهری جدول ARZMAX ===== */

.price-value {
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 14px;
  line-height: 1.4;
}

.coin-column {
  min-width: 150px;
}

.coin-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.coin-logo-wrap {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}

.coin-info {
  min-width: 0;
}

.coin-name {
  line-height: 1.5;
}

.coin-symbol {
  line-height: 1.3;
}

.ex-tag {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.action-cell {
  white-space: nowrap;
}

/* جلوگیری از فشرده شدن جدول */
.data-table td {
  vertical-align: middle;
}

/* موبایل */
@media (max-width: 700px) {

  .coin-column {
    min-width: 125px;
  }

  .coin-logo-wrap {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .coin-cell {
    gap: 7px;
  }

  .coin-name {
    font-size: 12px;
  }

  .coin-symbol {
    font-size: 10px;
  }

  .price-value {
    font-size: 13px;
  }

  .ex-tag {
    font-size: 9px;
  }
}
.ex-tag {
  display: block;
  margin-top: 3px;
  font-size: 9px !important;
  line-height: 1.2;
  font-weight: 500;
  white-space: nowrap;
  opacity: .75;
}
.ex-tag {
  display: inline-block !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: fit-content !important;

  padding: 2px 6px !important;
  margin-top: 3px !important;

/* =========================================================
   ARZMAX - PROFESSIONAL MOBILE LAYOUT
   Mobile only - desktop layout remains unchanged
   ========================================================= */

@media (max-width: 700px) {

  /* ---------------------------------------------------------
     1. Fear & Greed / Market Gauges
     جلوگیری از عمودی شدن پنل
     --------------------------------------------------------- */

  .panel:has(#gaugeFearGreed) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 10px 6px !important;
    margin-bottom: 12px !important;
  }

  .panel:has(#gaugeFearGreed) > div {
    min-width: 0 !important;
    width: 100% !important;
    text-align: center !important;
  }

  .panel:has(#gaugeFearGreed) h3 {
    font-size: 9px !important;
    line-height: 1.5 !important;
    margin-bottom: 2px !important;
    white-space: normal !important;
  }

  .panel:has(#gaugeFearGreed) small {
    font-size: 9px !important;
  }

  .panel:has(#gaugeFearGreed) #lastUpdate {
    font-size: 12px !important;
  }

  .panel:has(#gaugeFearGreed) .hint {
    font-size: 8px !important;
    line-height: 1.4 !important;
  }

  .panel:has(#gaugeFearGreed) .btn {
    font-size: 8px !important;
    padding: 5px 7px !important;
    white-space: nowrap !important;
  }

  .panel:has(#gaugeFearGreed) .gauge-wrap {
    width: 100% !important;
  }

  .panel:has(#gaugeFearGreed) .gauge-wrap svg {
    width: 100% !important;
    max-width: 125px !important;
    margin: 0 auto !important;
  }

  .panel:has(#gaugeFearGreed) .gauge-wrap > div {
    min-height: 35px !important;
    margin-top: -5px !important;
  }

  .panel:has(#gaugeFearGreed) .gauge-wrap > div > div:first-child {
    font-size: 15px !important;
  }

  .panel:has(#gaugeFearGreed) .gauge-wrap > div > div:last-child {
    font-size: 8px !important;
    white-space: nowrap !important;
  }


  /* ---------------------------------------------------------
     2. جدول آربیتراژ
     تبدیل جدول به کارت موبایل
     --------------------------------------------------------- */

  .table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    border-radius: 15px !important;
  }

  .table-wrap table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-spacing: 0 7px !important;
    padding: 0 5px 5px !important;
  }

  /* مخفی کردن عنوان‌های بزرگ جدول */
  .table-wrap thead {
    display: none !important;
  }

  .table-wrap tbody {
    display: block !important;
    width: 100% !important;
  }

  .table-wrap tbody tr.main-row {
    display: grid !important;

    /*
      ستون‌ها:
      فلش | ارز | خرید | فروش | اختلاف | سود | وضعیت | عملیات
    */
    grid-template-columns:
      24px
      minmax(85px, 1.35fr)
      minmax(72px, 1fr)
      minmax(72px, 1fr)
      55px
      55px
      48px
      70px !important;

    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    align-items: center !important;

    border-radius: 13px !important;

    overflow: hidden !important;
  }

  .table-wrap tbody tr.main-row td {
    min-width: 0 !important;
    width: auto !important;
    max-width: 100% !important;

    padding: 9px 4px !important;

    font-size: 9px !important;

    overflow: hidden !important;
  }

  /* فلش */
  .table-wrap tbody tr.main-row td:first-child {
    border-radius: 0 12px 12px 0 !important;
    padding: 5px 2px !important;
    text-align: center !important;
  }

  .table-wrap .expand-arrow {
    width: 21px !important;
    height: 21px !important;
    font-size: 10px !important;
  }

  /* ستون ارز */
  .table-wrap tbody tr.main-row .coin-column {
    min-width: 0 !important;
    width: auto !important;
    padding-right: 4px !important;
  }

  .table-wrap .coin-cell {
    min-width: 0 !important;
    width: 100% !important;
    gap: 5px !important;
    white-space: normal !important;
    overflow: hidden !important;
  }

  .table-wrap .coin-logo-wrap {
    flex: 0 0 27px !important;
    width: 27px !important;
    height: 27px !important;
  }

  .table-wrap .coin-name {
    font-size: 10px !important;
    line-height: 1.3 !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .table-wrap .coin-symbol {
    font-size: 8px !important;
    line-height: 1.2 !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* قیمت خرید / فروش */
  .table-wrap td:nth-child(3),
  .table-wrap td:nth-child(4) {
    min-width: 0 !important;
    width: auto !important;
    text-align: center !important;
  }

  .table-wrap .price-value {
    display: block !important;

    min-width: 0 !important;
    max-width: 100% !important;

    font-size: 9px !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .table-wrap .ex-tag {
    display: block !important;

    max-width: 100% !important;

    margin-top: 2px !important;

    font-size: 7px !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* اختلاف */
  .table-wrap tbody tr.main-row td:nth-child(5),
  .table-wrap tbody tr.main-row td:nth-child(6) {
    text-align: center !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
  }

  .table-wrap td:nth-child(5) .pct,
  .table-wrap td:nth-child(6) .pct {
    min-width: 0 !important;
    width: 100% !important;

    display: inline-flex !important;

    justify-content: center !important;

    padding: 4px 2px !important;

    font-size: 8px !important;
  }

  /* وضعیت */
  .table-wrap tbody tr.main-row td:nth-child(7) {
    text-align: center !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
  }

  .table-wrap .badge {
    max-width: 100% !important;

    padding: 3px 4px !important;

    font-size: 7px !important;

    white-space: nowrap !important;
  }

  .table-wrap .dotx {
    width: 5px !important;
    height: 5px !important;
    margin-left: 2px !important;
  }

  /* دکمه‌های خرید و فروش */
  .table-wrap tbody tr.main-row td.action-cell {
    min-width: 0 !important;
    width: auto !important;

    padding: 4px 2px !important;

    white-space: normal !important;

    text-align: center !important;
  }

  .table-wrap .ref-btn {
    display: block !important;

    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    margin: 2px 0 !important;

    padding: 4px 2px !important;

    font-size: 7px !important;

    line-height: 1.2 !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }


  /* ---------------------------------------------------------
     3. جزئیات بازشونده هر ارز
     --------------------------------------------------------- */

  .table-wrap tbody tr.detail-row {
    display: block !important;
    width: 100% !important;
  }

  .table-wrap tbody tr.detail-row > td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
  }

  .table-wrap .detail-inner {
    margin: 0 3px 5px !important;
    padding: 10px !important;

    width: auto !important;
    max-width: 100% !important;

    overflow: hidden !important;
  }

  .table-wrap .detail-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
  }

  .table-wrap .detail-table th,
  .table-wrap .detail-table td {
    min-width: 0 !important;
    padding: 6px 4px !important;
    font-size: 8px !important;
  }


  /* ---------------------------------------------------------
     4. حذف کامل عوامل ایجاد عرض اضافی
     --------------------------------------------------------- */

  .table-wrap .sym-cell,
  .table-wrap td:nth-child(3),
  .table-wrap td:nth-child(4),
  .table-wrap .coin-column,
  .table-wrap .action-cell {
    min-width: 0 !important;
  }

  .table-wrap .action-cell,
  .table-wrap .coin-cell,
  .table-wrap .ex-tag {
    white-space: normal !important;
  }

  .table-wrap img {
    max-width: 100% !important;
  }
}


/* ---------------------------------------------------------
   موبایل خیلی کوچک
   --------------------------------------------------------- */

@media (max-width: 430px) {

  .panel:has(#gaugeFearGreed) {
    gap: 2px !important;
    padding-left: 3px !important;
    padding-right: 3px !important;
  }

  .panel:has(#gaugeFearGreed) .gauge-wrap svg {
    max-width: 108px !important;
  }

  .panel:has(#gaugeFearGreed) h3 {
    font-size: 8px !important;
  }

  .panel:has(#gaugeFearGreed) .gauge-wrap > div > div:first-child {
    font-size: 13px !important;
  }

  .table-wrap tbody tr.main-row {
    grid-template-columns:
      20px
      minmax(72px, 1.25fr)
      minmax(60px, 1fr)
      minmax(60px, 1fr)
      45px
      45px
      42px
      62px !important;
  }

  .table-wrap tbody tr.main-row td {
    padding-left: 2px !important;
    padding-right: 2px !important;
  }

  .table-wrap .coin-logo-wrap {
    flex-basis: 24px !important;
    width: 24px !important;
    height: 24px !important;
  }

  .table-wrap .coin-name {
    font-size: 9px !important;
  }

  .table-wrap .coin-symbol {
    font-size: 7px !important;
  }

  .table-wrap .price-value {
    font-size: 8px !important;
  }

  .table-wrap .ex-tag {
    font-size: 6.5px !important;
  }

  .table-wrap td:nth-child(5) .pct,
  .table-wrap td:nth-child(6) .pct {
    font-size: 7px !important;
  }

  .table-wrap .badge {
    font-size: 6.5px !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
  }

  .table-wrap .ref-btn {
    font-size: 6.5px !important;
  }
}  font-size: 13px !important;
  line-height: 1.2 !important;

  border-radius: 5px !important;
  white-space: nowrap !important;
}
/* ===== Mobile Table Improvement ===== */

@media (max-width: 700px) {

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .data-table {
    min-width: 760px;
  }

  .data-table th {
    font-size: 11px;
    white-space: nowrap;
    padding: 9px 7px;
  }

  .data-table td {
    padding: 10px 7px;
    white-space: nowrap;
  }

  .coin-column {
    min-width: 130px;
  }

  .coin-logo-wrap {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .coin-name {
    font-size: 12px;
  }

  .coin-symbol {
    font-size: 9px;
  }

  .price-value {
    font-size: 13px;
  }

  .pct {
    font-size: 11px;
  }

  .ex-tag {
    font-size: 9px !important;
    padding: 2px 5px !important;
  }
}
/* =========================================================
   ARZMAX MOBILE TABLE + MARKET GAUGES
   Mobile only - desktop remains unchanged
========================================================= */
@media (max-width: 700px) {
  /* ---------- Main arbitrage table ---------- */
  .table-wrap {
    width: 100%;
    overflow: hidden;
  }
  .table-wrap table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
    border-spacing: 0;
    padding: 0;
  }
  .table-wrap thead {
    display: none;
  }
  .table-wrap tbody {
    display: block;
    width: 100%;
  }
  .table-wrap tbody tr.main-row {
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    width: 100%;
    min-width: 0 !important;
    margin-bottom: 9px;
    padding: 7px 5px;
    border-radius: 15px;
    box-sizing: border-box;
    transform: none;
  }
  .table-wrap tbody tr.main-row td {
    min-width: 0 !important;
    width: auto !important;
    box-sizing: border-box;
    padding: 7px 5px;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden;
  }
  /* Expand button - vertical area */
  .table-wrap tbody tr.main-row td:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
  }
  /* Coin - first row */
  .table-wrap tbody tr.main-row td:nth-child(2) {
    grid-column: 2 / 5;
    grid-row: 1;
    padding-top: 6px;
    padding-bottom: 8px;
  }
  /* Buy */
  .table-wrap tbody tr.main-row td:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    min-width: 0 !important;
    text-align: center;
  }
  /* Sell */
  .table-wrap tbody tr.main-row td:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
    min-width: 0 !important;
    text-align: center;
  }
  /* Spread */
  .table-wrap tbody tr.main-row td:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
    min-width: 0 !important;
    text-align: center;
  }
  /* Net profit */
  .table-wrap tbody tr.main-row td:nth-child(6) {
    grid-column: 3;
    grid-row: 3;
    min-width: 0 !important;
    text-align: center;
  }
  /* Status */
  .table-wrap tbody tr.main-row td:nth-child(7) {
    grid-column: 4;
    grid-row: 3;
    min-width: 0 !important;
    text-align: center;
  }
  /* Referral buttons */
  .table-wrap tbody tr.main-row td:nth-child(8) {
    grid-column: 4;
    grid-row: 2;
    min-width: 0 !important;
    text-align: center;
    padding-left: 3px;
    padding-right: 3px;
  }
  .table-wrap .coin-column,
  .table-wrap .sym-cell {
    min-width: 0 !important;
    width: 100% !important;
  }
  .table-wrap .coin-cell {
    min-width: 0;
    width: 100%;
    white-space: normal;
  }
  .table-wrap .coin-info {
    min-width: 0;
    overflow: hidden;
  }
  .table-wrap .coin-name,
  .table-wrap .coin-symbol {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .table-wrap .coin-logo-wrap {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
  }
  .table-wrap .price-value {
    max-width: 100%;
    font-size: 11px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .table-wrap .ex-tag {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8px !important;
    padding: 2px 4px !important;
  }
  .table-wrap td:nth-child(5) .pct {
    min-width: 0;
    max-width: 100%;
    padding: 5px 5px;
    font-size: 10px;
  }
  .table-wrap td:nth-child(6) .pct {
    min-width: 0 !important;
    max-width: 100%;
    padding: 5px 5px;
    font-size: 10px;
  }
  .table-wrap .badge {
    max-width: 100%;
    padding: 4px 5px;
    font-size: 8px;
    white-space: nowrap;
  }
  .table-wrap .action-cell {
    white-space: normal;
  }
  .table-wrap .ref-btn {
    min-width: 0 !important;
    width: 100%;
    max-width: 72px;
    padding: 5px 3px;
    font-size: 8px;
    white-space: nowrap;
  }
  /* Expanded detail section */
  .table-wrap tbody tr.detail-row {
    display: table-row;
    width: 100%;
  }
  .table-wrap tbody tr.detail-row td {
    width: 100% !important;
    min-width: 0 !important;
  }
  .table-wrap .detail-inner {
    margin: 0 2px 7px;
    padding: 10px 7px;
    overflow: hidden;
  }
  .table-wrap .detail-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
  }
  .table-wrap .detail-table th,
  .table-wrap .detail-table td {
    min-width: 0 !important;
    padding: 7px 4px;
    font-size: 9px;
  }
  /* ---------- Fear & Greed / Market gauges ---------- */
  .panel:has(#gaugeFearGreed) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 5px !important;
    flex-wrap: nowrap !important;
    padding: 10px 7px !important;
    overflow: hidden;
  }
  .panel:has(#gaugeFearGreed) > div {
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    overflow: hidden;
  }
  .panel:has(#gaugeFearGreed) h3 {
    font-size: 9px !important;
    line-height: 1.5;
    white-space: normal;
  }
  .panel:has(#gaugeFearGreed) .gauge-wrap {
    width: 100% !important;
  }
  .panel:has(#gaugeFearGreed) .gauge-wrap svg {
    width: 100% !important;
    max-width: 125px !important;
  }
  .panel:has(#gaugeFearGreed) .hint {
    font-size: 8px !important;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .panel:has(#gaugeFearGreed) #lastUpdate {
    font-size: 12px !important;
  }
  .panel:has(#gaugeFearGreed) #manualRefresh {
    width: 100%;
    padding: 5px 3px;
    font-size: 8px;
    white-space: nowrap;
  }
}
/* ===== ARZMAX MOBILE CARD FINAL ===== */
@media (max-width: 700px) {
  .table-wrap tbody tr.main-row {
    grid-template-columns: 27px minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }
  /* فلش */
  .table-wrap tbody tr.main-row td:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 4;
  }
  /* نام ارز - کنار قیمت خرید و فروش */
  .table-wrap tbody tr.main-row td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  /* بهترین خرید */
  .table-wrap tbody tr.main-row td:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
  }
  /* بهترین فروش */
  .table-wrap tbody tr.main-row td:nth-child(4) {
    grid-column: 4;
    grid-row: 1;
  }
  /* اختلاف */
  .table-wrap tbody tr.main-row td:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
  }
  /* سود خالص */
  .table-wrap tbody tr.main-row td:nth-child(6) {
    grid-column: 3;
    grid-row: 2;
  }
  /* وضعیت */
  .table-wrap tbody tr.main-row td:nth-child(7) {
    grid-column: 4;
    grid-row: 2;
  }
  /* دکمه های رفرال - ردیف سوم */
  .table-wrap tbody tr.main-row td:nth-child(8) {
    grid-column: 2 / 5;
    grid-row: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 3px 2px;
  }
  .table-wrap tbody tr.main-row td:nth-child(8) .ref-btn {
    flex: 1 1 0;
    width: auto;
    max-width: none;
  }
  /* نام ارز */
  .table-wrap .coin-cell {
    justify-content: flex-start;
  }
  .table-wrap .coin-name {
    font-size: 11px;
  }
  .table-wrap .coin-symbol {
    font-size: 9px;
  }
  /* قیمت ها */
  .table-wrap .price-value {
    font-size: 10px;
  }
  .table-wrap .ex-tag {
    font-size: 7px !important;
    padding: 2px 3px !important;
  }
  /* برچسب های کوچک برای مشخص شدن ستون ها */
  .table-wrap tbody tr.main-row td:nth-child(3)::before {
    content: "خرید";
    display: block;
    font-size: 7px;
    color: var(--text-muted);
    margin-bottom: 2px;
  }
  .table-wrap tbody tr.main-row td:nth-child(4)::before {
    content: "فروش";
    display: block;
    font-size: 7px;
    color: var(--text-muted);
    margin-bottom: 2px;
  }
  .table-wrap tbody tr.main-row td:nth-child(5)::before {
    content: "اختلاف";
    display: block;
    font-size: 7px;
    color: var(--text-muted);
    margin-bottom: 2px;
  }
  .table-wrap tbody tr.main-row td:nth-child(6)::before {
    content: "سود خالص";
    display: block;
    font-size: 7px;
    color: var(--text-muted);
    margin-bottom: 2px;
  }
  .table-wrap tbody tr.main-row td:nth-child(7)::before {
    content: "وضعیت";
    display: block;
    font-size: 7px;
    color: var(--text-muted);
    margin-bottom: 2px;
  }
}
