body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; margin: 0; background: #f8fafc; color: #111827; }
.top-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #e8e8e8; background: #fff; position: sticky; top: 0; z-index: 5; }
.nav-left, .nav-right { display: flex; align-items: center; gap: 10px; }
nav a { text-decoration: none; color: #0f172a; }
main { max-width: 1180px; margin: 16px auto; padding: 0 12px 24px; }
.panel { border: 1px solid #e6ebf2; background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 12px; }
form { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
input, select, textarea, button { padding: 7px 9px; border: 1px solid #d7d7d7; border-radius: 8px; background: #fff; }
textarea { min-height: 100px; width: 100%; }
button, .btn { background: #111827; color: #fff; cursor: pointer; text-decoration: none; border: none; padding: 8px 12px; border-radius: 8px; display: inline-block; }
.btn-ghost { background: #fff; color: #0f172a; border: 1px solid #d7d7d7; }
.disabled { opacity: .45; pointer-events: none; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #ededed; text-align: left; padding: 8px 6px; }
.tag { display: inline-block; margin-right: 6px; padding: 2px 8px; background: #f3f4f6; border-radius: 999px; }
.err { color: #b91c1c; }
.ok { color: #047857; }
dialog { border: 1px solid #ddd; border-radius: 10px; padding: 14px; }
dialog::backdrop { background: rgba(0,0,0,.25); }
#newTradeDialog { min-width: 360px; max-width: 420px; }
.trade-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}
.trade-dialog-form h3 { margin: 0; font-size: 1.05rem; }
.trade-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.trade-form-row.is-hidden { display: none; }
.trade-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.trade-field label { font-size: 13px; color: #64748b; font-weight: 500; }
.trade-field input,
.trade-field select { width: 100%; box-sizing: border-box; }
.trade-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
@media (max-width: 480px) {
  #newTradeDialog { min-width: 0; max-width: none; }
  .trade-form-row { grid-template-columns: 1fr; }
}
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.page-head-welcome-row { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 12px; }
.page-head-welcome-row h2 { margin: 0; flex: 0 1 auto; min-width: 0; }
.page-head-welcome-row .scheme-switch-form { display: inline-flex; flex-wrap: nowrap; flex: 0 0 auto; margin: 0; align-items: center; }
.page-head-action-form { margin: 0; }
.scheme-panel { display: flex; flex-direction: column; gap: 10px; }
.scheme-switch-form { margin: 0; padding: 8px 10px; border: 1px solid #e6ebf2; border-radius: 10px; background: #f8fafc; }
.scheme-multi-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; max-width: min(720px, 100%); }
.scheme-multi-label { font-size: 13px; color: #475569; margin-right: 4px; }
.scheme-check { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; margin: 0; cursor: pointer; }
.scheme-check input { margin: 0; }
.scheme-apply-btn { padding: 4px 10px; font-size: 12px; }
.scheme-merge-hint { margin: 0 0 10px; padding: 8px 12px; font-size: 13px; color: #475569; background: #f1f5f9; border-radius: 8px; border: 1px solid #e2e8f0; }
.muted { color: #94a3b8; font-size: 13px; }
.scheme-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.scheme-actions form { margin: 0; }
.scheme-actions .btn, .scheme-actions button, .scheme-actions form button { width: auto; min-width: 92px; text-align: center; padding: 6px 10px; font-size: 13px; }
.btn-primary { background: #0f172a; font-weight: 600; }
.btn-danger { background: #b91c1c; }
.toast {
  position: fixed;
  top: 74px;
  right: 16px;
  z-index: 30;
  padding: 10px 12px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { background: #047857; }
.toast.err { background: #b91c1c; }
.stock-list-actions { display: flex; gap: 8px; margin: 8px 0 10px; }
.stock-list-actions form { margin: 0; }
.stock-action-btn { min-height: 38px; padding: 8px 12px; display: inline-flex; align-items: center; justify-content: center; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.stats-grid h4 { margin: 0 0 6px; font-size: 13px; color: #64748b; font-weight: 600; }
.stats-grid strong { font-size: 16px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.chart-box { width: 100%; height: 300px; }
.chart-lg { height: 440px; }
.chart-empty-hint { margin: 0; padding: 48px 12px; text-align: center; color: #94a3b8; font-size: 14px; }
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; padding: 24px; border-radius: 14px; background: linear-gradient(135deg, #0f172a, #1e293b); color: #f8fafc; }
.hero p { color: #cbd5e1; }
.hero-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 12px; }
.hero-actions { display: flex; gap: 8px; margin-top: 12px; }
@media (max-width: 900px) {
  .stats-grid, .chart-grid, .hero { grid-template-columns: 1fr; }
}
