:root {
  --sidebar-width: 280px;
  --sidebar-mini-width: 84px;
  --admin-navbar-height: 72px;
  --admin-bg: #f5f7fb;
  --admin-surface: #ffffff;
  --admin-surface-soft: #f8fafc;
  --admin-border: #dbe4ef;
  --admin-text: #1f2937;
  --admin-muted: #6b7280;
  --admin-primary: #2563eb;
  --admin-primary-dark: #1d4ed8;
  --admin-success: #0f766e;
  --admin-warning: #d97706;
  --admin-danger: #dc2626;
  --admin-sidebar: #111827;
  --admin-sidebar-soft: #1f2937;
  --admin-shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.06);
  --admin-shadow: 0 18px 46px rgba(15, 23, 42, 0.09);
  --admin-shadow-lg: 0 26px 70px rgba(15, 23, 42, 0.12);
  --admin-ring: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #f8fbff 0%, var(--admin-bg) 42%, #eef4fa 100%);
  color: var(--admin-text);
  font-family: "Segoe UI", Arial, sans-serif;
}

a {
  text-decoration: none;
}

.admin-shell {
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  /* Reserve scrollbar gutter to keep inner content width stable so header/footer dividers align with scrollbar */
  scrollbar-gutter: stable;
  background: var(--admin-sidebar);
  color: #ffffff;
  box-shadow: 18px 0 42px rgba(15, 23, 42, 0.18);
  transform: translateX(0);
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-header {
  padding: 1.35rem 1.25rem 1.15rem;
  margin-inline: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: #ffffff;
}

.brand-mark:hover,
.brand-mark:focus {
  color: #ffffff;
}

.brand-icon,
.profile-avatar,
.metric-icon,
.nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  font-weight: 800;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #0f766e);
  color: #ffffff;
}

.brand-icon.brand-icon-image {
  background: none;
  padding: 0;
}

.brand-icon .brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.brand-copy,
.brand-title,
.brand-subtitle,
.nav-text,
.sidebar-footer-text {
  min-width: 0;
  transition: opacity 0.16s ease, width 0.16s ease;
}

.brand-title,
.brand-subtitle {
  display: block;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.brand-subtitle {
  color: #9ca3af;
  font-size: 0.78rem;
}

.sidebar-nav {
  display: grid;
  gap: 0.45rem;
  padding: 1.1rem 1rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.78rem 0.9rem;
  border-radius: 8px;
  color: #d1d5db;
  font-weight: 700;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus,
.sidebar-nav .nav-link.active {
  background: var(--admin-sidebar-soft);
  color: #ffffff;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus {
  transform: translateX(2px);
}

#ordersPendingBadge.orders-badge-pulse,
#adminOrdersPendingBadge.orders-badge-pulse {
  animation: orders-badge-pulse 0.45s ease-in-out 3;
}

#adminEmergencyKillsBadge.emergency-kills-badge-pulse {
  animation: emergency-kills-badge-pulse 0.45s ease-in-out 4;
}

@keyframes emergency-kills-badge-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: none;
  }

  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.45);
  }
}

.admin-emergency-kill-alert-modal {
  border-width: 2px !important;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(220, 53, 69, 0.28);
}

.admin-emergency-kill-alert-modal--blink {
  animation: admin-emergency-kill-modal-blink 0.55s ease-in-out 1;
}

@keyframes admin-emergency-kill-modal-blink {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.55), 0 24px 48px rgba(220, 53, 69, 0.28);
    border-color: rgba(220, 53, 69, 0.85) !important;
  }

  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 14px rgba(220, 53, 69, 0.18), 0 28px 56px rgba(220, 53, 69, 0.42);
    border-color: #ff2d55 !important;
  }
}

#adminEmergencyKillAlertModal.show .modal-backdrop,
#adminEmergencyKillAlertModal.show ~ .modal-backdrop {
  opacity: 0.72;
}

.admin-emergency-kill-alert-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.2), rgba(255, 45, 85, 0.12));
  color: #dc3545;
  font-size: 2rem;
  box-shadow: inset 0 0 0 1px rgba(220, 53, 69, 0.35);
}

.admin-emergency-kill-alert-details {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: 0.625rem;
  background: rgba(248, 250, 252, 0.9);
  text-align: left;
}

.admin-emergency-kill-alert-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
}

.admin-emergency-kill-alert-row + .admin-emergency-kill-alert-row {
  border-top: 1px dashed rgba(148, 163, 184, 0.45);
  margin-top: 0.2rem;
  padding-top: 0.5rem;
}

.admin-emergency-kill-alert-row dt {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--admin-muted, #64748b);
  flex-shrink: 0;
}

.admin-emergency-kill-alert-row dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--admin-text, #0f172a);
  text-align: right;
  word-break: break-word;
}

html[data-theme="dark"] .admin-emergency-kill-alert-details {
  background: rgba(30, 41, 59, 0.55);
}

html[data-theme="dark"] .admin-emergency-kill-alert-icon {
  color: #f87171;
}

.admin-order-status-updated {
  animation: admin-order-row-flash 1.2s ease-out 1;
}

.admin-order-row-fadeout {
  opacity: 0;
  transition: opacity 0.28s ease-out;
}

@keyframes admin-order-row-flash {
  0% {
    background-color: rgba(25, 135, 84, 0.22);
  }
  100% {
    background-color: transparent;
  }
}

#liveTradersBadge.live-traders-badge-pulse {
  animation: live-traders-badge-pulse 0.45s ease-in-out 3;
}

#adminLiveTradersNav.live-traders-nav-blink {
  animation: live-traders-nav-blink 0.55s ease-in-out 6;
  border-radius: 10px;
}

#adminLiveTradersNavIcon.live-traders-icon-blink {
  animation: live-traders-icon-blink 0.55s ease-in-out 6;
}

#dashboardLiveTradersMetric.live-traders-metric-blink,
#adminLiveTradersDashPanel.live-traders-panel-blink,
#adminLiveTradersPagePanel.live-traders-panel-blink {
  animation: live-traders-panel-blink 0.55s ease-in-out 5;
}

.admin-live-trade-row-new {
  animation: admin-live-trade-row-flash 1.4s ease-out 1;
}

@keyframes live-traders-nav-blink {
  0%,
  100% {
    background-color: transparent;
    box-shadow: none;
  }

  50% {
    background-color: rgba(25, 135, 84, 0.28);
    box-shadow: inset 0 0 0 2px rgba(25, 135, 84, 0.55);
  }
}

@keyframes live-traders-icon-blink {
  0%,
  100% {
    color: inherit;
    transform: scale(1);
  }

  50% {
    color: #198754;
    transform: scale(1.12);
  }
}

@keyframes live-traders-panel-blink {
  0%,
  100% {
    box-shadow: none;
  }

  50% {
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.35);
  }
}

@keyframes admin-live-trade-row-flash {
  0% {
    background-color: rgba(25, 135, 84, 0.24);
  }

  100% {
    background-color: transparent;
  }
}

#supportChatBadge.support-chat-badge-pulse,
#dashboardUnreadChatCount.support-chat-badge-pulse {
  animation: support-chat-badge-pulse 0.45s ease-in-out 3;
}

.admin-metrics-grid .metric-card.metric-has-alert {
  box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.2);
}

@keyframes orders-badge-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: none;
  }

  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.45);
  }
}

@keyframes live-traders-badge-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: none;
  }

  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.45);
  }
}

@keyframes support-chat-badge-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: none;
  }

  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.45);
  }
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #bfdbfe;
  font-size: 0.76rem;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: auto;
  margin-inline: 1.25rem;
  padding: 1rem 0;
  color: #d1d5db;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  white-space: nowrap;
}

.sidebar-user {
  margin: auto 1rem 1rem;
  padding: 0.85rem;
  display: grid;
  justify-items: center;
  gap: 0.22rem;
  border: 1px solid var(--admin-sidebar-border);
  border-radius: 8px;
  background: var(--admin-sidebar-soft);
  text-align: center;
}

.sidebar-user-avatar {
  border: 3px solid #53e9b9;
}

.sidebar-user strong {
  color: var(--admin-sidebar-text-strong);
  font-size: 1rem;
  line-height: 1.1;
}

.sidebar-user small {
  color: var(--admin-sidebar-muted);
  font-size: 0.84rem;
}

.sidebar-user-menu {
  width: 100%;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--admin-sidebar-border, rgba(255, 255, 255, 0.08));
  display: grid;
  gap: 0.12rem;
}

.sidebar-user-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.48rem 0.55rem;
  border-radius: 6px;
  color: var(--admin-sidebar-text, #d1d5db);
  font-size: 0.875rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-user-link:hover,
.sidebar-user-link:focus,
.sidebar-user-link.active {
  background: var(--admin-sidebar-soft);
  color: var(--admin-sidebar-text-strong, #ffffff);
}

.sidebar-user-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  flex-shrink: 0;
  font-size: 1rem;
}

.sidebar-user-link-signout {
  color: #f87171;
}

.sidebar-user-link-signout:hover,
.sidebar-user-link-signout:focus {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.status-dot,
.notification-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.status-dot {
  flex: 0 0 auto;
  background: #22c55e;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1030;
  display: none;
  background: rgba(15, 23, 42, 0.5);
}

.admin-main {
  width: auto;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.2s ease;
}

.admin-navbar {
  position: sticky;
  top: 0;
  z-index: 1035;
  min-height: var(--admin-navbar-height);
  border-bottom: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
}

.admin-navbar.bg-white {
  background-color: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(14px);
}

.account-activation-alert {
  position: sticky;
  top: var(--admin-navbar-height);
  z-index: 1015;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(255, 193, 7, 0.35);
  backdrop-filter: blur(10px);
}

.account-activation-alert-inner {
  border: 1px solid rgba(255, 193, 7, 0.55);
  box-shadow: 0 6px 18px rgba(255, 193, 7, 0.12);
}

html[data-theme="dark"] .account-activation-alert {
  background: rgba(15, 23, 42, 0.96);
  border-bottom-color: rgba(255, 193, 7, 0.25);
}

.security-deposit-alert {
  position: sticky;
  top: var(--admin-navbar-height);
  z-index: 1015;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(220, 53, 69, 0.35);
  backdrop-filter: blur(10px);
}

.security-deposit-alert-inner {
  border: 1px solid rgba(220, 53, 69, 0.55);
  box-shadow: 0 6px 18px rgba(220, 53, 69, 0.12);
}

html[data-theme="dark"] .security-deposit-alert {
  background: rgba(15, 23, 42, 0.96);
  border-bottom-color: rgba(220, 53, 69, 0.25);
}

.wallet-low-balance-alert {
  position: sticky;
  top: var(--admin-navbar-height);
  z-index: 1014;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(255, 193, 7, 0.35);
  backdrop-filter: blur(10px);
}

.wallet-low-balance-alert-inner {
  border: 1px solid rgba(255, 193, 7, 0.55);
  box-shadow: 0 6px 18px rgba(255, 193, 7, 0.12);
}

html[data-theme="dark"] .wallet-low-balance-alert {
  background: rgba(15, 23, 42, 0.96);
  border-bottom-color: rgba(255, 193, 7, 0.25);
}

.pending-order-alert {
  position: sticky;
  top: var(--admin-navbar-height);
  z-index: 1016;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(13, 110, 253, 0.35);
  backdrop-filter: blur(10px);
}

.pending-order-alert-inner {
  border: 1px solid rgba(13, 110, 253, 0.55);
  box-shadow: 0 6px 18px rgba(13, 110, 253, 0.12);
}

.pending-order-alert--pulse .pending-order-alert-icon {
  animation: pending-order-alert-icon-pulse 0.8s ease-in-out 6;
}

html[data-theme="dark"] .pending-order-alert {
  background: rgba(15, 23, 42, 0.96);
  border-bottom-color: rgba(13, 110, 253, 0.25);
}

@keyframes pending-order-alert-icon-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.15);
    opacity: 0.75;
  }
}

