body { margin: 0; font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif; background: #0c1220; color: #e5e9f0; }
.app-shell { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 16px; max-width: none; margin: 0 auto; box-sizing: border-box; }
.panel { background: #111827; padding: 16px; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.login-panel { display: grid; gap: 12px; max-width: 420px; }
.login-panel input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #334155; background: #0f172a; color: #e2e8f0; box-sizing: border-box; }
.hidden { display: none !important; }

.workspace { display: flex; flex-direction: column; gap: 16px; }
.session-toolbar {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
  padding-bottom: 12px; border-bottom: 1px solid #1f2937;
}
.session-toolbar .field { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.session-toolbar label { font-size: 0.8rem; color: #94a3b8; }
.session-toolbar select,
.session-toolbar input[type="date"] {
  padding: 10px 12px; border-radius: 8px; border: 1px solid #334155; background: #0f172a; color: #e2e8f0;
  font-size: 0.95rem;
}
.btn-primary { padding: 12px 20px; border: none; border-radius: 10px; background: #2563eb; color: white; cursor: pointer; font-weight: 600; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-secondary {
  padding: 12px 18px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #1e293b;
  color: #e2e8f0;
  cursor: pointer;
  font-weight: 600;
}
.btn-secondary:hover:not(:disabled) { background: #334155; }
.btn-secondary:disabled { opacity: 0.55; cursor: not-allowed; }

.session-controls { display: flex; flex-direction: column; gap: 12px; }
.session-status { font-size: 0.9rem; color: #cbd5e1; }
.action-buttons, .trade-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
button:not(.btn-icon):not(.btn-primary):not(.btn-secondary) {
  padding: 12px 18px; border: none; border-radius: 10px; background: #2563eb; color: white; cursor: pointer;
}
button:not(.btn-icon):not(.btn-primary):not(.btn-secondary):hover:not(:disabled) { background: #1d4ed8; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.chart-section { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.chart-toolbar { display: flex; justify-content: flex-end; align-items: center; }
.btn-icon {
  padding: 8px 14px; border-radius: 8px; border: 1px solid #334155; background: #1e293b; color: #e2e8f0;
  cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.btn-icon:hover { background: #334155; }

.chart-wrap {
  position: relative; width: 100%; min-height: 680px; height: min(78vh, 920px); border-radius: 14px; overflow: hidden;
  background: #131722;
}
.chart-wrap.chart-maximized {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: none !important;
  border-radius: 0 !important;
}
body.chart-maximize-active { overflow: hidden; }

.chart { width: 100%; height: 100%; min-height: 680px; }
.chart-symbol {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  pointer-events: none;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #e2e8f0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}
.chart-symbol .pair { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.02em; }
.chart-symbol .quote { font-weight: 600; font-variant-numeric: tabular-nums; color: #38bdf8; }
.chart-symbol .meta { opacity: 0.85; font-size: 0.82rem; margin-top: 2px; }

.crosshair-ohlc {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: rgba(19, 23, 34, 0.92);
  border: 1px solid #363a45;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: #d1d4dc;
  line-height: 1.45;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  max-width: 220px;
}
.crosshair-ohlc .row { display: flex; gap: 8px; justify-content: space-between; }
.crosshair-ohlc .muted { color: #758696; font-size: 0.72rem; }

.session-controls .control-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.session-controls .field.inline label { font-size: 0.8rem; color: #94a3b8; }
.session-controls .field.inline select { min-width: 120px; }
.btn-danger { padding: 12px 18px; border: none; border-radius: 10px; background: #b91c1c; color: white; cursor: pointer; font-weight: 600; }
.btn-danger:hover:not(:disabled) { background: #991b1b; }
.btn-danger:disabled { opacity: 0.55; cursor: not-allowed; }

.risk-panel { border: 1px solid #1f2937; border-radius: 12px; padding: 12px 14px; background: #0f172a; }
.risk-heading { margin: 0 0 10px 0; font-size: 0.95rem; font-weight: 600; color: #e2e8f0; }
.risk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.risk-grid .field.wide { grid-column: 1 / -1; }
.risk-grid input[type="number"] { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid #334155; background: #111827; color: #e2e8f0; box-sizing: border-box; }
.computed-lot { font-size: 0.85rem; color: #94a3b8; }
.trade-controls .lot-label { font-size: 0.85rem; color: #94a3b8; }

.below-chart {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}
@media (max-width: 900px) {
  .below-chart { grid-template-columns: 1fr; }
}
.summary, .events {
  background: #111827; border: 1px solid #1f2937; border-radius: 12px; padding: 14px;
  max-height: 280px; overflow-y: auto;
}
.summary div, .events div { margin-bottom: 10px; }
.events { font-size: 0.95rem; }

.report-panel {
  margin-top: 12px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: #0f172a;
}
.report-heading { margin: 0 0 12px 0; font-size: 1rem; font-weight: 600; color: #e2e8f0; }
.report-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 16px;
  margin: 0 0 16px 0;
}
.report-metrics div { display: flex; flex-direction: column; gap: 4px; }
.report-metrics dt { margin: 0; font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.report-metrics dd { margin: 0; font-size: 1.05rem; font-variant-numeric: tabular-nums; color: #e2e8f0; }
.report-equity-chart {
  width: 100%;
  min-height: 220px;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
}
