.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
  color: #e0e6ed;
}

.header {
  background: linear-gradient(90deg, #1a2f4a 0%, #0a1628 100%);
  padding: 20px 30px;
  border-bottom: 2px solid #2a5f8f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.navigation {
  background: rgba(26, 47, 74, 0.5);
  border-bottom: 1px solid #2a3a52;
  padding: 0 30px;
}

.nav-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-tab {
  background: none;
  border: none;
  color: #8892a8;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #5fb3f5;
  background: rgba(95, 179, 245, 0.05);
}

.nav-tab.active {
  color: #5fb3f5;
  border-bottom-color: #5fb3f5;
  background: rgba(95, 179, 245, 0.08);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 28px;
  margin-bottom: 5px;
  color: #5fb3f5;
}

.header p {
  font-size: 14px;
  color: #8892a8;
}

.character-info {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(95, 179, 245, 0.1);
  padding: 10px 15px;
  border-radius: 6px;
  border: 1px solid rgba(95, 179, 245, 0.3);
  color: #5fb3f5;
  font-size: 13px;
}

.login-btn {
  background: linear-gradient(135deg, #2a7f4a 0%, #1a5f3a 100%);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
}

.login-btn:hover {
  background: linear-gradient(135deg, #3a8f5a 0%, #2a6f4a 100%);
  transform: translateY(-2px);
}

.logout-btn {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

.scan-progress {
  color: #5fb3f5;
  font-size: 12px;
  margin-left: 15px;
  font-style: italic;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.character-orders-section {
  padding: 20px 30px;
  background: rgba(26, 47, 74, 0.3);
  border-bottom: 1px solid #2a3a52;
}

.character-orders-section h2 {
  color: #5fb3f5;
  font-size: 16px;
}

.orders-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
}

.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding-bottom: 10px;
}

.order-card {
  background: rgba(42, 58, 82, 0.6);
  border: 1px solid #2a3a52;
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.order-card:hover {
  border-color: #5fb3f5;
  background: rgba(42, 58, 82, 0.85);
}

.order-card.outbid {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.5);
}

.order-health-note {
  margin-top: 8px;
  font-size: 11px;
  color: #8892a8;
}

.order-health-note.ok {
  color: #4ade80;
}

.order-health-note.warn {
  color: #fbbf24;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.order-header h4 {
  margin: 0;
  font-size: 13px;
  color: #e0e6ed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.order-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(79, 172, 254, 0.2);
  color: #4facfe;
}

.order-status.buy {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

.order-details {
  font-size: 12px;
  color: #a0aeb8;
  line-height: 1.6;
}

@media (max-width: 1024px) {
  .orders-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 15px 20px;
  }

  .header-top {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header h1 {
    font-size: 22px;
  }

  .navigation {
    padding: 0 10px;
  }

  .nav-tab {
    padding: 14px 16px;
    font-size: 13px;
  }

  .character-orders-section {
    padding: 15px 20px;
  }

  .order-card {
    padding: 10px;
  }

  .order-header h4 {
    font-size: 12px;
  }

  .order-details {
    font-size: 11px;
  }
}

.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 15px;
  border-radius: 6px;
  margin: 20px 30px 0 30px;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6a7a8a;
  font-size: 14px;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 40px 30px;
}

.empty-state-content {
  text-align: center;
  max-width: 400px;
}

.empty-state-icon {
  font-size: 60px;
  margin-bottom: 20px;
  display: block;
}

.empty-state-content h3 {
  font-size: 22px;
  color: #5fb3f5;
  margin-bottom: 10px;
}

.empty-state-content p {
  color: #8892a8;
  font-size: 14px;
}

.wallet-section {
  padding: 20px 30px;
}

.wallet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #2a5a8a;
}

.wallet-header h2 {
  font-size: 24px;
  color: #5fb3f5;
  margin: 0;
  border: none;
  padding: 0;
}

.wallet-balance-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(95, 179, 245, 0.1);
  padding: 12px 20px;
  border-radius: 6px;
  border: 1px solid rgba(95, 179, 245, 0.3);
}

.wallet-label {
  color: #8892a8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wallet-amount {
  font-size: 18px;
  font-weight: 600;
  color: #5fb3f5;
  font-family: 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
}

.wallet-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #2a3a52;
}