.wallet-insufficient-modal {
  border-radius: 0.875rem;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.wallet-insufficient-icon-wrap {
  display: flex;
  justify-content: center;
}

.wallet-insufficient-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.18), rgba(255, 153, 0, 0.12));
  color: #d97706;
  font-size: 1.45rem;
  box-shadow: inset 0 0 0 1px rgba(255, 193, 7, 0.35);
}

.wallet-insufficient-summary {
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: 0.625rem;
  background: rgba(248, 250, 252, 0.85);
  padding: 0.65rem 0.75rem;
  text-align: left;
}

.wallet-insufficient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
}

.wallet-insufficient-row + .wallet-insufficient-row {
  border-top: 1px dashed rgba(148, 163, 184, 0.45);
  margin-top: 0.15rem;
  padding-top: 0.5rem;
}

.wallet-insufficient-row--deposit {
  padding-bottom: 0.15rem;
}

.wallet-insufficient-row-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-muted, #64748b);
  font-weight: 600;
  flex-shrink: 0;
}

.wallet-insufficient-row-value {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
  word-break: break-word;
}

.wallet-insufficient-row-value--balance.wallet-insufficient-row-value--negative,
.wallet-insufficient-row-value--balance.wallet-insufficient-row-value--low {
  color: #dc3545;
}

.wallet-insufficient-row-value--deposit {
  color: #0d6efd;
  font-size: 1rem;
}

.wallet-insufficient-hint {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.72rem;
  color: var(--admin-muted, #64748b);
  text-align: center;
}

html[data-theme="dark"] .wallet-insufficient-summary {
  background: rgba(30, 41, 59, 0.6);
}

html[data-theme="dark"] .wallet-insufficient-icon {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.14), rgba(255, 153, 0, 0.08));
  color: #fbbf24;
}

.sidebar-toggle {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus {
  border-color: #bfdbfe;
  background: #f8fbff;
  box-shadow: var(--admin-ring);
}

.sidebar-toggle span {
  width: 18px;
  height: 2px;
  display: block;
  background: var(--admin-text);
  border-radius: 999px;
}

.search-input {
  max-width: 520px;
  border-color: var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface-soft);
  min-height: 42px;
  box-shadow: none;
}

.search-input:focus {
  border-color: #93c5fd;
  box-shadow: var(--admin-ring);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-closure-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: linear-gradient(180deg, #fef2f2 0%, #fff1f2 100%);
  color: #b91c1c;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.1);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  animation: admin-closure-pill-pulse 2.4s ease-in-out infinite;
}

.admin-closure-live-pill:hover,
.admin-closure-live-pill:focus {
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.16);
  transform: translateY(-1px);
}

.admin-closure-live-pill i {
  font-size: 1rem;
}

@keyframes admin-closure-pill-pulse {
  0%,
  100% {
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.1);
  }

  50% {
    box-shadow: 0 8px 22px rgba(239, 68, 68, 0.22);
  }
}

.admin-sidebar-closure-alert {
  margin: 0.15rem 0 0.55rem;
  padding: 0 0.9rem;
}

.admin-sidebar-closure-alert-link {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.8rem;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.admin-sidebar-closure-alert-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

.admin-sidebar-closure-alert-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.admin-sidebar-closure-alert-copy strong {
  font-size: 0.82rem;
}

.admin-sidebar-closure-alert-status {
  font-weight: 700;
}

.admin-sidebar-closure-alert-window {
  font-size: 0.72rem;
}

/* Light admin sidebar — high-contrast closure alert */
html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--live {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #fff5f5 0%, #fef2f2 100%);
  color: #7f1d1d;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--live:hover,
html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--live:focus {
  border-color: #f87171;
  background: #fee2e2;
  color: #7f1d1d;
}

html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--live .admin-sidebar-closure-alert-icon {
  color: #dc2626;
}

html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--live .admin-sidebar-closure-alert-copy strong {
  color: #991b1b;
}

html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--live .admin-sidebar-closure-alert-status {
  color: #b91c1c;
}

html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--live .admin-sidebar-closure-alert-window {
  color: #9f1239;
}

html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--upcoming {
  border-color: #fcd34d;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  color: #78350f;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--upcoming:hover,
html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--upcoming:focus {
  border-color: #fbbf24;
  background: #fde68a;
  color: #78350f;
}

html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--upcoming .admin-sidebar-closure-alert-icon {
  color: #d97706;
}

html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--upcoming .admin-sidebar-closure-alert-copy strong {
  color: #92400e;
}

html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--upcoming .admin-sidebar-closure-alert-status {
  color: #b45309;
}

html:not([data-theme="dark"]) .admin-sidebar-closure-alert-link--upcoming .admin-sidebar-closure-alert-window {
  color: #a16207;
}

/* Dark admin sidebar — closure alert */
html[data-theme="dark"] .admin-sidebar-closure-alert-link--live {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
}

html[data-theme="dark"] .admin-sidebar-closure-alert-link--live:hover,
html[data-theme="dark"] .admin-sidebar-closure-alert-link--live:focus {
  background: rgba(127, 29, 29, 0.5);
  border-color: rgba(252, 165, 165, 0.6);
  color: #fff;
}

html[data-theme="dark"] .admin-sidebar-closure-alert-link--live .admin-sidebar-closure-alert-icon {
  color: #fca5a5;
}

html[data-theme="dark"] .admin-sidebar-closure-alert-link--live .admin-sidebar-closure-alert-copy strong {
  color: #fff;
}

html[data-theme="dark"] .admin-sidebar-closure-alert-link--live .admin-sidebar-closure-alert-status {
  color: #fecaca;
}

html[data-theme="dark"] .admin-sidebar-closure-alert-link--live .admin-sidebar-closure-alert-window {
  color: #fca5a5;
}

html[data-theme="dark"] .admin-sidebar-closure-alert-link--upcoming {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(120, 53, 15, 0.35);
  color: #fde68a;
}

html[data-theme="dark"] .admin-sidebar-closure-alert-link--upcoming:hover,
html[data-theme="dark"] .admin-sidebar-closure-alert-link--upcoming:focus {
  background: rgba(120, 53, 15, 0.5);
  border-color: rgba(252, 211, 77, 0.55);
  color: #fffbeb;
}

html[data-theme="dark"] .admin-sidebar-closure-alert-link--upcoming .admin-sidebar-closure-alert-icon {
  color: #fbbf24;
}

html[data-theme="dark"] .admin-sidebar-closure-alert-link--upcoming .admin-sidebar-closure-alert-copy strong {
  color: #fffbeb;
}

html[data-theme="dark"] .admin-sidebar-closure-alert-link--upcoming .admin-sidebar-closure-alert-status {
  color: #fde68a;
}

html[data-theme="dark"] .admin-sidebar-closure-alert-link--upcoming .admin-sidebar-closure-alert-window {
  color: #fcd34d;
}

.admin-site-closure-nav-badge {
  font-size: 0.65rem;
  vertical-align: middle;
}

html[data-theme="dark"] .admin-closure-live-pill {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.45) 0%, rgba(69, 10, 10, 0.55) 100%);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

html[data-theme="dark"] .admin-closure-live-pill:hover,
html[data-theme="dark"] .admin-closure-live-pill:focus {
  color: #fff;
}

/* Admin — profit calculation */
.profit-calc-math var {
  font-style: italic;
  font-weight: 700;
}

.profit-calc-given dd {
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}

.profit-calc-steps {
  display: grid;
  gap: 1.15rem;
}

.profit-calc-step {
  padding-left: 0.85rem;
  border-left: 3px solid #93c5fd;
}

.profit-calc-step-label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: var(--admin-text);
}

.profit-calc-formula code,
.profit-calc-sub code {
  font-size: 0.88rem;
  color: inherit;
  background: transparent;
  padding: 0;
}

.profit-calc-result-card .profit-calc-summary {
  background: rgba(37, 99, 235, 0.06) !important;
}

html[data-theme="dark"] .profit-calc-result-card .profit-calc-summary {
  background: rgba(37, 99, 235, 0.12) !important;
}

.icon-button,
.profile-button {
  border: 1px solid var(--admin-border);
  background: #ffffff;
  color: var(--admin-text);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.icon-button:hover,
.icon-button:focus,
.profile-button:hover,
.profile-button:focus {
  border-color: #bfdbfe;
  box-shadow: var(--admin-ring);
}

.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-weight: 800;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--admin-danger);
}

.notification-count-badge {
  position: absolute;
  top: 3px;
  right: 1px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--admin-danger, #dc3545);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  border: 2px solid #fff;
  box-sizing: border-box;
  pointer-events: none;
}

.notification-count-badge--wide {
  min-width: 20px;
  padding: 0 3px;
  font-size: 0.5625rem;
}

html[data-theme="dark"] .notification-count-badge {
  border-color: rgba(15, 23, 42, 0.92);
}

