/* Fx2Fund Admin Dashboard Styles — Dark Theme */

/* Match main site font size */
#dashboard-sidebar,
#dashboard-main {
  font-size: .875rem;
  line-height: 1.5;
}

#dashboard-main h3 { font-size: 1.15rem; color: #fff; }
#dashboard-main h4 { font-size: 1rem; color: #fff; }
#dashboard-main strong { font-weight: 600; color: #fff; }
#dashboard-main p { color: rgba(255,255,255,0.6); }

/* Sidebar — dark navy */
#dashboard-sidebar {
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  width: 240px;
  z-index: 100;
  overflow-y: auto;
  background: #0d1117;
  border-right: 1px solid rgba(255,255,255,0.06);
}

#dashboard-sidebar .uk-logo {
  display: block;
  padding: 20px 0;
}

#dashboard-sidebar .uk-nav > li > a {
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  margin: 2px 0;
  font-size: 0.85rem;
  transition: all 0.2s;
}

#dashboard-sidebar .uk-nav > li > a:hover {
  color: #FCB42D;
  background: rgba(252, 180, 45, 0.06);
}

#dashboard-sidebar .uk-nav > li.uk-active > a {
  color: #FCB42D;
  background: rgba(252, 180, 45, 0.12);
}

/* Gold pill-counter for the Approvals nav item — hidden when empty. */
#dashboard-sidebar .uk-nav .nav-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  min-width: 16px;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #0a0e17;
  background: linear-gradient(135deg, #FCB42D 0%, #f39c12 100%);
  border-radius: 10px;
  line-height: 1.5;
  box-shadow: 0 0 10px rgba(252,180,45,0.35);
  vertical-align: middle;
}

#dashboard-sidebar .uk-nav > li > a i {
  width: 20px;
  margin-right: 10px;
  text-align: center;
}

/* Main content area */
#dashboard-main {
  margin-left: 240px;
  min-height: 100vh;
  background: #0a0e17;
  color: rgba(255,255,255,0.7);
}

/* Top bar */
.dashboard-topbar {
  background: rgba(13,17,23,0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 15px 30px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.dashboard-topbar h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #fff;
}

/* Dashboard cards */
.dash-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 20px;
  transition: border-color 0.3s;
}

.dash-card:hover {
  border-color: rgba(255,255,255,0.1);
}

