:root {
  --primary: #00b894;
  --muted: #6b7280;
  --card: #ffffff;
  --bg: #f9fafb;
  --danger: #ef4444;
  --profit: #16a34a;
  --font-base: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-base);
  background: var(--bg);
  display: flex;
  justify-content: center;
  padding: 20px;
}

.container {
  max-width: 90%;
  width: 100%;
  margin: 20px 0;
}

.card-wrapper {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.card {
  background: var(--card);
  border-radius: 2px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
  padding: 24px;
  transition: all 0.2s ease;
}

.panel.inputs { flex: 1 1 400px; }
.panel.results { flex: 1 1 400px; }

h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

label {
  display: block;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 14px;
}
.risk-options label {text-align: center}

input, input[type="number"],
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 15px;
  margin-bottom: 12px;
}

.risk-options {
  display: flex;
  gap: 16px;
}

.risk-options label {
  font-weight: 500;
  color: var(--muted);
}

.row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.row .col { flex: 1; min-width: 150px; }

.stop-loss-row .col { min-width: 140px; }

button {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: var(--primary);
  font-size: 15px;
  transition: background 0.2s ease;
}

button:hover {
  background: #00a07f;
}

.results .result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.results .result-item:last-child {
  border-bottom: none;
}

.results .value {
  font-weight: 700;
  font-size: 15px;
}

.note {
  font-size: 13px;
  color: var(--danger);
  margin-top: 8px;
}

.history-card {
  margin-top: 15px;
  border-radius: 2px;
  padding: 20px;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
  font-size: 14px;
}

th, td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #e6eef6;
}

th {
  background: #f5f7fa;
  font-weight: 600;
}

.profit { color: var(--profit); font-weight: 700; }
.loss { color: var(--danger); font-weight: 700; }



.navbar {
  background: var(--card);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  padding: 12px 20px;
  margin-bottom: 20px;
  border-radius: 6px;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--primary);
}


.card.panel.results {
  background: #ffffff;
  padding: 2rem 1.8rem;
  border-radius: 2px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  flex: 1 1 380px;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card.panel.results h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.result-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.result-grid .result-row {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  color: #555;
}

.result-grid .result-row .label {
  font-weight: 500;
  flex: 1;
}

.result-grid .result-row .value {
  font-weight: 600;
  text-align: right;
  color: #1a73e8; 
  min-width: 80px;
}

.result-grid .result-row .value.positive {
  color: #28a745; 
}
.result-grid .result-row .value.negative {
  color: #dc3545; 
}

.stock-details {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

.stock-details .result-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.97rem;
  color: #555;
}

.stock-details .result-row .label {
  font-weight: 500;
  color: #444;
  flex: 1;
}

.stock-details .result-row .value {
  font-weight: 600;
  text-align: right;
  color: #555;
  min-width: 80px;
}
@media (max-width: 900px) {
  .card-wrapper {
    flex-direction: column;
    gap: 1.5rem;
  }
  .card.panel.results {
    max-width: 100%;
  }
}

.calculator-row{
    display:flex; 
    gap:20px;
}
.card.panel.history{
    margin-top: 20px;
  }

@media (max-width: 768px) {
    body{
        padding: 10px;
    }
    .container {
      max-width: 100%;
      width: 100%;
      margin: 20px 0;
    }
    .calculator-row{
        flex-direction: column;
    }
  #historyTable {
    min-width: 700px;
  }
  .history-card {
    padding: 15px;
    border-radius: 8px;
  }
  .table-wrapper{
      overflow-x: auto;
  }

}



@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    background: var(--card);
    position: absolute;
    top: 60px;
    right: 20px;
    width: 200px;
    padding: 10px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-radius: 8px;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links li {
    text-align: right;
    padding: 8px 16px;
  }
}

input[readonly] {
  background: #f1f5f9;
  color: #475569;
}