.notification-menu {
  width: min(320px, calc(100vw - 2rem));
  max-width: min(320px, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: var(--admin-shadow);
}

.notification-menu .dropdown-header {
  min-width: 0;
}

.notification-menu-footer {
  flex-shrink: 0;
  background: var(--admin-surface-soft, #f8fafc);
}

.user-notify-mark-all {
  font-weight: 600;
  white-space: nowrap;
}

.notification-menu .dropdown-item,
.notification-menu .notification-item {
  display: grid;
  gap: 0.2rem;
  padding-block: 0.7rem;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.notification-title {
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.notification-time {
  color: var(--admin-muted);
  font-size: 0.82rem;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.notification-message {
  color: var(--admin-muted);
  font-size: 0.84rem;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.notification-item-unread {
  background: rgba(59, 130, 246, 0.08);
}

.notification-item-unread .notification-title {
  color: var(--admin-primary, #2563eb);
}

#userNotifyList {
  max-height: min(360px, 60vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.icon-button.user-notify-pulse {
  animation: user-notify-pulse 0.55s ease-in-out 2;
}

@keyframes user-notify-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-weight: 700;
}

.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #e0ecff;
  color: var(--admin-primary-dark);
  font-size: 0.76rem;
}

.avatar-img {
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.avatar-md {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.avatar-xl {
  width: 78px;
  height: 78px;
  border-radius: 50%;
}

.profile-button .avatar-sm {
  border: 2px solid #52e7b8;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .profile-button .avatar-sm {
  border-color: #54f0be;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.profile-dropdown-menu {
  min-width: 13.5rem;
  padding-top: 0.45rem;
}

.profile-dropdown-id-wrap {
  list-style: none;
  padding: 0.35rem 0.65rem 0.15rem;
}

.profile-dropdown-id-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: linear-gradient(180deg, #eff6ff 0%, #e0f2fe 100%);
}

.profile-dropdown-id-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0369a1;
}

.profile-dropdown-id-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0c4a6e;
  word-break: break-all;
}

.profile-dropdown-divider {
  margin: 0.35rem 0.65rem;
  opacity: 0.55;
}

html[data-theme="dark"] .profile-dropdown-id-card {
  border-color: rgba(56, 189, 248, 0.28);
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.55) 0%, rgba(12, 74, 110, 0.35) 100%);
}

html[data-theme="dark"] .profile-dropdown-id-label {
  color: #7dd3fc;
}

html[data-theme="dark"] .profile-dropdown-id-value {
  color: #f0f9ff;
}

.dashboard-content {
  min-height: calc(100vh - 132px);
}

.dashboard-content > .container-fluid {
  padding-top: 1.75rem !important;
  padding-bottom: 1.75rem !important;
}

.page-heading,
.panel-header,
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-heading {
  margin-bottom: 1.35rem;
}

.page-heading h1 {
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--admin-primary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.btn {
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn:hover,
.btn:focus {
  transform: translateY(-1px);
}

.btn-primary {
  border-color: var(--admin-primary);
  background: var(--admin-primary);
}

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

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

.metric-card {
  position: relative;
  min-height: 164px;
  padding: 1.35rem;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--metric-color, var(--admin-primary));
}

.metric-card:hover {
  border-color: #c6d5e8;
  box-shadow: var(--admin-shadow-lg);
  transform: translateY(-3px);
}

.metric-primary {
  --metric-color: var(--admin-primary);
}

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

.metric-warning {
  --metric-color: var(--admin-warning);
}

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

.metric-info {
  --metric-color: #0891b2;
}

.metric-info .metric-icon {
  background: #e0f7fa;
}

.dashboard-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

/* Tablet: wallet + sales on row 1, profit full width on row 2 */
.dashboard-metrics-grid .today-profit-card {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
}

/* Web: wallet | sales (compact) | today profit (~2 cols) */
@media (min-width: 992px) {
  .dashboard-metrics-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
    align-items: stretch;
  }

  .dashboard-metrics-grid .today-profit-card {
    grid-column: auto;
  }

  .dashboard-metrics-grid .metric-card-wallet,
  .dashboard-metrics-grid .metric-card-sales {
    padding: 0.75rem 0.85rem;
    min-height: 118px;
  }

  .dashboard-metrics-grid .metric-card-wallet .metric-value-wallet {
    font-size: 1.3rem;
    line-height: 1.2;
  }

  .dashboard-metrics-grid .metric-card-sales .metric-value {
    font-size: 1.35rem;
  }

  .dashboard-metrics-grid .metric-card-wallet .metric-wallet-inr,
  .dashboard-metrics-grid .metric-card-wallet .metric-wallet-live-rate {
    font-size: 0.72rem;
  }

  .dashboard-metrics-grid .metric-card-wallet .metric-meta-wallet .btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
  }

  .dashboard-metrics-grid .metric-card-sales .metric-meta {
    font-size: 0.7rem;
    line-height: 1.35;
    flex-wrap: wrap;
    gap: 0.15rem 0.35rem;
  }

  .dashboard-metrics-grid .today-profit-card {
    display: flex;
    flex-direction: column;
    min-height: 118px;
    padding: 0.85rem 1rem;
    overflow: hidden;
  }

  .dashboard-metrics-grid .today-profit-card .today-profit-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
  }

  .dashboard-metrics-grid .today-profit-card .today-profit-table-wrap.is-scrollable {
    flex: 1 1 auto;
    min-height: 0;
  }

  .dashboard-metrics-grid .today-profit-card .today-profit-footer {
    flex: 0 0 auto;
    align-self: flex-end;
  }

  .dashboard-metrics-grid .today-profit-card .today-profit-total-value {
    font-size: 1rem;
  }
}

.dashboard-metrics-grid .metric-card {
  min-height: 118px;
  padding: 0.9rem 1rem;
}

.dashboard-metrics-grid .metric-value {
  margin-top: 0.55rem;
  font-size: 1.55rem;
}

.dashboard-metrics-grid .metric-meta {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.dashboard-metrics-grid .metric-icon {
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
}

.dashboard-metrics-grid .metric-label {
  font-size: 0.68rem;
}

.dashboard-metrics-grid .metric-card-wallet {
  min-height: 128px;
}

.dashboard-metrics-grid .metric-value-wallet {
  font-size: 1.45rem;
}

.dashboard-metrics-grid .metric-value-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-muted);
}

.dashboard-metrics-grid .metric-wallet-inr {
  margin-top: 0.2rem;
  color: var(--admin-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.dashboard-metrics-grid .metric-wallet-adjustment {
  margin-top: 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--admin-muted);
  letter-spacing: 0.01em;
}

.dashboard-metrics-grid .metric-wallet-adjustment .bi {
  font-size: 0.7rem;
  margin-right: 0.15rem;
  opacity: 0.85;
}

.dashboard-metrics-grid .metric-wallet-live-rate {
  margin-top: 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--admin-muted);
  letter-spacing: 0.01em;
}

.dashboard-metrics-grid .metric-wallet-live-rate .bi {
  font-size: 0.7rem;
  margin-right: 0.15rem;
  opacity: 0.85;
}

.dashboard-metrics-grid .metric-meta-wallet {
  margin-top: 0.45rem;
  justify-content: flex-end;
}

@media (max-width: 575.98px) {
  .dashboard-metrics-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics-grid .metric-card {
    min-height: 108px;
  }

  .dashboard-metrics-grid .metric-value {
    font-size: 1.4rem;
  }
}

.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-metrics-grid .metric-card {
  min-height: 118px;
  padding: 0.9rem 1rem;
}

.admin-metrics-grid .metric-value {
  margin-top: 0.6rem;
  font-size: 1.65rem;
}

.admin-metrics-grid .metric-meta {
  margin-top: 0.5rem;
  font-size: 0.78rem;
}

.admin-metrics-grid .metric-icon {
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
}

.admin-metrics-grid .metric-label {
  font-size: 0.68rem;
}

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

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

@media (max-width: 575.98px) {
  .admin-metrics-grid {
    grid-template-columns: 1fr;
  }

  .admin-metrics-grid .metric-card {
    min-height: 108px;
  }

  .admin-metrics-grid .metric-value {
    font-size: 1.5rem;
  }
}

.metric-label {
  color: var(--admin-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--metric-color, var(--admin-primary));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.metric-success .metric-icon {
  background: #e7f6f3;
}

.metric-warning .metric-icon {
  background: #fff4df;
}

.metric-danger .metric-icon {
  background: #ffecec;
}

.metric-value {
  margin-top: 1rem;
  color: var(--admin-text);
  font-size: 2.18rem;
  font-weight: 800;
  line-height: 1;
}

.metric-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.9rem;
  color: var(--admin-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.panel {
  padding: 1.35rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.panel:hover {
  border-color: #c6d5e8;
  box-shadow: var(--admin-shadow-lg);
}

.panel-header {
  margin-bottom: 1.25rem;
}

.panel-header p {
  font-size: 0.92rem;
}

.orders-filter-bar {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  width: auto;
  max-width: 100%;
  padding: 0.4rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
}

.panel-header .orders-filter-bar .form-control,
.panel-header .orders-filter-bar .form-select,
.panel-header .orders-filter-bar .input-group {
  width: auto;
}

.orders-filter-bar .orders-filter-control {
  flex: 0 0 auto;
}

.orders-filter-bar .form-control,
.orders-filter-bar .form-select,
.orders-filter-bar .input-group-text {
  border-color: #cbd5e1;
  border-radius: 7px;
  font-size: 0.875rem;
}

.orders-filter-bar .form-control:focus,
.orders-filter-bar .form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.15rem rgba(59, 130, 246, 0.12);
}

.orders-filter-bar .input-group-text {
  background: #fff;
  color: #64748b;
}

.orders-filter-bar .orders-filter-date {
  width: 9rem;
  min-width: 8.5rem;
}

.orders-filter-bar .orders-filter-search {
  width: 10.5rem;
  min-width: 9rem;
}

.orders-filter-bar .orders-filter-status {
  width: 8.25rem;
  min-width: 7.5rem;
}

.orders-filter-bar .orders-filter-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1.2;
  border-radius: 7px;
  white-space: nowrap;
  flex: 0 0 auto;
  max-width: 100%;
}

.orders-filter-bar .orders-filter-download .bi {
  font-size: 0.9rem;
}

html[data-theme="dark"] .orders-filter-bar {
  background: linear-gradient(180deg, #1e293b 0%, #172033 100%);
  border-color: #334155;
}

html[data-theme="dark"] .orders-filter-bar .form-control,
html[data-theme="dark"] .orders-filter-bar .form-select,
html[data-theme="dark"] .orders-filter-bar .input-group-text {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

html[data-theme="dark"] .orders-filter-bar .input-group-text {
  color: #94a3b8;
}

.chart-bars {
  height: 292px;
  display: grid;
  grid-template-columns: repeat(6, minmax(38px, 1fr));
  align-items: end;
  gap: 1rem;
  padding: 1.2rem 0.4rem 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.chart-column {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 0.6rem;
  color: var(--admin-muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
}

.chart-column span {
  width: 100%;
  height: var(--bar-size);
  min-height: 28px;
  display: block;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--admin-primary), var(--admin-success));
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.bar-42 {
  --bar-size: 42%;
}

.bar-58 {
  --bar-size: 58%;
}

.bar-51 {
  --bar-size: 51%;
}

.bar-72 {
  --bar-size: 72%;
}

.bar-66 {
  --bar-size: 66%;
}

.bar-83 {
  --bar-size: 83%;
}

.sales-performance-meta {
  margin-top: 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid var(--admin-border);
}

.sales-fund-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.sales-fund-empty,
.fund-type-empty-msg {
  grid-column: 1 / -1;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--admin-border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.fund-type-empty-msg {
  padding: 1rem;
}

.sales-fund-detail {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.sales-fund-detail:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

a.sales-fund-detail:focus-visible {
  outline: 2px solid var(--admin-primary);
  outline-offset: 2px;
}

.sales-fund-detail.is-today {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.sales-fund-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sales-fund-detail-head strong {
  font-size: 0.92rem;
}

.sales-fund-detail-rate {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.sales-fund-detail-pct {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--admin-primary);
}

@media (min-width: 992px) {
  .sales-fund-details {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.activity-list {
  display: grid;
  gap: 1.1rem;
  max-height: min(360px, 60vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.activity-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--admin-border);
}

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

.activity-dot {
  width: 12px;
  height: 12px;
  margin-top: 0.45rem;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.08);
}

.table {
  --bs-table-bg: transparent;
}

.table thead th {
  color: var(--admin-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody td {
  min-width: 120px;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.table tbody tr {
  transition: background 0.16s ease;
}

.table tbody tr:hover {
  background: #f8fbff;
}

.badge {
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
}

.table-search {
  width: min(260px, 100%);
  border-color: var(--admin-border);
  border-radius: 8px;
}

.table-media {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.product-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--admin-border);
  cursor: pointer;
}

.proof-modal-img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.proof-modal-pdf {
  width: 100%;
  min-height: 70vh;
  border: 0;
}

.order-list-proof-btn {
  white-space: nowrap;
}

.profile-avatar-lg {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  font-size: 1.5rem;
}

.profile-hero {
  display: grid;
  justify-items: center;
}

.profile-card {
  overflow: hidden;
}

.profile-cover {
  margin: -1.35rem -1.35rem 0.9rem;
  height: 96px;
  border-bottom: 1px solid var(--admin-border);
}

.profile-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.profile-photo {
  margin-top: -44px;
  border: 4px solid var(--admin-surface);
  box-shadow: var(--admin-shadow-sm);
}

.info-list,
.settings-list,
.legend-list {
  display: grid;
  gap: 0.85rem;
}

.info-list div,
.mini-card,
.settings-row,
.legend-list div {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface-soft);
}

.info-list div,
.legend-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
}

.info-list span,
.mini-card span,
.settings-row small {
  color: var(--admin-muted);
  font-size: 0.84rem;
}

.info-list strong,
.mini-card strong {
  text-align: right;
}

.mini-card {
  display: grid;
  gap: 0.35rem;
  min-height: 104px;
  align-content: center;
  padding: 1rem;
}

.mini-card strong {
  color: var(--admin-text);
  font-size: 1.05rem;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
}

.settings-row span {
  display: grid;
  gap: 0.2rem;
}

.donut-chart {
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--admin-primary) 0 42%, var(--admin-success) 42% 68%, var(--admin-warning) 68% 86%, var(--admin-danger) 86% 100%);
  box-shadow: var(--admin-shadow-sm);
}

.donut-chart span {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: var(--admin-text);
  font-size: 1.65rem;
  font-weight: 800;
}

.legend-list div {
  padding: 0.75rem 0.85rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.legend-list strong {
  margin-left: auto;
}

.progress {
  height: 1.15rem;
  border-radius: 8px;
  background: #e8eef6;
}

.progress-bar {
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
}

.progress-42 {
  width: 42%;
}

.progress-58 {
  width: 58%;
}

.progress-72 {
  width: 72%;
}

.blank-panel {
  min-height: 440px;
  display: grid;
  place-items: center;
  text-align: center;
}

.blank-state {
  max-width: 440px;
  display: grid;
  justify-items: center;
}

.blank-visual {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin-bottom: 0.9rem;
}

.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fbff 0%, #eaf2ff 44%, #eef8f6 100%);
}

.auth-page,
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card,
.error-card {
  width: min(100%, 460px);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--admin-shadow-lg);
}

.auth-card {
  padding: 1.5rem;
}

.auth-visual {
  margin-bottom: 1rem;
  height: 96px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  overflow: hidden;
}

.auth-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.error-card {
  padding: 2rem;
  text-align: center;
}

.error-illustration {
  width: min(260px, 100%);
  max-height: 132px;
  object-fit: contain;
  margin: 0 auto 0.55rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--admin-text);
}

.auth-brand:hover,
.auth-brand:focus {
  color: var(--admin-text);
}

.auth-brand span:last-child {
  display: grid;
  line-height: 1.2;
}

.auth-brand small,
.auth-footer {
  color: var(--admin-muted);
}

.auth-footer {
  margin-top: 1.2rem;
  text-align: center;
  font-size: 0.92rem;
}

.password-toggle-group .password-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  padding-inline: 0.65rem;
  border-color: var(--admin-border);
  color: var(--admin-muted);
  background: var(--admin-surface);
}

.password-toggle-group .password-toggle-btn:hover,
.password-toggle-group .password-toggle-btn:focus {
  border-color: #bfdbfe;
  color: var(--admin-primary);
  background: var(--admin-surface);
}

.password-toggle-group .form-control:focus + .password-toggle-btn {
  border-color: #86b7fe;
}

.error-code {
  color: var(--admin-primary);
  font-size: clamp(5rem, 18vw, 8rem);
  font-weight: 800;
  line-height: 1;
}

.admin-footer {
  padding: 1.1rem 0 1.35rem;
  color: var(--admin-muted);
  font-size: 0.9rem;
}

.admin-footer .container-fluid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 992px) {
  body.sidebar-mini .admin-sidebar {
    width: var(--sidebar-mini-width);
  }

  body.sidebar-mini .admin-main {
    margin-left: var(--sidebar-mini-width);
  }

  body.sidebar-mini .brand-copy,
  body.sidebar-mini .nav-text,
  body.sidebar-mini .sidebar-footer-text,
  body.sidebar-mini .sidebar-user strong,
  body.sidebar-mini .sidebar-user small,
  body.sidebar-mini .sidebar-user-link-text {
    width: 0;
    opacity: 0;
    overflow: hidden;
  }

  body.sidebar-mini .sidebar-user-menu {
    margin-top: 0.35rem;
    padding-top: 0;
    border-top: 0;
  }

  body.sidebar-mini .sidebar-user-link {
    justify-content: center;
    padding-inline: 0.5rem;
  }

  body.sidebar-mini .sidebar-header,
  body.sidebar-mini .sidebar-footer {
    margin-inline: 1rem;
    padding-inline: 0;
  }

  body.sidebar-mini .sidebar-nav .nav-link {
    justify-content: center;
    padding-inline: 0.65rem;
  }

  body.sidebar-mini .sidebar-nav .nav-link:hover,
  body.sidebar-mini .sidebar-nav .nav-link:focus {
    transform: none;
  }
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    width: min(var(--sidebar-width), calc(100vw - 48px));
    transform: translateX(-100%);
  }

  .admin-main {
    margin-left: 0;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
}

@media (max-width: 575.98px) {
  .page-heading,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-actions {
    width: 100%;
    justify-content: stretch;
  }

  .heading-actions .btn {
    flex: 1 1 0;
  }

  .chart-bars {
    height: 220px;
    gap: 0.6rem;
    padding-inline: 0.25rem;
  }

  .metric-value {
    font-size: 1.85rem;
  }

  .metric-card,
  .panel {
    padding: 1.1rem;
  }

  .admin-footer .container-fluid {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-nav .nav-link,
  .sidebar-toggle,
  .icon-button,
  .profile-button,
  .btn,
  .metric-card,
  .panel,
  .table tbody tr {
    transition: none;
  }

  .sidebar-nav .nav-link:hover,
  .sidebar-nav .nav-link:focus,
  .btn:hover,
  .btn:focus,
  .metric-card:hover {
    transform: none;
  }
}

html[data-theme="dark"] {
  --admin-bg: #0f172a;
  --admin-surface: #182235;
  --admin-surface-soft: #111827;
  --admin-border: #2f3b52;
  --admin-text: #e5edf7;
  --admin-muted: #9aa8bd;
  --admin-primary: #60a5fa;
  --admin-primary-dark: #3b82f6;
  --admin-success: #2dd4bf;
  --admin-warning: #fbbf24;
  --admin-danger: #f87171;
  --admin-sidebar: #090f1d;
  --admin-sidebar-soft: #172033;
  --admin-shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.24);
  --admin-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
  --admin-shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.42);
  --admin-ring: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

html[data-theme="dark"] body {
  background: linear-gradient(180deg, #111827 0%, var(--admin-bg) 48%, #0b1120 100%);
}

.brand-icon {
  font-size: 1.1rem;
}

.nav-icon {
  font-size: 0.95rem;
}

.theme-toggle i {
  font-size: 1rem;
}

.admin-navbar.bg-white,
.sidebar-toggle,
.icon-button,
.profile-button {
  background-color: var(--admin-surface) !important;
  color: var(--admin-text);
}

html[data-theme="dark"] .admin-navbar.bg-white {
  background-color: rgba(24, 34, 53, 0.92) !important;
}

html[data-theme="dark"] .profile-avatar {
  background: #1e3a5f;
  color: #bfdbfe;
}

.page-heading-copy {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  min-width: 0;
}

.page-icon,
.section-title i {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--admin-primary-dark);
}

.page-icon {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.section-title i {
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
}

html[data-theme="dark"] .page-icon,
html[data-theme="dark"] .section-title i {
  background: #1e3a5f;
  color: #bfdbfe;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-light {
  border-color: var(--admin-border);
  background: var(--admin-surface-soft);
  color: var(--admin-text);
}

.btn-outline-secondary {
  border-color: var(--admin-border);
  color: var(--admin-text);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  border-color: var(--admin-primary);
  background: #eaf2ff;
  color: var(--admin-primary-dark);
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-secondary:focus {
  background: #1e3a5f;
  color: #bfdbfe;
}

html[data-theme="dark"] .chart-bars {
  background: linear-gradient(180deg, #111827 0%, #182235 100%);
}

html[data-theme="dark"] .sales-performance-meta,
html[data-theme="dark"] .sales-fund-detail {
  background: linear-gradient(180deg, #111827 0%, #182235 100%);
}

html[data-theme="dark"] .sales-fund-detail.is-today {
  background: linear-gradient(180deg, #14532d 0%, #182235 100%);
  border-color: #166534;
}

html[data-theme="dark"] .table tbody tr:hover {
  background: #111827;
}

html[data-theme="dark"] .progress {
  background: #243149;
}

html[data-theme="dark"] .auth-body {
  background: linear-gradient(135deg, #0b1120 0%, #111827 48%, #10201f 100%);
}

.auth-card,
.error-card {
  background: var(--admin-surface);
}

.auth-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

.dropdown-menu,
.modal-content,
.accordion-item,
.accordion-button {
  border-color: var(--admin-border);
  background-color: var(--admin-surface);
  color: var(--admin-text);
}

.dropdown-item,
.accordion-body {
  color: var(--admin-text);
}

.dropdown-item:hover,
.dropdown-item:focus,
.accordion-button:not(.collapsed) {
  background-color: var(--admin-surface-soft);
  color: var(--admin-text);
}

.form-control,
.form-select {
  border-color: var(--admin-border);
  background-color: var(--admin-surface);
  color: var(--admin-text);
}

.form-control:focus,
.form-select:focus {
  border-color: #93c5fd;
  background-color: var(--admin-surface);
  color: var(--admin-text);
  box-shadow: var(--admin-ring);
}

.form-control::placeholder {
  color: var(--admin-muted);
}

.username-input,
.input-group > .form-control.username-input {
  text-transform: none;
  font-variant-numeric: lining-nums;
  line-height: 1.5;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.input-group > .form-control.username-input {
  min-height: calc(1.5em + 0.75rem + 2px);
}

.text-muted {
  color: var(--admin-muted) !important;
}

html[data-theme="dark"] .text-body {
  color: var(--admin-text) !important;
}

html[data-theme="dark"] .text-bg-secondary {
  background-color: #334155 !important;
  color: #e5edf7 !important;
}

@media (max-width: 767.98px) {
  .navbar-actions {
    gap: 0.5rem;
  }

  .icon-button,
  .sidebar-toggle {
    width: 40px;
    height: 40px;
  }

  .profile-button {
    width: auto;
    min-width: 40px;
    height: 40px;
    padding: 0.3rem;
  }

  .page-heading-copy {
    align-items: flex-start;
  }
}

@media (max-width: 575.98px) {
  .page-heading-copy {
    width: 100%;
  }

  .page-icon {
    width: 44px;
    height: 44px;
  }

  .panel-header .d-flex,
  .panel-header .form-control,
  .panel-header .form-select {
    width: 80%;
  }

  .panel-header .orders-filter-bar,
  .panel-header .orders-filter-bar .form-control,
  .panel-header .orders-filter-bar .form-select,
  .panel-header .orders-filter-bar .input-group,
  .panel-header .trade-history-toolbar,
  .panel-header .trade-history-toolbar .form-control,
  .panel-header .trade-history-toolbar .input-group {
    width: auto;
  }

  .orders-filter-bar,
  .trade-history-toolbar.orders-filter-bar {
    flex-wrap: wrap;
    width: 100%;
    padding: 0.5rem;
  }

  .orders-filter-bar .orders-filter-control,
  .orders-filter-bar .orders-filter-date,
  .orders-filter-bar .orders-filter-search,
  .orders-filter-bar .orders-filter-status,
  .trade-history-toolbar .orders-filter-search {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 100%;
  }

  .trade-history-toolbar .orders-filter-download {
    width: auto;
    flex: 0 0 auto;
    align-self: flex-end;
  }

  .transaction-filter .input-group {
    max-width: 220px;
    width: 100%;
  }
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body,
.admin-navbar,
.admin-sidebar,
.admin-main,
.metric-card,
.panel,
.auth-card,
.error-card,
.dropdown-menu,
.modal-content,
.form-control,
.form-select {
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.table {
  --bs-table-color: var(--admin-text);
  --bs-table-border-color: var(--admin-border);
  color: var(--admin-text);
}

.page-link {
  border-color: var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-text);
}

.page-link:hover,
.page-link:focus {
  border-color: var(--admin-primary);
  background: var(--admin-surface-soft);
  color: var(--admin-primary);
}

.page-item.active .page-link {
  border-color: var(--admin-primary);
  background: var(--admin-primary);
  color: #ffffff;
}

.page-item.disabled .page-link {
  border-color: var(--admin-border);
  background: var(--admin-surface-soft);
  color: var(--admin-muted);
}

.alert {
  border-radius: 8px;
}

html[data-theme="dark"] .alert-primary {
  border-color: #1d4ed8;
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
}

html[data-theme="dark"] .alert-success {
  border-color: #0f766e;
  background: rgba(15, 118, 110, 0.18);
  color: #99f6e4;
}

html[data-theme="dark"] .alert-warning {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.18);
  color: #fde68a;
}

html[data-theme="dark"] .alert-danger {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.16);
  color: #fecaca;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .accordion-item {
  border-color: var(--admin-border);
}

html[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(180%);
}

html[data-theme="dark"] .text-bg-info {
  background-color: #0e7490 !important;
  color: #ecfeff !important;
}

html[data-theme="dark"] .text-bg-warning {
  background-color: #b45309 !important;
  color: #fff7ed !important;
}

html[data-theme="dark"] .text-bg-success {
  background-color: #0f766e !important;
  color: #ecfdf5 !important;
}

html[data-theme="dark"] .text-bg-danger {
  background-color: #b91c1c !important;
  color: #fef2f2 !important;
}

@media (max-width: 991.98px) {
  .dashboard-content > .container-fluid {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }

  .admin-sidebar {
    box-shadow: 18px 0 48px rgba(0, 0, 0, 0.28);
  }
}

@media (max-width: 767.98px) {
  .panel-header {
    align-items: flex-start;
  }

  .panel-header > .d-flex {
    width: 100%;
  }

  .table-search {
    width: 100%;
  }

  .trade-history-toolbar .table-search {
    width: auto;
  }

  .auth-page,
  .error-page {
    padding: 1rem;
  }

  .auth-card,
  .error-card {
    padding: 1.15rem;
  }
}

@media (max-width: 420px) {
  .heading-actions {
    width: 100%;
  }

  .heading-actions .btn {
    width: 100%;
  }

  .metric-card {
    min-height: 146px;
  }

  .profile-avatar-lg {
    width: 76px;
    height: 76px;
  }
}

@media (max-width: 575.98px) {
  .avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .avatar-xl {
    width: 70px;
    height: 70px;
  }

  .profile-cover {
    height: 82px;
    margin-bottom: 0.75rem;
  }

  .profile-photo {
    margin-top: -38px;
  }

  .auth-visual {
    height: 82px;
  }

  .product-thumb {
    width: 36px;
    height: 36px;
  }
}

html:not([data-theme="dark"]) {
  --admin-sidebar: #ffffff;
  --admin-sidebar-soft: #eef4ff;
  --admin-sidebar-border: #dbe4ef;
  --admin-sidebar-text: #475569;
  --admin-sidebar-text-strong: #0f172a;
  --admin-sidebar-muted: #64748b;
  --admin-sidebar-icon-bg: #eaf2ff;
  --admin-sidebar-icon: #2563eb;
  --admin-sidebar-shadow: 18px 0 42px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] {
  --admin-sidebar-border: rgba(255, 255, 255, 0.08);
  --admin-sidebar-text: #d1d5db;
  --admin-sidebar-text-strong: #ffffff;
  --admin-sidebar-muted: #9ca3af;
  --admin-sidebar-icon-bg: rgba(255, 255, 255, 0.08);
  --admin-sidebar-icon: #bfdbfe;
  --admin-sidebar-shadow: 18px 0 42px rgba(0, 0, 0, 0.34);
}

.admin-sidebar {
  border-right: 1px solid var(--admin-sidebar-border);
  background: var(--admin-sidebar);
  color: var(--admin-sidebar-text-strong);
  box-shadow: var(--admin-sidebar-shadow);
}

.sidebar-header {
  border-bottom-color: var(--admin-sidebar-border);
}

.brand-mark,
.brand-mark:hover,
.brand-mark:focus {
  color: var(--admin-sidebar-text-strong);
}

.brand-subtitle {
  color: var(--admin-sidebar-muted);
}

.sidebar-nav .nav-link {
  color: var(--admin-sidebar-text);
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus,
.sidebar-nav .nav-link.active {
  background: var(--admin-sidebar-soft);
  color: var(--admin-sidebar-text-strong);
}

.nav-icon {
  background: var(--admin-sidebar-icon-bg);
  color: var(--admin-sidebar-icon);
}

.sidebar-footer {
  border-top-color: var(--admin-sidebar-border);
  color: var(--admin-sidebar-text);
}

/* Trading page */
.trading-panel {
  position: relative;
  overflow: hidden;
  text-align: center;
}

.trading-panel-compact .trade-timer-wrap {
  margin-top: 1.25rem;
  padding: 1rem 0.85rem;
  border-radius: 1rem;
}

.trading-panel-compact .trade-time-segment {
  min-width: 4.5rem;
  padding: 0.45rem 0.35rem;
  border-radius: 0.75rem;
}

.trading-panel-compact .trade-time-value {
  font-size: clamp(1.65rem, 5vw, 2.15rem);
}

.trading-panel-compact .trade-time-colon {
  font-size: 1.5rem;
  margin-bottom: 0.85rem;
}

.fund-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.fund-type-option {
  margin: 0;
  cursor: pointer;
}

.fund-type-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fund-type-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.1rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fund-type-option:hover .fund-type-card {
  border-color: rgba(37, 99, 235, 0.35);
}

.fund-type-input:checked + .fund-type-card {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
  background: linear-gradient(145deg, #ffffff 0%, #f3f8ff 100%);
}

.fund-type-input:focus-visible + .fund-type-card {
  outline: 2px solid var(--admin-primary);
  outline-offset: 2px;
}

.fund-type-input:disabled + .fund-type-card {
  opacity: 0.72;
  cursor: not-allowed;
}

.fund-type-check {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.1rem;
  height: 1.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--admin-border);
  color: transparent;
  font-size: 0.7rem;
  background: var(--admin-surface-soft);
}

.fund-type-input:checked + .fund-type-card .fund-type-check {
  border-color: var(--admin-primary);
  background: var(--admin-primary);
  color: #ffffff;
}

.fund-type-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  text-align: center;
  padding-inline: 0.15rem;
}

.fund-type-copy strong {
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--admin-text);
}

.fund-type-copy small {
  font-size: 0.72rem;
  color: var(--admin-muted);
  white-space: nowrap;
}

.fund-type-markup-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  margin-top: 0.1rem;
}

.fund-type-markup-line .fund-markup-pct {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--admin-primary);
}

.fund-type-markup-line .fund-markup-pct.is-up {
  color: #0f766e;
}

.fund-type-markup-line .fund-markup-pct.is-down {
  color: #dc2626;
}

.fund-type-markup-line .fund-markup-suffix {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--admin-muted);
}

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

@media (max-width: 575.98px) {
  .fund-type-grid {
    grid-template-columns: 1fr;
  }

  .fund-type-card {
    min-height: auto;
    justify-content: flex-start;
    padding-inline: 0.85rem;
  }

  .fund-type-copy {
    align-items: flex-start;
    text-align: left;
  }
}

.trading-panel::before {
  content: "";
  position: absolute;
  inset: -40% auto auto 50%;
  width: 420px;
  height: 420px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.14) 0%, transparent 68%);
  pointer-events: none;
}

.security-deposit-nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.28);
  color: #b91c1c;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

a.security-deposit-nav-badge:hover {
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(220, 38, 38, 0.4);
  color: #b91c1c;
}

.security-deposit-nav-badge--deposited {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}

a.security-deposit-nav-badge--deposited:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.45);
  color: #047857;
}

