:root {
  --bg: #1a1a1d;
  --bg-soft: #212127;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --text: #f5f7ff;
  --muted: #a8aec3;
  --accent: #26e0a7;
  --accent-2: #41b2ff;
  --danger: #ff6d8a;
  --radius: 18px;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  background: radial-gradient(1200px 700px at 10% -10%, #2a2a38 0%, transparent 55%),
    radial-gradient(900px 600px at 95% 10%, #2b2338 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, p {
  margin: 0;
}

.dashboard {
  width: min(1200px, 92%);
  margin: 30px auto 40px;
  position: relative;
  z-index: 2;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.main-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.nav-brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-tab {
  text-decoration: none;
  color: var(--text);
  font-size: 0.82rem;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
}

.nav-tab.active,
.nav-tab:hover {
  border-color: rgba(65, 178, 255, 0.6);
  background: linear-gradient(135deg, rgba(38,224,167,0.2), rgba(65,178,255,0.22));
}

.category-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.category-bar p {
  color: var(--muted);
  font-size: 0.84rem;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

.chip.active {
  color: var(--text);
  border-color: rgba(38,224,167,0.55);
}

.focus-banner {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(38, 224, 167, 0.35);
  background: rgba(38, 224, 167, 0.1);
  color: var(--muted);
  font-size: 0.78rem;
}

.focus-badge {
  color: var(--text);
  font-weight: 700;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  margin-bottom: 20px;
  animation: rise 0.6s ease both;
}

.kicker {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.topbar h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.06);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.action-btn {
  border: 0;
  color: #051018;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
}

.logout-btn {
  color: #fff5f8;
  background: linear-gradient(135deg, #ff6d8a, #ff8f63);
}

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

.metric-card {
  padding: 18px;
  animation: rise 0.65s ease both;
}

.metric-card p {
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 10px;
}

.metric-card h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  margin-bottom: 8px;
}

.up, .down {
  font-size: 0.82rem;
}
.up { color: var(--accent); }
.down { color: var(--danger); }

.opportunities-card {
  padding: 14px;
  margin-bottom: 14px;
  animation: rise 0.7s ease both;
}

.opportunities-subtitle {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.opportunity-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.opportunity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.86rem;
}

.score-badge {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.75rem;
  color: #d7f9ee;
  border: 1px solid rgba(38, 224, 167, 0.4);
  background: rgba(38, 224, 167, 0.16);
  white-space: nowrap;
}

.opportunity-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.build-queue-card {
  padding: 14px;
  margin-bottom: 14px;
  animation: rise 0.72s ease both;
}

.build-queue-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.build-queue-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
}

.build-queue-main {
  min-width: 0;
}

.build-queue-title {
  font-size: 0.9rem;
  margin-bottom: 7px;
}

.build-queue-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reason-chip {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  color: #d8e9ff;
  background: rgba(65, 178, 255, 0.2);
  border: 1px solid rgba(65, 178, 255, 0.35);
}

.action-plan-card {
  padding: 14px;
  margin-bottom: 14px;
  animation: rise 0.74s ease both;
}

.action-plan-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.action-plan-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
}

.action-plan-main {
  min-width: 0;
}

.action-plan-title {
  font-size: 0.9rem;
  margin: 0 0 6px;
}

.action-plan-reason {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  margin: 0;
}

.copy-plan-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: saturate(0.75);
}

.traders-status-wrap {
  padding: 14px 16px;
  margin-bottom: 14px;
}

.live-copytrade-card {
  padding: 14px 16px;
  margin-bottom: 14px;
}

.traders-status-text {
  color: var(--muted);
  font-size: 0.9rem;
}

.traders-grid {
  display: grid;
  gap: 14px;
}

.trader-section-card {
  padding: 14px;
}

.trader-table-wrap {
  overflow-x: auto;
}

.trader-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.trader-table th,
.trader-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.83rem;
}

.trader-table th {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.wallet-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Space Grotesk", sans-serif;
}

.side-pill {
  display: inline-block;
  min-width: 44px;
  text-align: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  border: 1px solid transparent;
}

.side-buy {
  color: #d7f9ee;
  border-color: rgba(38, 224, 167, 0.5);
  background: rgba(38, 224, 167, 0.18);
}

.side-sell {
  color: #ffe4ea;
  border-color: rgba(255, 109, 138, 0.5);
  background: rgba(255, 109, 138, 0.2);
}

.traders-empty-row {
  color: var(--muted);
  text-align: center;
}

.tasks-wrap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.task-column {
  padding: 14px;
  min-height: 420px;
  animation: rise 0.7s ease both;
}

.column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.column-head h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.column-head span {
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 5px 9px;
  border-radius: 999px;
}

.task-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  padding: 12px;
  margin-bottom: 10px;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.task-card:hover {
  transform: translateY(-3px);
  border-color: rgba(65, 178, 255, 0.5);
  background: rgba(255, 255, 255, 0.07);
}

.task-card h4 {
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.task-card p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  margin-bottom: 10px;
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.75rem;
  color: #b9bfd1;
}

.done {
  border-color: rgba(38, 224, 167, 0.35);
}