.wallet-tab {
  background: none;
  border: none;
  color: #8892a8;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.wallet-tab:hover {
  color: #5fb3f5;
}

.wallet-tab.active {
  color: #5fb3f5;
  border-bottom-color: #5fb3f5;
}

.wallet-content {
  padding: 20px 0;
}

.balance-card {
  background: rgba(42, 58, 82, 0.6);
  border: 1px solid #2a3a52;
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 20px;
}

.balance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.balance-label {
  color: #8892a8;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-value {
  font-size: 32px;
  font-weight: 700;
  color: #4ade80;
  font-family: 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
}

.pnl-period-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.pnl-period-btn {
  background: rgba(42, 58, 82, 0.6);
  border: 1px solid #2a3a52;
  color: #8892a8;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pnl-period-btn:hover {
  color: #5fb3f5;
  border-color: rgba(95, 179, 245, 0.4);
}

.pnl-period-btn.active {
  color: #5fb3f5;
  background: rgba(95, 179, 245, 0.12);
  border-color: rgba(95, 179, 245, 0.5);
}

.pnl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.pnl-card {
  background: rgba(42, 58, 82, 0.6);
  border: 1px solid #2a3a52;
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pnl-card-highlight {
  border-color: rgba(95, 179, 245, 0.5);
  background: rgba(95, 179, 245, 0.08);
}

.pnl-label {
  color: #8892a8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pnl-value {
  font-size: 20px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
  color: #e0e6ed;
}

.pnl-value.positive {
  color: #4ade80;
}

.pnl-value.negative {
  color: #f87171;
}

.opportunities-table td.positive {
  color: #4ade80;
}

.opportunities-table td.negative {
  color: #f87171;
}

.fills-subheading {
  color: #5fb3f5;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.fills-timestamp {
  color: #8892a8;
  font-size: 11px;
}

.inferred-marker {
  color: #fbbf24;
  cursor: help;
}

.pnl-note {
  font-size: 12px;
  color: #6a7a8a;
  line-height: 1.5;
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.transaction-item {
  background: rgba(42, 58, 82, 0.6);
  border: 1px solid #2a3a52;
  border-radius: 6px;
  padding: 15px;
  transition: all 0.2s ease;
}

.transaction-item:hover {
  background: rgba(58, 78, 102, 0.6);
  border-color: #3a5a8a;
}

.transaction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(42, 58, 82, 0.8);
}

.transaction-type {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 3px;
  background: rgba(79, 172, 254, 0.2);
  color: #4facfe;
  font-weight: 600;
}

.transaction-type.sell {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

.transaction-date {
  font-size: 11px;
  color: #6a7a8a;
}

.transaction-details {
  font-size: 12px;
  color: #a0aeb8;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.transaction-total {
  font-weight: 600;
  color: #5fb3f5;
  grid-column: 1 / -1;
}

/* Profile Page Styles */
.character-name-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(95, 179, 245, 0.08);
  border: 1px solid rgba(95, 179, 245, 0.3);
  border-radius: 20px;
  color: #5fb3f5;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 14px 4px 4px;
  transition: all 0.2s ease;
}

.character-name-btn:hover {
  background: rgba(95, 179, 245, 0.18);
  border-color: rgba(95, 179, 245, 0.55);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(95, 179, 245, 0.2);
}

.character-name-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(95, 179, 245, 0.4);
}

.account-name-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 20px;
  color: #e0e6ed;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 14px;
  transition: all 0.2s ease;
}

.account-name-btn:hover {
  background: rgba(95, 179, 245, 0.08);
  border-color: rgba(95, 179, 245, 0.3);
  color: #5fb3f5;
}

.profile-page {
  padding: 20px 30px;
}

.profile-back-btn {
  background: none;
  border: none;
  color: #8892a8;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
}

.profile-back-btn:hover {
  color: #5fb3f5;
}