.security-deposit-nav-check {
  margin-left: 0.15rem;
  font-size: 1rem;
  color: #10b981;
}

.security-deposit-withdraw-tooltip .tooltip-inner {
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

.security-deposit-withdraw-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  border-color: rgba(13, 110, 253, 0.25);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98) 0%, rgba(219, 234, 254, 0.92) 100%);
  color: #1e3a8a;
  font-size: 0.9rem;
  line-height: 1.5;
}

html[data-theme="dark"] .security-deposit-withdraw-notice {
  border-color: rgba(96, 165, 250, 0.35);
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.45) 0%, rgba(30, 64, 175, 0.35) 100%);
  color: #dbeafe;
}

.security-deposit-tier-card {
  position: relative;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--admin-border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.security-deposit-tier-card--active {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
  background: rgba(15, 118, 110, 0.04);
}

.security-deposit-tier-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(15, 118, 110, 0.12);
  color: var(--admin-success);
}

.security-deposit-tier-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  padding-right: 5.5rem;
}

.security-deposit-tier-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--admin-primary);
  font-size: 1.1rem;
}

.security-deposit-tier-card--active .security-deposit-tier-icon {
  background: rgba(15, 118, 110, 0.12);
  color: var(--admin-success);
}

.security-deposit-tier-desc {
  font-size: 0.92rem;
  line-height: 1.55;
}