.progress {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: pulse 2.8s ease-in-out infinite;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(45px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
}

.orb-a {
  width: 280px;
  height: 280px;
  background: #2dd4bf;
  top: -80px;
  left: -60px;
}

.orb-b {
  width: 260px;
  height: 260px;
  background: #5a7fff;
  right: -80px;
  top: 140px;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
  z-index: 0;
}

.login-shell {
  width: min(480px, 92%);
  margin: 10vh auto 0;
  position: relative;
  z-index: 2;
}

.login-card {
  padding: 24px;
}

.login-subtitle {
  color: var(--muted);
  margin-top: 8px;
  margin-bottom: 18px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  font-size: 0.85rem;
  color: #d4d8e8;
}

.login-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 11px;
  padding: 11px 12px;
  font: inherit;
}

.login-form input:focus {
  outline: none;
  border-color: rgba(65, 178, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(65, 178, 255, 0.18);
}

.login-status {
  min-height: 1.1rem;
  font-size: 0.82rem;
  color: #ffd4de;
}

.cron-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px;
  margin-bottom: 12px;
}

.cron-calendar-wrap {
  padding: 12px;
  margin-bottom: 12px;
}

.cron-weekdays,
.cron-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.cron-weekdays {
  margin-bottom: 8px;
}

.cron-weekdays span {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.cron-day {
  min-height: 92px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
}

.cron-day-active {
  border-color: rgba(38, 224, 167, 0.5);
  background: rgba(38, 224, 167, 0.1);
}

.cron-day-blank {
  background: rgba(255, 255, 255, 0.015);
  border-style: dashed;
}

.cron-day-num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.cron-day-jobs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cron-chip {
  font-size: 0.68rem;
  border-radius: 999px;
  padding: 2px 7px;
  border: 1px solid rgba(65, 178, 255, 0.38);
  background: rgba(65, 178, 255, 0.18);
  color: #dcecff;
}

.cron-list-wrap {
  padding: 12px;
}

.cron-week-board-wrap {
  padding: 12px;
  margin-bottom: 12px;
}

.cron-week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.cron-week-day {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 9, 15, 0.58);
  border-radius: 12px;
  padding: 8px;
  min-height: 260px;
}

.cron-week-day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.cron-week-day-head span {
  color: var(--muted);
  font-size: 0.72rem;
}

.cron-week-day-list {
  display: grid;
  gap: 7px;
}

.cron-week-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.cron-event {
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 7px 8px;
}

.cron-event-btn,
.cron-expand-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.cron-event-btn {
  padding: 0;
}

.cron-event-details,
.cron-details {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.25);
  display: grid;
  gap: 5px;
  font-size: 0.73rem;
  color: rgba(255, 255, 255, 0.88);
}

.cron-event.expanded,
.cron-list-item.expanded {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

.cron-event-title {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 2px;
  word-break: break-word;
}

.cron-event-time {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.68rem;
  margin-bottom: 2px;
}

.cron-event-expr {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.65rem;
  font-family: "Space Grotesk", sans-serif;
}

.cron-event-0 { background: rgba(255, 133, 52, 0.2); border-color: rgba(255, 133, 52, 0.45); }
.cron-event-1 { background: rgba(255, 77, 109, 0.2); border-color: rgba(255, 77, 109, 0.45); }
.cron-event-2 { background: rgba(0, 196, 140, 0.2); border-color: rgba(0, 196, 140, 0.45); }
.cron-event-3 { background: rgba(255, 186, 59, 0.2); border-color: rgba(255, 186, 59, 0.45); }
.cron-event-4 { background: rgba(106, 124, 255, 0.2); border-color: rgba(106, 124, 255, 0.45); }
.cron-event-5 { background: rgba(120, 120, 140, 0.2); border-color: rgba(140, 140, 160, 0.45); }

.cron-cmd {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-family: "Space Grotesk", sans-serif;
}

.cron-expand-btn {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.cron-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}

.copytrade-controls {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  max-width: 280px;
}

.copytrade-controls input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
}

.copytrade-command {
  white-space: pre-wrap;
  margin: 8px 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255,255,255,0.14);
  color: #d8e6ff;
  font-size: 0.8rem;
}

.live-wallet-card {
  margin-top: 12px;
}

.wallet-controls-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.wallet-kpis {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.wallet-send-card {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}

.pnl-chart-wrap {
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
  padding: 8px;
}

#wallet-pnl-chart {
  width: 100%;
  height: 180px;
  display: block;
}

.tradingview-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.tradingview-controls label {
  color: var(--muted);
  font-size: 0.82rem;
}

.tradingview-controls select {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 7px 10px;
  outline: none;
}

.tv-widget-host {
  min-height: 520px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(3, 8, 18, 0.5);
  overflow: hidden;
}

.tv-widget-host .tradingview-widget-container {
  width: 100%;
  height: 520px;
}

.tv-widget-host .tradingview-widget-container__widget,
.tv-widget-host iframe {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 780px) {
  .topbar {
    gap: 10px;
  }

  .topbar-right {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }

  .topbar-right .action-btn {
    flex: 1 1 auto;
    min-width: 140px;
  }

  .trader-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}

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

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

@media (max-width: 720px) {
  .dashboard {
    width: 94%;
    margin-top: 18px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .main-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .category-bar {
    flex-wrap: wrap;
  }

  .action-plan-card .column-head {
    flex-wrap: wrap;
    gap: 10px;
  }

  .metrics-grid,
  .tasks-wrap {
    grid-template-columns: 1fr;
  }

  .cron-week-board {
    grid-template-columns: 1fr;
  }

  .task-column {
    min-height: auto;
  }

  .tv-widget-host {
    min-height: 420px;
  }

  .tv-widget-host .tradingview-widget-container {
    height: 420px;
  }
}