.profile-header-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(42, 58, 82, 0.6);
  border: 1px solid #2a3a52;
  border-radius: 8px;
  padding: 20px 25px;
  margin-bottom: 20px;
}

.profile-portrait {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  border: 2px solid rgba(95, 179, 245, 0.4);
}

.profile-header-info h2 {
  font-size: 22px;
  color: #e0e6ed;
  margin-bottom: 6px;
}

.profile-sub {
  font-size: 13px;
  color: #8892a8;
  margin-bottom: 2px;
}

.profile-sp {
  font-size: 13px;
  color: #4ade80;
  margin-top: 6px;
  font-weight: 600;
}

.profile-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #2a3a52;
}

.profile-tab {
  background: none;
  border: none;
  color: #8892a8;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.profile-tab:hover {
  color: #5fb3f5;
}

.profile-tab.active {
  color: #5fb3f5;
  border-bottom-color: #5fb3f5;
}

.skills-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 1024px) {
  .skills-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .skills-section {
    grid-template-columns: 1fr;
  }
}

.skill-group-card {
  background: rgba(42, 58, 82, 0.6);
  border: 1px solid #2a3a52;
  border-radius: 8px;
  padding: 16px 20px;
}

.skill-group-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(95, 179, 245, 0.2);
}

.skill-group-name {
  font-size: 15px;
  font-weight: 600;
  color: #5fb3f5;
}

.skill-group-meta {
  font-size: 12px;
  color: #8892a8;
}

.skill-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 4px 0;
  font-size: 13px;
}

.skill-name {
  color: #e0e6ed;
}

.skill-pip.filled-training {
  background: #facc15;
  border-color: #facc15;
}

.skill-pips {
  display: flex;
  gap: 3px;
}

.skill-pip {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: rgba(136, 146, 168, 0.25);
  border: 1px solid rgba(136, 146, 168, 0.4);
}

.skill-pip.filled {
  background: #5fb3f5;
  border-color: #5fb3f5;
}

.skill-sp {
  color: #8892a8;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  min-width: 80px;
  text-align: right;
}

/* Market Dashboard Styles */
.market-dashboard {
  padding: 20px 30px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 2px solid #2a5a8a;
}

.dashboard-header h2 {
  font-size: 24px;
  color: #5fb3f5;
  margin: 0;
}

.dashboard-header p {
  color: #8892a8;
  font-size: 13px;
  margin: 5px 0 0 0;
}

.refresh-btn {
  background: rgba(95, 179, 245, 0.2);
  color: #5fb3f5;
  border: 1px solid rgba(95, 179, 245, 0.4);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.refresh-btn:hover:not(:disabled) {
  background: rgba(95, 179, 245, 0.3);
  border-color: rgba(95, 179, 245, 0.6);
}

.refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.filters-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  background: rgba(42, 58, 82, 0.4);
  border: 1px solid #2a3a52;
  border-radius: 8px;
  padding: 15px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 12px;
  text-transform: uppercase;
  color: #8892a8;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.filter-input,
.filter-input-small,
.calc-input {
  background: rgba(26, 47, 74, 0.6);
  border: 1px solid #2a3a52;
  color: #e0e6ed;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  transition: all 0.2s ease;
}

.filter-input:focus,
.filter-input-small:focus,
.calc-input:focus {
  border-color: #5fb3f5;
  outline: none;
  box-shadow: 0 0 8px rgba(95, 179, 245, 0.2);
}

.filter-input-small {
  padding: 6px 10px;
  font-size: 11px;
}

.sort-controls {
  display: flex;
  gap: 8px;
}

.sort-controls select {
  flex: 1;
}

.sort-order-btn {
  background: rgba(95, 179, 245, 0.2);
  color: #5fb3f5;
  border: 1px solid rgba(95, 179, 245, 0.4);
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  min-width: 40px;
}

.sort-order-btn:hover {
  background: rgba(95, 179, 245, 0.3);
}

.opportunities-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.opportunities-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  flex: 1;
  border: 1px solid #2a3a52;
  border-radius: 8px;
  background: rgba(42, 58, 82, 0.3);
}