.dash-card .card-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.dash-card .card-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.dash-card .card-value.positive { color: #3BD297; }
.dash-card .card-value.negative { color: #e74c3c; }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.active { background: rgba(59,210,151,0.15); color: #3BD297; }
.status-badge.paused { background: rgba(243,156,18,0.15); color: #f39c12; }
.status-badge.stopped { background: rgba(231,76,60,0.15); color: #e74c3c; }
.status-badge.connected { background: rgba(59,210,151,0.15); color: #3BD297; }
.status-badge.disconnected { background: rgba(231,76,60,0.15); color: #e74c3c; }

/* Alert severity badges */
.alert-critical { background: rgba(231,76,60,0.2); color: #e74c3c; }
.alert-warning { background: rgba(243,156,18,0.2); color: #f39c12; }
.alert-info { background: rgba(52,152,219,0.2); color: #3498db; }

/* Tables */
.dash-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-table th {
  background: rgba(255,255,255,0.03);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dash-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
}

.dash-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.profit-positive { color: #3BD297; font-weight: 600; }
.profit-negative { color: #e74c3c; font-weight: 600; }

/* Loading spinner */
.dash-loading {
  text-align: center;
  padding: 60px;
  color: rgba(255,255,255,0.35);
}

.dash-loading .spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: #FCB42D;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.dash-empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255,255,255,0.3);
}

.dash-empty i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

/* Emergency button */
.emergency-btn {
  display: inline-block;
  padding: 14px 36px;
  background: rgba(231,76,60,0.2);
  color: #e74c3c;
  border: 1px solid rgba(231,76,60,0.3);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s;
}

.emergency-btn:hover {
  background: rgba(231,76,60,0.3);
  color: #fff;
}

/* Activity feed */
.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.82rem;
}

.feed-item:last-child {
  border-bottom: none;
}

.feed-item .feed-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}

.feed-item .feed-body {
  flex: 1;
  color: rgba(255,255,255,0.6);
}

.feed-item .feed-time {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
}

/* Label tags */
.label-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  margin: 1px 2px;
}

/* Admin action buttons */
.btn-sm {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.72rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-sm:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn-sm.btn-primary { background: rgba(52,152,219,0.2); color: #3498db; }
.btn-sm.btn-success { background: rgba(59,210,151,0.2); color: #3BD297; }
.btn-sm.btn-warning { background: rgba(243,156,18,0.2); color: #f39c12; }
.btn-sm.btn-danger { background: rgba(231,76,60,0.2); color: #e74c3c; }
.btn-sm.btn-secondary { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6); }

/* Search/filter bar */
.admin-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.admin-toolbar input,
.admin-toolbar select {
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 0.82rem;
  background: rgba(255,255,255,0.04);
  color: #fff;
}

.admin-toolbar input::placeholder { color: rgba(255,255,255,0.3); }

.admin-toolbar input:focus,
.admin-toolbar select:focus {
  outline: none;
  border-color: rgba(252,180,45,0.4);
}

/* Alert cards */
.alert-card {
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 4px solid rgba(255,255,255,0.1);
}

.alert-card.critical { border-left-color: #e74c3c; }
.alert-card.warning { border-left-color: #f39c12; }
.alert-card.info { border-left-color: #3498db; }

/* Responsive: mobile */
@media (max-width: 960px) {
  #dashboard-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  #dashboard-sidebar.show {
    transform: translateX(0);
  }

  #dashboard-main {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: inline-block !important;
  }
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: rgba(255,255,255,0.6);
  padding: 5px;
}

/* Notification toast */
.dash-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  z-index: 9999;
  animation: slideIn 0.3s ease;
}

.dash-toast.success { background: #3BD297; }
.dash-toast.error { background: #e74c3c; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Admin login page — already dark */
.admin-login-wrapper {
  min-height: 100vh;
  background: #0a0e17;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-login-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.admin-login-box h2 {
  color: #fff;
  margin: 0 0 6px 0;
  font-size: 1.4rem;
}

.admin-login-box .subtitle {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

.admin-login-box label {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.admin-login-box input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.admin-login-box input:focus {
  outline: none;
  border-color: #FCB42D;
}

.admin-login-box .login-btn {
  width: 100%;
  padding: 11px;
  background: #FCB42D;
  color: #0a0e17;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-login-box .login-btn:hover {
  background: #e5a228;
}

.admin-login-box .login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-login-box .login-error {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 14px;
  display: none;
  border: 1px solid rgba(231,76,60,0.2);
}

/* Color picker inline */
.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-picker-wrap input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: none;
}

/* Dash table wrapper */
.dash-table-wrap { overflow-x: auto; }

/* ─── Master Account Swap UI ──────────────────────────────── */

/* Master header card */
.master-header {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid #FCB42D;
  border-radius: 10px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.master-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.master-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(252,180,45,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #FCB42D;
  font-size: 1.1rem;
}

.master-header-info h3 {
  margin: 0;
  font-size: 1.25rem;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
}

.master-header-meta {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  margin-top: 3px;
}

.master-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.master-server-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
}

/* Pulsing live indicator */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3BD297;
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse-dot 2s ease-in-out infinite;
}

.live-dot.off {
  background: #e74c3c;
  animation: none;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(59,210,151,0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(59,210,151,0); }
}

/* Swap form card */
.swap-form-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid #FCB42D;
  border-radius: 10px;
  padding: 24px;
  margin-top: 20px;
}

.swap-form-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.swap-form-subtitle {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  margin: 4px 0 18px;
}

.swap-form-group {
  margin-bottom: 16px;
}

.swap-form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.swap-form-input,
.swap-form-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.swap-form-input::placeholder { color: rgba(255,255,255,0.25); }

.swap-form-input:focus,
.swap-form-select:focus {
  outline: none;
  border-color: rgba(252,180,45,0.5);
}

.swap-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Password toggle */
.password-wrap {
  position: relative;
}

.password-wrap .swap-form-input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.25);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  transition: color 0.2s;
}

.password-toggle:hover { color: rgba(255,255,255,0.6); }

/* Primary swap button */
.btn-swap {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: #FCB42D;
  color: #0a0e17;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-swap:hover { background: #e5a228; }
.btn-swap:disabled { opacity: 0.5; cursor: not-allowed; }

.spinner-inline {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10,14,23,0.2);
  border-top-color: #0a0e17;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* Warning banner */
.swap-warning {
  background: rgba(243,156,18,0.06);
  border: 1px solid rgba(243,156,18,0.12);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 20px;
  line-height: 1.5;
}

.swap-warning i { color: #f39c12; margin-right: 8px; }

/* Progress & confirmation modals (overlay) */
.swap-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.swap-overlay-card {
  background: #1a1e2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 32px;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  text-align: center;
}

.swap-overlay-card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: #fff;
}

.swap-overlay-card p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  margin: 0 0 20px;
}

.swap-overlay-card .spinner {
  margin: 0 auto 16px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Confirm summary rows */
.confirm-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.confirm-row:last-child { border-bottom: none; }
.confirm-label { color: rgba(255,255,255,0.4); }
.confirm-value { color: #fff; font-weight: 600; font-family: 'Courier New', monospace; }

/* Result card */
.swap-result {
  background: rgba(59,210,151,0.06);
  border: 1px solid rgba(59,210,151,0.15);
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
}

.swap-result.error {
  background: rgba(231,76,60,0.06);
  border-color: rgba(231,76,60,0.15);
}

.swap-result-title {
  font-size: 1rem;
  font-weight: 700;
  color: #3BD297;
  margin: 0 0 14px;
}

.swap-result.error .swap-result-title { color: #e74c3c; }

.swap-result-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.swap-result-row:last-child { border-bottom: none; }
.swap-result-label { color: rgba(255,255,255,0.4); }
.swap-result-value { color: #fff; font-weight: 600; }

/* Server search dropdown (admin) */
.server-search-wrap { position: relative; }
.server-search-input-wrap { position: relative; }
.server-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.3); font-size: 13px; pointer-events: none; z-index: 1; }
.server-search-wrap .swap-form-input { padding-left: 34px; padding-right: 80px; }
.server-search-count { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; color: rgba(255,255,255,0.3); pointer-events: none; }
.server-dropdown { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #141820; border: 1px solid rgba(255,255,255,0.1); border-top: none; border-radius: 0 0 10px 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.4); z-index: 100; max-height: 260px; overflow: hidden; }
.server-dropdown.open { display: block; }
.server-dropdown-status { padding: 14px 16px; color: rgba(255,255,255,0.4); font-size: 13px; text-align: center; }
.server-dropdown-status .spinner-sm { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.1); border-top-color: #FCB42D; border-radius: 50%; animation: spin .6s linear infinite; margin-right: 8px; vertical-align: middle; }
.server-dropdown-list { max-height: 220px; overflow-y: auto; }
.server-dropdown-item { padding: 10px 16px; cursor: pointer; font-size: 13px; color: rgba(255,255,255,0.7); border-bottom: 1px solid rgba(255,255,255,0.04); transition: background .15s; }
.server-dropdown-item:hover, .server-dropdown-item.active { background: rgba(252,180,45,0.1); color: #fff; }
.server-dropdown-item mark { background: #FCB42D; color: #0a0e17; border-radius: 2px; padding: 0 2px; font-weight: 600; }
.server-dropdown-item:last-child { border-bottom: none; }

/* ─── Advanced Analytics Metrics ──────────────────────────── */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; margin-bottom: 20px; }
.metric-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 14px 16px; }
.metric-label { font-size: 0.65rem; font-weight: 600; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.metric-value { font-size: 1.15rem; font-weight: 700; color: #fff; }
.metric-value.green { color: #3BD297; }
.metric-value.red { color: #e74c3c; }
.metric-value.gold { color: #FCB42D; }
.metric-value.blue { color: #3498db; }

/* ─── Contextual percentage chip (universal) ───────────────────────
   Single compact pill: "▲ 4.18% /day" or "▼ 0.14% of eq".
   Merged phrase stays on one line — never wraps. */
.metric-pct-wrap {
  display: flex; align-items: center; flex-wrap: wrap;
  margin-top: 5px; line-height: 1;
}
.metric-pct {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px;
  font-size: 0.62rem; font-weight: 700;
  border-radius: 9px; letter-spacing: 0.15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.metric-pct.pos {
  background: rgba(59,210,151,0.14); color: #3BD297;
  box-shadow: 0 0 0 1px rgba(59,210,151,0.18) inset;
}
.metric-pct.neg {
  background: rgba(231,76,60,0.14); color: #e74c3c;
  box-shadow: 0 0 0 1px rgba(231,76,60,0.18) inset;
}
.metric-pct.neu {
  background: rgba(148,163,184,0.14); color: #94a3b8;
  box-shadow: 0 0 0 1px rgba(148,163,184,0.18) inset;
}
.metric-pct.warn {
  background: rgba(252,180,45,0.16); color: #FCB42D;
  box-shadow: 0 0 0 1px rgba(252,180,45,0.22) inset;
}
.metric-pct.info {
  background: rgba(52,152,219,0.14); color: #3498db;
  box-shadow: 0 0 0 1px rgba(52,152,219,0.18) inset;
}
/* Legacy .metric-pct-base element — hidden so stale markup doesn't
   leak a second row below the merged pill. New code never emits it. */
.metric-pct-base { display: none; }
/* A touch larger for big top-row .dash-card KPIs */
.dash-card .card-value + .metric-pct-wrap { margin-top: 7px; }
.dash-card .metric-pct { padding: 2px 8px; font-size: 0.66rem; border-radius: 10px; }
/* Largest for hero cards (still tight) */
.bucket-hero-card .metric-pct-wrap { margin-top: 9px; }
.bucket-hero-card .metric-pct {
  padding: 3px 9px; font-size: 0.68rem;
  backdrop-filter: blur(6px);
}

.section-title { font-size: 0.72rem; font-weight: 700; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; margin: 24px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.06); }
.sym-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.sym-table th { padding: 8px 10px; text-align: left; font-size: 0.68rem; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sym-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.03); color: rgba(255,255,255,0.7); }
.sym-table tr:hover td { background: rgba(255,255,255,0.02); }

@media (max-width: 768px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .swap-form-row { grid-template-columns: 1fr; }
  .master-header { flex-direction: column; align-items: flex-start; }
}

/* ─── Period filter bar (admin overview) ────────────────────────────
   Identical to the client-dashboard period control. Same glass container,
   gold gradient on the active pill, glowing pill-dot, pulsing range chip. */
.period-bar {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 22px; flex-wrap: wrap;
}
.period-bar-label {
  font-size: 0.72rem; font-weight: 700;
  color: rgba(255,255,255,0.42);
  text-transform: uppercase; letter-spacing: 1.1px;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.period-bar-label i {
  color: #FCB42D; font-size: 0.88rem;
  filter: drop-shadow(0 0 6px rgba(252,180,45,0.45));
}
.period-tabs {
  display: inline-flex;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 5px;
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}
.period-tab {
  position: relative;
  padding: 10px 20px;
  font-size: 0.8rem; font-weight: 600;
  color: rgba(255,255,255,0.55);
  background: transparent; border: none;
  border-radius: 10px;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color 0.2s ease, background 0.25s ease,
              box-shadow 0.25s ease, transform 0.15s ease;
  letter-spacing: 0.3px; white-space: nowrap;
}
.period-tab:hover { color: rgba(255,255,255,0.95); }
.period-tab:active { transform: translateY(1px); }
.period-tab .period-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #FCB42D; color: #FCB42D;
  box-shadow: 0 0 6px currentColor;
  transition: box-shadow 0.25s ease, background 0.25s ease;
  flex-shrink: 0;
}
.period-tab.active {
  color: #0a0e17; font-weight: 700;
  background: linear-gradient(135deg, #FCB42D 0%, #f39c12 100%);
  box-shadow: 0 6px 18px rgba(252,180,45,0.28),
              0 1px 2px rgba(252,180,45,0.4);
}
.period-tab.active .period-dot {
  background: #0a0e17; color: #0a0e17; box-shadow: none;
}
.period-range {
  font-size: 0.76rem; color: rgba(255,255,255,0.55);
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 11px;
  margin-left: auto;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
  font-weight: 600; letter-spacing: 0.3px;
}
.period-range .period-range-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #FCB42D;
  box-shadow: 0 0 8px #FCB42D, 0 0 16px rgba(252,180,45,0.3);
  animation: periodRangeDotPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes periodRangeDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.25); }
}
.period-tab .period-tab-short { display: none; }

@media (max-width: 900px) {
  .period-tab { padding: 9px 16px; font-size: 0.76rem; gap: 7px; }
}
@media (max-width: 640px) {
  .period-bar { gap: 10px; }
  .period-bar-label { display: none; }
  .period-range {
    margin-left: 0; width: 100%;
    justify-content: center; font-size: 0.72rem;
  }
  .period-tabs { padding: 4px; border-radius: 12px; }
  .period-tab {
    padding: 8px 12px; font-size: 0.72rem; gap: 6px;
    border-radius: 9px;
  }
  .period-tab .period-dot { width: 6px; height: 6px; }
  .period-tab .period-tab-full  { display: none; }
  .period-tab .period-tab-short { display: inline; }
}

/* ─── Symbol Breakdown Table ─────────────────────────────────────── */
.sym-name-cell { min-width: 90px; }
.sym-name {
  font-weight: 700;
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
}
.sym-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
  white-space: nowrap;
}
.sym-sortable i {
  font-size: 0.55rem;
  margin-left: 3px;
  opacity: 0.35;
  transition: opacity 0.15s, color 0.15s;
  vertical-align: middle;
}
.sym-sortable:hover { color: rgba(255,255,255,0.65); }
.sym-sortable:hover i { opacity: 0.7; }
.sym-sort-active { color: #FCB42D !important; }
.sym-sort-active i { opacity: 1 !important; color: #FCB42D; }
.sym-table tr { transition: background 0.12s; }
.sym-table tr:hover td { background: rgba(255,255,255,0.025); }
.sym-table td { font-family: 'SF Mono', Consolas, monospace; font-size: 0.78rem; }
@media (max-width: 768px) {
  .sym-hide-sm { display: none; }
}
@media (max-width: 600px) {
  .sym-hide-xs { display: none; }
  .sym-table td, .sym-table th { padding: 6px 7px; font-size: 0.72rem; }
}

/* ─── Aggregated Open Positions ──────────────────────────────────── */
.pos-summary { display: flex; flex-direction: column; gap: 6px; }
.pos-group {
  background: linear-gradient(145deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.pos-group:hover { border-color: rgba(255,255,255,0.1); }
.pos-group-head {
  display: grid;
  grid-template-columns: 120px 1fr 1fr 1fr 1fr auto;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  gap: 8px;
  user-select: none;
  transition: background 0.15s;
}
.pos-group-head:hover { background: rgba(255,255,255,0.02); }
.pos-group-symbol {
  font-weight: 700;
  font-size: 0.84rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pos-group-symbol .pos-count {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.45);
}
.pos-group-metric {
  text-align: right;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.7);
  font-family: 'SF Mono', Consolas, monospace;
}
.pos-group-metric small {
  display: block;
  font-size: 0.58rem;
  color: rgba(255,255,255,0.28);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: 'Archivo', sans-serif;
  margin-bottom: 1px;
}
.pos-group-chevron {
  color: rgba(255,255,255,0.2);
  font-size: 0.7rem;
  transition: transform 0.2s;
  width: 18px;
  text-align: center;
}
.pos-group.open .pos-group-chevron { transform: rotate(90deg); }
.pos-group-detail {
  display: none;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.pos-group.open .pos-group-detail { display: block; }
.pos-group-detail table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
}
.pos-group-detail th {
  padding: 6px 10px;
  text-align: left;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(0,0,0,0.15);
}
.pos-group-detail td {
  padding: 6px 10px;
  color: rgba(255,255,255,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.02);
}
.pos-group-detail tr:hover td { background: rgba(255,255,255,0.015); }

.pos-empty {
  text-align: center;
  padding: 28px 16px;
  color: rgba(255,255,255,0.3);
  font-size: 0.85rem;
}
.pos-empty i { margin-right: 8px; color: #3BD297; }

@media (max-width: 900px) {
  .pos-group-head {
    grid-template-columns: 100px 1fr 1fr auto;
  }
  .pos-group-head .pos-hide-sm { display: none; }
}
@media (max-width: 600px) {
  .pos-group-head {
    grid-template-columns: 1fr 1fr auto;
    gap: 4px;
    padding: 10px 12px;
  }
  .pos-group-head .pos-hide-xs { display: none; }
}
