* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  padding: 30px;

  font-family: Verdana, sans-serif;

  background: #f5f6f8;
  color: #1f2937;
}

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

h1 {
  margin: 0 0 24px;
  font-size: 1.7rem;
}

.portfolio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

#portfolioTickerInput {
  height: 40px;
  width: 120px;

  border: 1px solid #cfd4dc;
  border-radius: 8px;

  padding: 0 10px;

  background: white;
  color: #1f2937;

  font-size: 0.95rem;
}

#addTickerBtn,
#removeSelectedTickerBtn,
#moveTickerUpBtn,
#moveTickerDownBtn,
#refreshPortfolioBtn {
  height: 40px;

  border: 0;
  border-radius: 8px;

  padding: 0 15px;

  background: #1d4ed8;
  color: white;

  cursor: pointer;
  font-size: 0.95rem;
}

#addTickerBtn:hover,
#removeSelectedTickerBtn:hover,
#moveTickerUpBtn:hover,
#moveTickerDownBtn:hover,
#refreshPortfolioBtn:hover {
  background: #7ca6fa;
}

.status {
  min-height: 20px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.portfolio-table-wrap {
  width: 80%;
  max-height: calc(100vh - 220px);
  overflow-x: auto;   
  overflow-y: auto;
}

#portfolioTable {
  width: 100%;
  border-collapse: separate;
  background: white;
  border-spacing: 0;
}

#portfolioTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: #f3f4f6;
}

#portfolioTable th,
#portfolioTable td {
  height: 42px;

  padding: 6px 12px;

  border-bottom: 1px solid #e5e7eb;

  text-align: center;
  font-size: 0.9rem;
}

#portfolioTable th {
  background: #eef1f5;
  font-weight: 600;
}

#portfolioTable th:first-child,
#portfolioTable td:first-child {
  text-align: left;
}

.portfolio-ticker {
  font-weight: 600;
}

.positive {
  color: green;
  font-weight: bold;
}

.negative {
  color: red;
  font-weight: bold;
}

.remove-btn {
  border: 0;
  border-radius: 6px;

  padding: 6px 10px;

  background: #e5e7eb;
  color: #374151;

  cursor: pointer;
}

.remove-btn:hover {
  background: #d1d5db;
}

.empty-row {
  color: #6b7280;
  text-align: center !important;
}

@media (max-width: 700px) {
  body {
    padding: 15px;
  }

  .container {
    margin: 10px auto;
  }

  .portfolio-controls {
    flex-wrap: wrap;
  }

  #portfolioTable th,
  #portfolioTable td {
    padding: 6px 8px;
    font-size: 0.82rem;
  }
}

.chart-btn {
  border: 0;
  border-radius: 6px;

  padding: 6px 10px;

  background: #dbeafe;
  color: #1d4ed8;

  cursor: pointer;
}

.chart-btn:hover {
  background: #bfdbfe;
}


.sort-btn {
  border: none;
  background: transparent;
  padding: 4px 2px;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
}

.sort-btn:hover {
  opacity: 0.75;
}

.sort-arrow {
  display: inline-block;
  margin-left: 3px;
  color: #6b7280;
}





#portfolioTable tbody tr {
  cursor: pointer;
}

#portfolioTable tbody tr.selected-row {
  background-color: #dbeafe;
  outline: 2px solid #60a5fa;
  outline-offset: -2px;
}

#portfolioTable tbody tr.selected-row td {
  color: #1e3a8a;
}

.portfolio-controls button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