.opportunities-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.opportunities-table thead {
  background: rgba(26, 47, 74, 0.6);
  position: sticky;
  top: 0;
  z-index: 10;
}

.opportunities-table th {
  padding: 12px 15px;
  text-align: left;
  color: #5fb3f5;
  font-weight: 600;
  border-bottom: 2px solid #2a3a52;
  white-space: nowrap;
}

.opportunities-table th:not(:first-child) {
  text-align: right;
}

.opportunities-table tbody tr {
  border-bottom: 1px solid rgba(42, 58, 82, 0.5);
  transition: all 0.2s ease;
}

.opportunities-table tbody tr:hover {
  background: rgba(95, 179, 245, 0.08);
}

.opportunities-table tbody tr.selected {
  background: rgba(95, 179, 245, 0.15);
  border-color: #5fb3f5;
}

.opportunities-table td {
  padding: 12px 15px;
  color: #e0e6ed;
}

.opportunities-table .item-name {
  color: #5fb3f5;
  font-weight: 600;
  min-width: 150px;
}

.opportunities-table .price {
  font-family: 'Courier New', monospace;
  text-align: right;
  min-width: 100px;
}

.opportunities-table .margin-isk {
  text-align: right;
  min-width: 90px;
  font-weight: 600;
}

.opportunities-table .margin-percent {
  text-align: right;
  min-width: 70px;
  font-weight: 600;
}

.opportunities-table .volume {
  text-align: right;
  font-family: 'Courier New', monospace;
  color: #8892a8;
}

.opportunities-table .profit {
  text-align: right;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  min-width: 100px;
}

.opportunity-detail-row td {
  padding: 0;
  cursor: default;
}

.opportunities-table tbody tr.opportunity-detail-row:hover {
  background: none;
}

.item-detail-inline {
  background: rgba(26, 47, 74, 0.5);
  border-top: 2px solid #5fb3f5;
  padding: 20px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #2a3a52;
}

.detail-header h3 {
  font-size: 18px;
  color: #5fb3f5;
  margin: 0;
}

.detail-header button {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.detail-header button:hover {
  background: rgba(239, 68, 68, 0.3);
}

.trade-advice {
  background: rgba(95, 179, 245, 0.08);
  border: 1px solid rgba(95, 179, 245, 0.3);
  border-radius: 6px;
  padding: 12px 15px;
  margin-bottom: 20px;
}

.trade-advice h4 {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: #5fb3f5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.advice-line {
  font-size: 14px;
  color: #e0e6ed;
}

.advice-line strong {
  color: #5fb3f5;
}

.advice-note {
  margin-top: 6px;
  font-size: 11px;
  color: #8892a8;
  font-style: italic;
}

.advice-note.own-order-note {
  color: #fbbf24;
  font-style: normal;
}

.detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.metric {
  background: rgba(26, 47, 74, 0.4);
  border: 1px solid #2a3a52;
  border-radius: 6px;
  padding: 15px;
  text-align: center;
}

.metric-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #8892a8;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: block;
}

.metric-value {
  font-size: 18px;
  font-weight: 700;
  color: #5fb3f5;
  font-family: 'Courier New', monospace;
}

.profit-calculator {
  background: rgba(26, 47, 74, 0.4);
  border: 1px solid #2a3a52;
  border-radius: 6px;
  padding: 15px;
}

.profit-calculator h4 {
  margin: 0 0 15px 0;
  font-size: 13px;
  color: #5fb3f5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
}

.calc-row label {
  color: #8892a8;
  font-size: 12px;
  min-width: 80px;
}

.calc-input {
  flex: 1;
}

.calc-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 4px;
  font-size: 13px;
}

.calc-result span:first-child {
  color: #8892a8;
}

.profit-result {
  font-weight: 700;
  color: #4ade80;
  font-family: 'Courier New', monospace;
  font-size: 16px;
}

.fee-rates-note {
  margin-top: 10px;
  font-size: 11px;
  color: #6a7a8a;
  font-style: italic;
}

.fill-detail-note {
  margin-top: 8px;
  font-size: 11px;
  color: #8892a8;
}