.security-deposit-tier-points li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--admin-text);
  margin-bottom: 0.4rem;
}

.security-deposit-tier-points li i {
  color: var(--admin-muted);
  margin-top: 0.15rem;
}

.trading-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--admin-surface-soft);
  border: 1px solid var(--admin-border);
  color: var(--admin-muted);
  text-decoration: none;
}

a.trading-status-badge:hover {
  color: var(--admin-muted);
  border-color: var(--admin-border);
}

.trading-status-badge[data-state="active"] {
  background: rgba(15, 118, 110, 0.1);
  border-color: rgba(15, 118, 110, 0.28);
  color: var(--admin-success);
}

.trading-status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--admin-muted);
}

.trading-status-badge[data-state="active"] .trading-status-dot {
  background: var(--admin-success);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.2);
  animation: trade-pulse 1.4s ease-in-out infinite;
}

.trading-nav-active-alert {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #0f766e;
  background: rgba(25, 135, 84, 0.14);
  border: 1px solid rgba(25, 135, 84, 0.35);
}

.trading-nav-active-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #198754;
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.22);
  animation: trade-pulse 1.4s ease-in-out infinite;
}

.sidebar-nav .nav-link.trading-nav-link--active-trade {
  background: rgba(25, 135, 84, 0.08);
}

