/* Portfolio Overview Page */

.portfolio-main {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Header */
.portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.portfolio-balance-label {
  font-size: 13px;
  color: #8a94a6;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.portfolio-balance-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.portfolio-balance-amount {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.portfolio-balance-change {
  font-size: 14px;
  font-weight: 600;
}

.portfolio-balance-change.positive { color: #22c55e; }
.portfolio-balance-change.negative { color: #ef4444; }

.change-period {
  color: #8a94a6;
  font-weight: 400;
  font-size: 12px;
}

.portfolio-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
  background: #5cb8e6;
  color: #0a0e17;
}

.btn-primary:hover {
  background: #4da8d6;
}

.btn-outline {
  background: transparent;
  color: #5cb8e6;
  border: 1px solid rgba(92,184,230,0.3);
}

.btn-outline:hover {
  border-color: #5cb8e6;
  background: rgba(92,184,230,0.08);
}

/* Overview Grid */
.portfolio-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* Card shared */
.card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
}

.card-body {
  padding: 20px;
}

/* Donut Chart - CSS only */
.donut-chart-container {
  display: flex;
  align-items: center;
  gap: 32px;
}

.donut-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(
    #f7931a 0deg 148.3deg,
    #627eea 148.3deg 232.9deg,
    #9945ff 232.9deg 275.4deg,
    #23292f 275.4deg 302.0deg,
    #26a17b 302.0deg 330.1deg,
    #2775ca 330.1deg 344.1deg,
    #e84142 344.1deg 353.8deg,
    #2a5ada 353.8deg 360deg
  );
  position: relative;
  flex-shrink: 0;
}

.donut-hole {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #111827;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-total-label {
  font-size: 11px;
  color: #8a94a6;
}

.donut-total-value {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cbd5e1;
}

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

.legend-pct {
  color: #8a94a6;
  margin-left: auto;
  min-width: 40px;
  text-align: right;
}

/* Stats card */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.stat-row:last-child { border-bottom: none; }

.stat-label {
  font-size: 13px;
  color: #8a94a6;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
}

.stat-value.positive { color: #22c55e; }
.stat-value.negative { color: #ef4444; }

/* Table shared */
.table-responsive {
  overflow-x: auto;
  padding: 0;
}

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

.data-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #8a94a6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 14px 16px;
  font-size: 14px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
}

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

.positive { color: #22c55e; }
.negative { color: #ef4444; }
.neutral { color: #8a94a6; }

/* Asset cell */
.asset-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.asset-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.asset-info {
  display: flex;
  flex-direction: column;
}

.asset-name {
  font-weight: 600;
  color: #e2e8f0;
  font-size: 14px;
}

.asset-ticker {
  font-size: 12px;
  color: #8a94a6;
}

/* Allocation bar */
.alloc-bar-wrap {
  width: 60px;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.alloc-bar {
  height: 100%;
  border-radius: 2px;
}

/* Action buttons in table */
.action-cell {
  display: flex;
  gap: 8px;
}

.table-action-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  background: #5cb8e6;
  color: #0a0e17;
  transition: background 0.15s;
}

.table-action-btn:hover {
  background: #4da8d6;
}

.table-action-btn.outline {
  background: transparent;
  color: #5cb8e6;
  border: 1px solid rgba(92,184,230,0.3);
}

.table-action-btn.outline:hover {
  border-color: #5cb8e6;
}

/* Transaction types */
.tx-type {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.tx-type.buy { background: rgba(34,197,94,0.15); color: #22c55e; }
.tx-type.sell { background: rgba(239,68,68,0.15); color: #ef4444; }
.tx-type.deposit { background: rgba(92,184,230,0.15); color: #5cb8e6; }
.tx-type.withdraw { background: rgba(251,191,36,0.15); color: #fbbf24; }
.tx-type.send { background: rgba(168,85,247,0.15); color: #a855f7; }
.tx-type.receive { background: rgba(34,197,94,0.15); color: #22c55e; }

.tx-status {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.tx-status.completed { background: rgba(34,197,94,0.15); color: #22c55e; }
.tx-status.pending { background: rgba(251,191,36,0.15); color: #fbbf24; }

/* Responsive */
@media (max-width: 900px) {
  .portfolio-overview-grid {
    grid-template-columns: 1fr;
  }
  .donut-chart-container {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .portfolio-main { padding: 16px; }
  .portfolio-balance-amount { font-size: 28px; }
  .portfolio-header { flex-direction: column; }
}