@media (max-width: 1200px) {
  .filters-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .detail-content {
    grid-template-columns: 1fr;
  }
}

/* Search Section Styles */
.search-section {
  position: relative;
  margin-bottom: 20px;
}

.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(42, 58, 82, 0.4);
  border: 1px solid #2a3a52;
  border-radius: 8px;
  padding: 15px;
}

.search-input {
  flex: 1;
  background: rgba(26, 47, 74, 0.6);
  border: 1px solid #2a3a52;
  color: #e0e6ed;
  padding: 10px 15px;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Segoe UI', sans-serif;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: #5fb3f5;
  outline: none;
  box-shadow: 0 0 8px rgba(95, 179, 245, 0.2);
}

.search-input::placeholder {
  color: #6a7a8a;
}

.search-status {
  color: #8892a8;
  font-size: 12px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(26, 47, 74, 0.95);
  border: 1px solid #2a3a52;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  margin-top: -1px;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(42, 58, 82, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-result-item:hover {
  background: rgba(95, 179, 245, 0.1);
}

.search-result-item:last-child {
  border-bottom: none;
}

.result-name {
  color: #5fb3f5;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.result-id {
  color: #6a7a8a;
  font-size: 11px;
}

.add-btn {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.add-btn:hover {
  background: rgba(74, 222, 128, 0.3);
  border-color: rgba(74, 222, 128, 0.6);
}

.dashboard-header > div:last-child {
  display: flex;
  gap: 10px;
}

/* Settings Styles */
.settings-dashboard {
  padding: 20px 30px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section h3 {
  font-size: 15px;
  color: #5fb3f5;
  margin: 0 0 14px 0;
}

.settings-history-table {
  margin-top: 16px;
  max-height: 320px;
}

/* Browse Market Styles */
.browse-dashboard {
  padding: 20px 30px;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.browse-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  flex: 1;
  overflow: hidden;
}

.browse-tree-panel,
.browse-items-panel {
  background: rgba(42, 58, 82, 0.3);
  border: 1px solid #2a3a52;
  border-radius: 8px;
  padding: 10px;
  overflow-y: auto;
}

.browse-tree-panel::-webkit-scrollbar,
.browse-items-panel::-webkit-scrollbar {
  width: 8px;
}

.browse-tree-panel::-webkit-scrollbar-thumb,
.browse-items-panel::-webkit-scrollbar-thumb {
  background: #3a6a9f;
  border-radius: 4px;
}

.tree-node-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #c0cad8;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.tree-node-row:hover {
  background: rgba(95, 179, 245, 0.1);
  color: #e0e6ed;
}

.tree-node-row.selected {
  background: rgba(95, 179, 245, 0.18);
  color: #5fb3f5;
  font-weight: 600;
}

.tree-toggle {
  display: inline-block;
  width: 14px;
  flex-shrink: 0;
  color: #6a7a8a;
  font-size: 10px;
  transition: transform 0.15s ease;
  text-align: center;
}

.tree-toggle.expanded {
  transform: rotate(90deg);
}

.tree-toggle.leaf {
  visibility: hidden;
}

.tree-node-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-node-count {
  color: #6a7a8a;
  font-size: 11px;
  flex-shrink: 0;
}

.transactions-count-note {
  color: #6a7a8a;
  font-size: 11px;
  margin-bottom: 10px;
}

.tree-children {
  margin-left: 18px;
  border-left: 1px solid rgba(42, 58, 82, 0.8);
  padding-left: 4px;
}

.browse-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px 12px 10px;
  border-bottom: 1px solid #2a3a52;
  margin-bottom: 8px;
  color: #5fb3f5;
  font-size: 14px;
  font-weight: 600;
}

.browse-item-wrapper {
  border-radius: 4px;
  margin-bottom: 2px;
}

.browse-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.browse-item-row:hover {
  background: rgba(95, 179, 245, 0.08);
}

.browse-item-row.expanded {
  background: rgba(95, 179, 245, 0.12);
  border-radius: 4px 4px 0 0;
}