.sidebar-nav .nav-link.trading-nav-link--active-trade .nav-icon {
  color: #198754;
}

@keyframes trade-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.15);
    opacity: 0.75;
  }
}

.trade-kill-pending-alert {
  margin-top: 1.25rem;
  position: relative;
}

.trade-kill-pending-alert.trade-kill-pending-alert--active {
  z-index: 1060;
}

.trade-kill-pending-alert.d-none {
  display: none !important;
}

.trade-kill-pending-alert--reveal .trade-kill-pending-alert-inner {
  animation: trade-kill-pending-alert-enter 0.45s ease-out, trade-kill-pending-alert-glow 2.4s ease-in-out 0.45s infinite;
}

.trade-kill-pending-alert-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.98) 0%, rgba(254, 243, 199, 0.92) 48%, rgba(255, 247, 237, 0.98) 100%);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.14);
}

.trade-kill-pending-alert--active .trade-kill-pending-alert-inner {
  animation: trade-kill-pending-alert-glow 2.4s ease-in-out infinite;
}

.trade-kill-pending-alert-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #92400e;
  letter-spacing: 0.01em;
}

.trade-kill-pending-alert-message {
  font-size: 0.875rem;
  line-height: 1.65;
  color: #78350f;
}

.trade-kill-pending-alert-em {
  color: #c2410c;
  font-weight: 800;
}

html[data-theme="dark"] .trade-kill-pending-alert-em {
  color: #fbbf24;
}

@keyframes trade-kill-pending-alert-enter {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes trade-kill-pending-alert-glow {
  0%,
  100% {
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.45);
  }

  50% {
    box-shadow: 0 14px 34px rgba(245, 158, 11, 0.24);
    border-color: rgba(234, 88, 12, 0.55);
  }
}

html[data-theme="dark"] .trade-kill-pending-alert-inner {
  border-color: rgba(251, 191, 36, 0.35);
  background: linear-gradient(135deg, rgba(69, 26, 3, 0.92) 0%, rgba(120, 53, 15, 0.88) 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .trade-kill-pending-alert-title {
  color: #fde68a;
}

html[data-theme="dark"] .trade-kill-pending-alert-message {
  color: #fef3c7;
}

.trade-timer-wrap {
  margin-top: 1.5rem;
  padding: 1.25rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(145deg, #f8fbff 0%, #eef4ff 55%, #f5f7fb 100%);
  border: 1px solid var(--admin-border);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.trade-timer-wrap.is-running {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.12);
}

.trade-timer-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--admin-muted);
  font-weight: 700;
}

.trade-timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.trade-time-segment {
  min-width: 5.5rem;
  padding: 0.65rem 0.5rem;
  border-radius: 0.9rem;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
}

.trade-timer-wrap.is-running .trade-time-segment {
  border-color: rgba(37, 99, 235, 0.22);
}

.trade-time-value {
  display: block;
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--admin-text);
  letter-spacing: 0.04em;
}

.trade-timer-wrap.is-running .trade-time-value {
  color: var(--admin-primary);
}

.trade-time-unit {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--admin-muted);
  font-weight: 600;
}

.trade-time-colon {
  font-size: 2rem;
  font-weight: 700;
  color: var(--admin-primary);
  line-height: 1;
  margin-bottom: 1.1rem;
}

.trading-form-block {
  text-align: left;
  max-width: 42rem;
  margin-inline: auto;
}

.trading-method-actions {
  display: flex;
  gap: 0.5rem;
}

.payment-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.5rem;
}

.payment-method-option {
  margin: 0;
  cursor: pointer;
}

.payment-method-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-method-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 100%;
  padding: 0.65rem 0.7rem;
  border-radius: 0.8rem;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.payment-method-option:hover .payment-method-card {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.payment-method-input:checked + .payment-method-card {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: linear-gradient(145deg, #ffffff 0%, #f3f8ff 100%);
}

.payment-method-input:focus-visible + .payment-method-card {
  outline: 2px solid var(--admin-primary);
  outline-offset: 2px;
}

.payment-method-input:disabled + .payment-method-card {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.payment-method-check {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--admin-border);
  color: transparent;
  font-size: 0.85rem;
  background: var(--admin-surface-soft);
}

.payment-method-input:checked + .payment-method-card .payment-method-check {
  border-color: var(--admin-primary);
  background: var(--admin-primary);
  color: #ffffff;
}

.payment-method-icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 0.6rem;
  background: var(--admin-sidebar-icon-bg, #eaf2ff);
  color: var(--admin-primary);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.payment-method-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  min-width: 0;
  text-align: left;
}

.payment-method-copy strong {
  font-size: 0.92rem;
  color: var(--admin-text);
}

.payment-method-copy small {
  color: var(--admin-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.selected-methods-summary {
  text-align: left;
  max-width: 100%;
  margin-inline: auto;
}

.selected-method-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.selected-method-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--admin-surface-soft);
  border: 1px solid var(--admin-border);
  font-size: 0.82rem;
  color: var(--admin-text);
}

.selected-method-chip .bi {
  color: var(--admin-primary);
}

.start-confirm-block {
  text-align: left;
}

.start-confirm-fund {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.75rem;
  background: var(--admin-surface-soft);
  border: 1px solid var(--admin-border);
}

.start-confirm-fund strong {
  font-size: 0.95rem;
}

.start-confirm-fund .start-confirm-fund-rate {
  font-size: 0.82rem;
  color: var(--admin-text-muted, #6c757d);
  margin: 0;
}

.start-confirm-fund .start-confirm-fund-rate .bi {
  font-size: 0.78rem;
}

.start-confirm-fund .start-confirm-fund-markup {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--admin-primary);
  margin: 0;
}

.start-confirm-method-chips {
  justify-content: flex-start;
}

.trade-history-toolbar.orders-filter-bar {
  flex-wrap: nowrap;
}

.panel-header .trade-history-toolbar,
.panel-header .trade-history-toolbar .input-group,
.panel-header .trade-history-toolbar .form-control {
  width: auto;
}

.trade-history-toolbar .trade-history-search {
  width: 11rem;
  min-width: 9rem;
}

.trade-history-toolbar .table-search {
  width: auto;
}

html[data-theme="dark"] .trade-history-toolbar.orders-filter-bar {
  background: linear-gradient(180deg, #1e293b 0%, #172033 100%);
  border-color: #334155;
}

.trade-history-fund-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.trade-history-fund-rate {
  display: block;
  font-size: 0.78rem;
  color: var(--admin-text-muted, #6c757d);
  font-weight: 500;
  line-height: 1.3;
}

.trade-history-fund-rate .bi {
  font-size: 0.72rem;
}

.trade-history-row-active {
  background: rgba(var(--admin-primary-rgb, 13, 110, 253), 0.06);
}

.trade-history-row-active td {
  border-color: rgba(var(--admin-primary-rgb, 13, 110, 253), 0.12);
}

.trade-history-kill-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.trade-history-kill-processing {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--admin-primary);
}

.trade-history-kill-processing .bi {
  font-size: 0.9rem;
  animation: trade-processing-spin 1.1s linear infinite;
}

.trade-history-kill-completed {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bs-success, #198754);
}

.trade-history-kill-completed-time {
  font-size: 0.75rem;
  color: var(--bs-secondary-color, #6c757d);
}

@keyframes trade-processing-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.trade-history-empty td {
  border-bottom: 0;
}

.trading-actions {
  max-width: 42rem;
  margin-inline: auto;
}

html[data-theme="dark"] .payment-method-input:checked + .payment-method-card,
html[data-theme="dark"] .fund-type-input:checked + .fund-type-card {
  background: linear-gradient(145deg, #1f2937 0%, #111827 100%);
}

html[data-theme="dark"] .trade-timer-wrap {
  background: linear-gradient(145deg, #1f2937 0%, #111827 100%);
}

html[data-theme="dark"] .trade-time-segment {
  background: #0f172a;
}

.user-detail-panel {
  overflow: hidden;
}

.user-detail-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-surface-soft);
}

.user-detail-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--admin-border);
  flex-shrink: 0;
}

.user-detail-profile-copy {
  min-width: 0;
}

.user-detail-profile-copy strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.3;
}

.user-detail-profile-copy span {
  display: block;
  font-size: 0.72rem;
  color: var(--admin-muted);
}

.user-detail-section {
  padding: 0.75rem 1rem 0;
  border-bottom: 1px solid var(--admin-border);
}

.user-detail-advanced-wrap {
  padding-top: 0;
  padding-bottom: 0;
}

.user-detail-advanced-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--admin-border);
  background: transparent;
  color: var(--admin-text);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.user-detail-advanced-toggle:hover,
.user-detail-advanced-toggle:focus-visible {
  background: var(--admin-surface-soft);
  outline: none;
}

.user-detail-advanced-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--admin-text);
}

.user-detail-advanced-toggle-hint {
  flex: 1;
  font-size: 0.68rem;
  font-weight: 500;
}

.user-detail-advanced-chevron {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--admin-muted);
  transition: transform 0.2s ease;
}

.user-detail-advanced-toggle:not(.collapsed) .user-detail-advanced-chevron {
  transform: rotate(180deg);
}

.user-detail-advanced-body {
  padding: 0.25rem 0 0.5rem;
}

.user-detail-subsection {
  padding: 0.65rem 1rem 0;
}

.user-detail-subsection-last .user-detail-bio {
  margin-bottom: 0.5rem;
}

.user-detail-section-title {
  margin: 0 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--admin-muted);
}

.user-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 0.5rem;
  padding-bottom: 0.75rem;
}

.user-detail-item {
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--admin-border);
  border-radius: 0.45rem;
  background: var(--admin-surface-soft);
  min-width: 0;
}

.user-detail-item span {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--admin-muted);
  margin-bottom: 0.1rem;
}

.user-detail-item strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.user-detail-wallet-rate {
  font-size: 0.78rem;
  line-height: 1.4;
}

.user-detail-wallet-add {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
  padding: 0.55rem;
  border: 1px solid var(--admin-border);
  border-radius: 0.45rem;
  background: var(--admin-surface-soft);
}

.user-detail-wallet-preview {
  padding: 0.5rem 0.65rem;
  border: 1px dashed var(--admin-border);
  border-radius: 0.45rem;
  background: var(--admin-surface-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.user-detail-bio {
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--admin-border);
  border-radius: 0.45rem;
  background: var(--admin-surface-soft);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--admin-text);
}

.user-detail-tx-table {
  border: 1px solid var(--admin-border);
  border-radius: 0.45rem;
  overflow: hidden;
}

