/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f0f4f8;
  color: #1a202c;
  line-height: 1.5;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  background: #2d3748;
  color: #fff;
  padding: 1.25rem 2rem;
}

header h1 { font-size: 1.6rem; font-weight: 700; }
header .subtitle { font-size: 0.9rem; color: #a0aec0; margin-top: 0.2rem; }

/* ── Main layout ─────────────────────────────────────────────────────────── */
main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  padding: 1.5rem;
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2d3748;
}

.chart-subtitle {
  font-size: 0.8rem;
  font-weight: 400;
  color: #718096;
}

/* ── Form grid ───────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4a5568;
  gap: 0.25rem;
}

select, input[type="number"] {
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd5e0;
  border-radius: 5px;
  font-size: 0.9rem;
  background: #fff;
  color: #1a202c;
  transition: border-color 0.15s;
}

select:focus, input[type="number"]:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66,153,225,.25);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.form-actions {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; }

.btn-primary  { background: #4299e1; color: #fff; }
.btn-secondary{ background: #e2e8f0; color: #4a5568; }

/* ── Error / info messages ───────────────────────────────────────────────── */
.error-msg { font-size: 0.82rem; color: #e53e3e; }

.info-box {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  background: #ebf8ff;
  border-left: 4px solid #4299e1;
  border-radius: 4px;
  font-size: 0.88rem;
  color: #2b6cb0;
}

/* ── Positions table ─────────────────────────────────────────────────────── */
#positions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

#positions-table th {
  text-align: left;
  padding: 0.4rem 0.6rem;
  background: #edf2f7;
  border-bottom: 2px solid #cbd5e0;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #718096;
}

#positions-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #e2e8f0;
}

#positions-table tr:last-child td { border-bottom: none; }

.remove-btn, .edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.25rem;
}

.remove-btn { color: #e53e3e; }
.remove-btn:hover { color: #c53030; }

.edit-btn { color: #4299e1; margin-right: 0.25rem; }
.edit-btn:hover { color: #2b6cb0; }

/* ── Direction / type badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-call  { background: #c6f6d5; color: #276749; }
.badge-put   { background: #feebc8; color: #7b341e; }
.badge-long  { background: #bee3f8; color: #2c5282; }
.badge-short { background: #fed7d7; color: #9b2c2c; }

.form-hint {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: #718096;
}

/* ── Home tool list ──────────────────────────────────────────────────────── */
.tool-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tool-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.tool-list li:last-child { border-bottom: none; }

.tool-list .btn {
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  display: inline-block;
}

.tool-list p {
  font-size: 0.88rem;
  color: #4a5568;
  margin: 0;
  line-height: 1.5;
  padding-top: 0.3rem;
}