.browse-item-name {
  font-size: 13px;
  color: #e0e6ed;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-item-prices {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.browse-item-prices.placeholder,
.browse-item-prices.dim {
  color: #6a7a8a;
  font-size: 11px;
  font-style: italic;
}

.price-chip {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
}

.price-chip.sell {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.price-chip.buy {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.price-chip.spread {
  background: rgba(95, 179, 245, 0.15);
  color: #5fb3f5;
}

.browse-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.order-book {
  background: rgba(26, 47, 74, 0.5);
  border: 1px solid #2a3a52;
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 12px;
  margin-bottom: 6px;
}

.order-book-summary {
  display: flex;
  gap: 20px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #2a3a52;
}

.order-book-summary > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.order-book-summary .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8892a8;
}

.order-book-summary .value {
  font-size: 14px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: #e0e6ed;
}

.order-book-summary .value.sell {
  color: #f87171;
}

.order-book-summary .value.buy {
  color: #4ade80;
}

.order-book-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.order-book-column-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(42, 58, 82, 0.8);
}

.order-book-column-title.sell {
  color: #f87171;
}

.order-book-column-title.buy {
  color: #4ade80;
}

.order-book-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 12px;
  font-family: 'Courier New', monospace;
}

.order-book-price.sell {
  color: #f87171;
}

.order-book-price.buy {
  color: #4ade80;
}

.order-book-volume {
  color: #8892a8;
}

.order-book-empty {
  color: #6a7a8a;
  font-size: 12px;
  padding: 8px 0;
}

@media (max-width: 900px) {
  .browse-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 300px 1fr;
  }

  .browse-item-row {
    flex-wrap: wrap;
  }

  .browse-item-name {
    flex-basis: 100%;
  }
}

@media (max-width: 768px) {
  .market-dashboard {
    padding: 15px;
    gap: 15px;
  }

  .filters-panel {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .dashboard-header > div:last-child {
    width: 100%;
    justify-content: flex-end;
  }

  .refresh-btn {
    align-self: flex-end;
  }

  .opportunities-table {
    font-size: 10px;
  }

  .opportunities-table th,
  .opportunities-table td {
    padding: 8px 10px;
  }

  .detail-metrics {
    grid-template-columns: 1fr;
  }

  .search-box {
    flex-direction: column;
  }

  .search-results {
    position: static;
    border: 1px solid #2a3a52;
    margin-top: 10px;
    border-radius: 8px;
    max-height: 400px;
  }
}

/* Account gate / admin board */
#auth-gate,
#pending-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
  padding: 20px;
}

.auth-card,
.pending-card {
  width: 100%;
  max-width: 380px;
  background: rgba(42, 58, 82, 0.4);
  border: 1px solid #2a3a52;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
}

.auth-card h1,
.pending-card h1 {
  font-size: 22px;
  color: #5fb3f5;
  margin-bottom: 20px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #2a3a52;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: #8892a8;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.auth-tab.active {
  color: #5fb3f5;
  border-bottom-color: #5fb3f5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.auth-form .filter-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
}

.auth-form .error {
  margin: 0;
  padding: 10px;
  font-size: 12px;
}

.auth-form .refresh-btn {
  padding: 10px;
  font-size: 14px;
}

.pending-card p {
  color: #8892a8;
  font-size: 14px;
  line-height: 1.5;
}

.auth-disabled-note {
  color: #8892a8;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  padding: 10px 0;
}

.admin-accounts-table th:not(:first-child),
.admin-accounts-table td:not(:first-child) {
  text-align: left;
}

.admin-action-btn {
  margin-left: 6px;
}

.admin-action-btn.danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.5);
}

.admin-action-btn.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.7);
}

.linked-character-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(42, 58, 82, 0.3);
  border: 1px solid #2a3a52;
  border-radius: 8px;
  margin-bottom: 8px;
}

.linked-character-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.linked-character-name {
  color: #e0e6ed;
  font-weight: 600;
  font-size: 13px;
}

.linked-character-meta {
  color: #8892a8;
  font-size: 11px;
}

.active-badge {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