.user-detail-tx-table .table {
  font-size: 0.78rem;
  margin-bottom: 0;
}

.user-detail-tx-table th {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Compact transaction history (admin + dashboard) */
.tx-history-compact.panel {
  padding: 0.65rem 0.75rem;
}

.tx-history-compact .panel-header {
  margin-bottom: 0.45rem;
  padding: 0;
}

.tx-history-compact .panel-header .row {
  --bs-gutter-x: 0.4rem;
  --bs-gutter-y: 0.35rem;
}

.tx-history-compact .section-title {
  font-size: 0.95rem;
  margin-bottom: 0.15rem !important;
}

.tx-history-compact .panel-header p.text-muted {
  font-size: 0.72rem;
  line-height: 1.3;
}

.tx-history-compact table.table {
  font-size: 0.74rem;
  margin-bottom: 0;
}

.tx-history-compact table.table > :not(caption) > * > * {
  padding: 0.32rem 0.45rem;
  vertical-align: middle;
}

.tx-history-compact table.table thead th {
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.tx-history-compact .tx-cell-main {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
}

.tx-history-compact .tx-cell-sub {
  font-size: 0.67rem;
  line-height: 1.15;
  margin-top: 0.05rem;
}

.tx-history-compact table.table code {
  font-size: 0.67rem;
  padding: 0.1em 0.3em;
}

.tx-history-compact .badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.18em 0.42em;
  line-height: 1.2;
}

.tx-history-compact .btn-compact {
  padding: 0.12rem 0.32rem;
  font-size: 0.68rem;
  line-height: 1;
}

.tx-history-compact .btn-compact .bi {
  font-size: 0.72rem;
}

.tx-history-compact .tx-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.tx-history-compact .tx-empty td {
  padding: 0.65rem !important;
  font-size: 0.78rem;
}

.tx-history-compact .transaction-filter .input-group,
.tx-history-compact .transaction-filter .form-select {
  max-width: 11rem;
}

.tx-history-compact .transaction-filter .tx-filter-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 0 auto;
}

.tx-history-compact .transaction-filter .tx-filter-download .bi {
  font-size: 0.9rem;
}

/* Deposit details (admin, deposit-requests) */
.deposit-details-panel {
  padding: 0.65rem 0.75rem 0.75rem;
}

.deposit-details-panel-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin: 0 0 0.55rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--admin-text);
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease;
}

.deposit-details-panel-toggle:hover,
.deposit-details-panel-toggle:focus-visible {
  outline: none;
  color: var(--admin-text);
}

.deposit-details-panel.is-collapsed .deposit-details-panel-toggle {
  margin-bottom: 0;
}

.deposit-details-panel-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.deposit-details-panel-toggle-title {
  font-size: 0.95rem;
  margin-bottom: 0 !important;
}

.deposit-details-panel-toggle-desc {
  font-size: 0.72rem;
  line-height: 1.3;
}

.deposit-details-panel-chevron {
  flex-shrink: 0;
  margin-top: 0.15rem;
  font-size: 0.9rem;
  color: var(--admin-muted);
  transition: transform 0.2s ease;
}

.deposit-details-panel:not(.is-collapsed) .deposit-details-panel-chevron {
  transform: rotate(180deg);
}

.deposit-details-body {
  margin-top: 0.55rem;
}

.deposit-details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (max-width: 991.98px) {
  .deposit-details-grid {
    grid-template-columns: 1fr;
  }
}

.deposit-detail-card {
  border: 1px solid var(--admin-border, #dee2e6);
  border-radius: 10px;
  background: var(--admin-surface, #fff);
  padding: 0.55rem 0.6rem 0.5rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.deposit-detail-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.deposit-detail-card-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

.deposit-detail-active-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: 2.1rem;
}

.deposit-detail-active-switch .form-check-input {
  width: 2rem;
  height: 1rem;
  margin-left: -2.1rem;
  cursor: pointer;
}

.deposit-detail-active-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--admin-muted);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.deposit-detail-card.is-active .deposit-detail-active-label {
  color: var(--bs-success, #198754);
}

.deposit-detail-card.is-inactive {
  opacity: 0.72;
}

.deposit-detail-card.is-inactive .deposit-detail-active-label {
  color: var(--bs-secondary, #6c757d);
}

.deposit-detail-card.is-saving {
  opacity: 0.55;
  pointer-events: none;
}

.deposit-detail-card-icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.85rem;
  padding: 0;
}

.deposit-detail-card-titles {
  flex: 1;
  min-width: 0;
}

.deposit-detail-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.deposit-detail-card-method {
  font-size: 0.62rem;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.deposit-detail-fields {
  flex: 1;
  border-top: 1px dashed var(--admin-border, #dee2e6);
  padding-top: 0.35rem;
  margin-bottom: 0.35rem !important;
}

.deposit-detail-field {
  padding: 0.28rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.deposit-detail-field:last-child {
  border-bottom: 0;
}

.deposit-detail-field-empty {
  font-size: 0.67rem;
  padding: 0.2rem 0;
}

.deposit-detail-field-copy {
  min-width: 0;
  flex: 1;
}

.deposit-detail-field-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--admin-muted);
  line-height: 1.2;
}

.deposit-detail-field-value {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.25;
  word-break: break-word;
}

/* USDT (Tether) — Bootstrap Icons has no USDT glyph; bi-usdt overrides [class^="bi-"] font */
.bi.bi-usdt,
i.bi-usdt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  vertical-align: middle;
}

.bi.bi-usdt::before,
i.bi.bi-usdt::before,
.bi-usdt::before {
  font-family: inherit !important;
  font-style: normal !important;
  font-weight: normal !important;
  font-variant: normal !important;
  text-transform: none !important;
  line-height: 1 !important;
  speak: none;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  content: "" !important;
  display: inline-block !important;
  width: 1.125em;
  height: 1.125em;
  min-width: 1.125em;
  min-height: 1.125em;
  vertical-align: middle;
  background: transparent url("../images/icons/usdt.svg") center / contain no-repeat !important;
  -webkit-mask: none !important;
  mask: none !important;
}

.deposit-detail-card-icon .bi.bi-usdt::before,
.add-funds-option-icon .bi.bi-usdt::before {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  min-height: 1.35rem;
}

.deposit-detail-qr-thumb {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border: 1px solid var(--admin-border, #dee2e6);
  border-radius: 10px;
  background: #fff;
  display: block;
}

.deposit-qr-preview-btn,
.add-funds-qr-preview-btn {
  cursor: zoom-in;
  border-radius: 10px;
  line-height: 0;
}

.deposit-qr-preview-btn:focus-visible,
.add-funds-qr-preview-btn:focus-visible {
  outline: 2px solid var(--admin-accent, #0d6efd);
  outline-offset: 2px;
}

.deposit-detail-field-qr {
  padding-top: 0.15rem;
  border-bottom: 0;
}

.deposit-detail-usdt-qr .deposit-detail-qr-preview {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.deposit-detail-usdt-qr .deposit-detail-qr-preview .deposit-detail-qr-thumb {
  width: 120px;
  height: 120px;
}

.deposit-detail-modal-fields {
  margin-top: 0;
}

.add-funds-qr-thumb {
  width: 110px;
  height: 110px;
  object-fit: contain;
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 10px;
  background: #fff;
}

.add-funds-qr-modal-img {
  max-height: min(80vh, 520px);
  width: auto;
  object-fit: contain;
}

.deposit-detail-modal-field .form-label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

#depositDetailModal .modal-body {
  max-height: min(75vh, 36rem);
}

/* Deposit requests (admin) */
.deposit-requests-panel {
  padding: 0.65rem 0.75rem;
}

.deposit-requests-panel .panel-header {
  margin-bottom: 0.45rem;
  padding: 0;
}

.deposit-requests-panel .section-title {
  font-size: 0.95rem;
  margin-bottom: 0.15rem !important;
}

.deposit-requests-panel .panel-header p.text-muted {
  font-size: 0.72rem;
  line-height: 1.3;
}

.deposit-requests-filter.orders-filter-bar {
  flex-wrap: wrap;
}

.deposit-live-rate-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45em 0.65em;
}

.deposit-requests-table table.table {
  font-size: 0.74rem;
  margin-bottom: 0;
}

.deposit-requests-table table.table > :not(caption) > * > * {
  padding: 0.38rem 0.45rem;
  vertical-align: middle;
}

.deposit-requests-table table.table thead th {
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.deposit-requests-table .dr-cell-main {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
}

.deposit-requests-table .dr-cell-sub {
  font-size: 0.67rem;
  line-height: 1.15;
  color: var(--admin-muted);
  margin-top: 0.05rem;
}

.deposit-requests-table .dr-method-badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.2em 0.45em;
}

.deposit-requests-table .dr-ref-code {
  font-size: 0.67rem;
  padding: 0.1em 0.3em;
  display: inline-block;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.deposit-proof-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--admin-border);
  display: block;
}

.deposit-proof-thumb-btn:focus-visible .deposit-proof-thumb {
  outline: 2px solid var(--admin-accent, #0d6efd);
  outline-offset: 2px;
}

.deposit-requests-table .dr-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.deposit-requests-table .deposit-empty-row td {
  padding: 0.65rem !important;
  font-size: 0.78rem;
}

.deposit-approve-summary dd {
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .deposit-requests-table .dr-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .deposit-requests-table .dr-actions .btn {
    width: 100%;
  }
}

.live-traders-table .lt-trader-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.live-traders-table .lt-cell-main {
  font-weight: 600;
  line-height: 1.3;
}

.live-traders-table .lt-meta {
  font-size: 0.8rem;
  line-height: 1.25;
  margin-top: 0.15rem;
  color: var(--admin-muted);
}

.live-traders-table .lt-fund-rate {
  font-weight: 600;
  color: var(--admin-primary);
}

.live-traders-table .lt-started-main {
  white-space: nowrap;
}

.live-traders-table .lt-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.live-traders-table table.table > :not(caption) > * > * {
  padding: 0.55rem 0.65rem;
}

.live-traders-dash-compact.panel {
  padding: 0.65rem 0.75rem;
}

.live-traders-dash-compact .panel-header {
  margin-bottom: 0.4rem;
  padding: 0;
}

.live-traders-dash-compact .section-title {
  font-size: 0.95rem;
}

.live-traders-dash-compact .section-title .badge {
  font-size: 0.62rem;
  font-weight: 600;
  vertical-align: middle;
}

.live-traders-dash-compact table.table {
  font-size: 0.74rem;
}

.live-traders-dash-compact.live-traders-table table.table > :not(caption) > * > * {
  padding: 0.32rem 0.45rem;
}

.live-traders-dash-compact table.table thead th {
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.live-traders-dash-compact .lt-trader-name {
  font-size: 0.74rem;
}

.live-traders-dash-compact .lt-cell-main {
  font-size: 0.74rem;
}

.live-traders-dash-compact .lt-meta {
  font-size: 0.67rem;
  margin-top: 0.05rem;
}

.live-traders-dash-compact .badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.18em 0.42em;
  line-height: 1.2;
}

.live-traders-dash-compact .lt-empty td {
  padding: 0.65rem !important;
  font-size: 0.78rem;
}

.live-trade-detail-meta {
  display: grid;
  gap: 0.4rem 0.85rem;
  grid-template-columns: auto 1fr;
  font-size: 0.875rem;
  margin-bottom: 0.85rem;
}

.live-trade-detail-meta dt {
  margin: 0;
  color: var(--admin-muted);
  font-weight: 500;
}

.live-trade-detail-meta dd {
  margin: 0;
  font-weight: 600;
}

.live-trade-payment-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.live-trade-payment-item {
  border: 1px solid var(--admin-border);
  border-radius: 0.45rem;
  padding: 0.55rem 0.7rem;
  background: var(--admin-surface-soft);
  font-size: 0.875rem;
}

.live-trade-payment-item-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.live-trade-payment-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4rem;
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
  flex-shrink: 0;
}

.live-trade-payment-item-head strong {
  display: block;
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.3;
}

.live-trade-head-action {
  flex-shrink: 0;
  margin-left: auto;
}

.live-trade-payment-fields {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.live-trade-payment-field {
  display: grid;
  gap: 0.2rem;
}

.live-trade-payment-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--admin-muted);
}

.live-trade-payment-field-value {
  display: block;
}

.live-trade-payment-field-text {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.live-trade-copy-btn,
.live-trade-download-btn {
  padding: 0.2rem 0.55rem;
  line-height: 1.2;
  white-space: nowrap;
}

.live-trade-payment-qr {
  margin-top: 0.35rem;
}

.live-trade-payment-qr img {
  max-width: 160px;
  height: auto;
}

.tx-history-compact .user-detail-section-title {
  font-size: 0.82rem;
}

.user-detail-sidebar .form-label {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.user-detail-sidebar .form-check-label {
  font-size: 0.78rem;
}

.user-detail-sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Add funds */
.add-funds-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.add-funds-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--admin-border);
  border-radius: 0.75rem;
  background: var(--admin-surface);
  color: var(--admin-text);
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.add-funds-option:hover {
  border-color: var(--admin-primary);
  background: var(--admin-sidebar-soft);
}

.add-funds-option.is-active {
  border-color: var(--admin-primary);
  background: var(--admin-sidebar-soft);
  box-shadow: var(--admin-shadow-sm);
}

.add-funds-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: var(--admin-sidebar-icon-bg);
  color: var(--admin-primary);
  flex-shrink: 0;
}

.add-funds-option-copy {
  flex: 1;
  min-width: 0;
}

.add-funds-option-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
}

.add-funds-option-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--admin-muted);
}

.add-funds-option-chevron {
  color: var(--admin-muted);
  flex-shrink: 0;
}

.add-funds-fields {
  margin: 0;
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--admin-sidebar-soft);
  border: 1px solid var(--admin-border);
}

.add-funds-field-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--admin-border);
}

.add-funds-field-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.add-funds-field-row dt {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--admin-muted);
}

.add-funds-field-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.add-funds-upload-col {
  min-width: 0;
}

.add-funds-proof-preview {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 0.75rem;
  overflow: hidden;
}

.add-funds-proof-preview[hidden] {
  display: none !important;
}

.add-funds-proof-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  max-height: min(220px, 42vw);
  padding: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--admin-border);
  background: var(--admin-sidebar-soft);
  overflow: hidden;
}

.add-funds-proof-preview .add-funds-proof-thumb {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(200px, 40vw);
  object-fit: contain;
  object-position: center;
  border-radius: 0.35rem;
}

.add-funds-proof-preview .add-funds-proof-filename {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--admin-muted);
  word-break: break-all;
}

.add-funds-submit-form {
  padding-top: 0.25rem;
  border-top: 1px solid var(--admin-border);
}

.add-funds-detail-panel,
.add-funds-detail {
  min-width: 0;
  overflow-x: hidden;
}

@media (max-width: 991.98px) {
  .add-funds-field-row dd {
    text-align: left;
    width: 100%;
  }

  .add-funds-proof-frame {
    max-height: min(180px, 50vw);
  }

  .add-funds-proof-preview .add-funds-proof-thumb {
    max-height: min(160px, 48vw);
  }
}

/* Orders history — compact trade column */
.orders-history-table {
  font-size: 0.875rem;
}

.orders-history-table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.order-trade-cell {
  min-width: 9.5rem;
  max-width: 14rem;
  line-height: 1.35;
}

.order-trade-name {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--admin-text, #212529);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-trade-amounts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.35rem;
  font-size: 0.75rem;
}

.order-trade-usdt {
  font-weight: 600;
  color: var(--admin-primary, #0d6efd);
}

.order-trade-inr {
  font-weight: 800;
  color: var(--admin-success, #198754);
}

.order-trade-sep {
  color: var(--admin-muted, #6c757d);
  font-size: 0.7rem;
}

.order-trade-rate {
  font-size: 0.6875rem;
  color: var(--admin-muted, #6c757d);
  margin-top: 0.1rem;
  white-space: nowrap;
}

.orders-history-table > :not(caption) > * > * {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

/* Orders history — action dropdown must escape table scroll clip */
.orders-history-panel .table-responsive {
  overflow: visible;
}

.orders-history-panel .orders-history-table td:last-child,
.orders-history-panel .orders-history-table th:last-child {
  position: relative;
}

.orders-history-panel .dropdown-menu {
  z-index: 1050;
}

@media (max-width: 767.98px) {
  .orders-history-panel .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Dashboard — Today Profit per trade session (compact table) */
.today-profit-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.today-profit-card .metric-top {
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}

.today-profit-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

@media (min-width: 768px) {
  .today-profit-body {
    flex-direction: row;
    align-items: stretch;
    gap: 1rem;
  }

  .today-profit-table-wrap {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
  }

  .today-profit-footer {
    flex: 0 0 auto;
    align-self: flex-end;
    margin-top: 0;
    padding-top: 0;
  }
}

.today-profit-table-wrap {
  overflow-x: hidden;
  overflow-y: visible;
  max-height: none;
}

/* Scroll only when more than 3 fund rows (class toggled in PHP/JS) */
.today-profit-table-wrap.is-scrollable {
  --today-profit-head-height: 1.2rem;
  --today-profit-row-height: 1.52rem;
  max-height: calc(
    var(--today-profit-head-height) + (var(--today-profit-row-height) * 3)
  );
  overflow-y: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.1rem;
}

.today-profit-table-wrap.is-scrollable::-webkit-scrollbar {
  width: 6px;
}

.today-profit-table-wrap.is-scrollable::-webkit-scrollbar-track {
  background: transparent;
}

.today-profit-table-wrap.is-scrollable::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 4px;
}

html[data-theme="dark"] .today-profit-table-wrap.is-scrollable::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
}

.today-profit-empty {
  font-size: 0.8125rem;
  margin: 0;
}

.today-profit-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.75rem;
  table-layout: auto;
}

.today-profit-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0 0.35rem 0.3rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-muted, #6c757d);
  background: var(--admin-surface, #fff);
  border-bottom: 1px solid var(--admin-border, #dee2e6);
  white-space: nowrap;
}

.today-profit-table tbody td {
  padding: 0.32rem 0.35rem;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

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

.today-profit-row.is-active {
  background: rgba(25, 135, 84, 0.07);
}

.today-profit-td-name {
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--admin-text, #212529);
}

.today-profit-td-rate {
  color: var(--admin-muted, #6c757d);
  font-size: 0.6875rem;
}

.today-profit-td-pct {
  font-weight: 600;
  font-size: 0.6875rem;
}

.today-profit-td-profit {
  font-weight: 800;
  font-size: 0.75rem;
}

.today-profit-td-profit.text-success {
  color: #198754 !important;
}

.today-profit-footer {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 0.15rem;
}

.today-profit-total-wrap {
  text-align: right;
  line-height: 1.25;
}

.today-profit-total-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-muted, #6c757d);
  margin-bottom: 0.1rem;
}

.today-profit-total-value {
  display: block;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.2;
}

.today-profit-total-value.text-success {
  color: #198754 !important;
}

.today-profit-total-usdt {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  margin-top: 0.1rem;
}

/* Admin Add / Edit Order form */
.admin-order-form-panel {
  max-width: 920px;
}

.admin-order-form-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--admin-border);
}

.admin-order-form-panel__head-copy {
  flex: 1;
  min-width: 0;
}

.admin-order-form-panel__header .section-title {
  font-size: 1rem;
  margin-bottom: 0.25rem !important;
}

.admin-order-form-panel__header p.text-muted {
  font-size: 0.8125rem;
  line-height: 1.45;
}

.admin-order-form-live-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.45em 0.75em;
  flex-shrink: 0;
}

.admin-order-form__body {
  padding-top: 1rem;
}

.admin-order-form__section + .admin-order-form__section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--admin-border);
}

.admin-order-form__section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--admin-muted, #64748b);
  margin-bottom: 0.75rem;
}

.admin-order-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-order-meta-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--admin-border);
  border-radius: 0.625rem;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  min-width: 0;
}

.admin-order-meta-card--field {
  background: #fff;
}

.admin-order-meta-card__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--admin-muted, #64748b);
}

.admin-order-meta-card__value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--admin-text, #0f172a);
  line-height: 1.3;
  word-break: break-word;
}

.admin-order-meta-card__value--code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  color: #0d6efd;
}

.admin-order-meta-card .form-control,
.admin-order-meta-card .form-select,
.admin-order-meta-card .input-group-text {
  border-color: #cbd5e1;
}

.input-no-spin {
  -moz-appearance: textfield;
  appearance: textfield;
}

.input-no-spin::-webkit-outer-spin-button,
.input-no-spin::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.admin-order-proof-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 1rem;
  align-items: start;
}

.admin-order-proof-upload .form-label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.admin-order-proof-preview {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border: 1px dashed var(--admin-border);
  border-radius: 0.625rem;
  background: #f8fafc;
}

.admin-order-proof-preview__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  color: var(--admin-muted, #64748b);
  font-size: 0.75rem;
}

.admin-order-proof-preview__empty .bi {
  font-size: 1.35rem;
  opacity: 0.55;
}

.admin-order-proof-preview__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.order-receipt-thumb {
  width: 100%;
  max-width: 140px;
  height: auto;
  max-height: 120px;
  border-radius: 0.5rem;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--admin-border, #dee2e6);
}

.admin-order-form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--admin-border);
}

html[data-theme="dark"] .admin-order-meta-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.55) 0%, rgba(15, 23, 42, 0.35) 100%);
}

html[data-theme="dark"] .admin-order-meta-card--field {
  background: rgba(15, 23, 42, 0.35);
}

html[data-theme="dark"] .admin-order-proof-preview {
  background: rgba(15, 23, 42, 0.35);
}

.admin-delete-order-summary {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: 0.625rem;
  background: rgba(248, 250, 252, 0.9);
}

.admin-delete-order-summary__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-delete-order-summary__row + .admin-delete-order-summary__row {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.45);
}

.admin-delete-order-summary dt {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--admin-muted, #64748b);
}

.admin-delete-order-summary dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

html[data-theme="dark"] .admin-delete-order-summary {
  background: rgba(30, 41, 59, 0.55);
}

@media (max-width: 991.98px) {
  .admin-order-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .admin-order-meta-grid {
    grid-template-columns: 1fr;
  }

  .admin-order-proof-grid {
    grid-template-columns: 1fr;
  }

  .admin-order-proof-preview {
    min-height: 100px;
  }
}
