/* ============================================================
 * Generated bundle. Concatenates: monte-carlo-simulator, security-tools, swing-trading-strategy-calculator, trading-journal
 * Class prefixes are unique per file so styles do not collide.
 * Source files are kept for now — delete after verification.
 * ============================================================ */

/* ===== monte-carlo-simulator.css ===== */
/* Monte Carlo Simulator — page styles */

.page-wrap.page-full { grid-template-columns: 1fr; gap: 0; }
.page-wrap.page-full > main { padding-right: 0; }

.mc-grid {
  display: grid; grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.2fr);
  gap: 14px; margin-top: 14px;
}
@media (max-width: 1024px) { .mc-grid { grid-template-columns: 1fr; } }
.mc-col { display: flex; flex-direction: column; gap: 12px; }

.mc-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px;
}
.mc-card h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--brand); font-weight: 700; margin: 0 0 10px;
}
.mc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.mc-field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.mc-field input, .mc-field select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 14px; background: #fff; color: var(--ink); box-sizing: border-box;
}
.mc-field input:focus, .mc-field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,78,121,.12); }

.mc-btn {
  padding: 10px 18px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; cursor: pointer; font: inherit; font-size: 14px; color: var(--ink); width: 100%; font-weight: 600;
}
.mc-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.mc-btn.primary:hover { background: #16385A; }
.mc-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.mc-progress {
  margin-top: 10px; display: flex; flex-direction: column; gap: 6px;
}
.mc-progress-bar {
  height: 6px; background: #E5EAF0; border-radius: 999px; overflow: hidden;
}
.mc-progress-bar i {
  display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.1s linear;
}
.mc-progress span { font-size: 11.5px; color: var(--ink-3); font-family: 'JetBrains Mono', ui-monospace, monospace; }

.mc-edge {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px;
  font-size: 12.5px; color: var(--ink-2);
}
.mc-edge b { color: var(--ink); font-family: 'JetBrains Mono', ui-monospace, monospace; }
.mc-edge .full {
  grid-column: span 2; padding-top: 8px; border-top: 1px solid var(--line);
}
.mc-edge .verdict { color: var(--ink-2); font-style: italic; }
.mc-edge .verdict.good { color: #0B7A2C; font-style: normal; font-weight: 600; }
.mc-edge .verdict.bad  { color: #B91C1C; font-style: normal; font-weight: 600; }

/* KPIs */
.mc-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
@media (max-width: 800px) { .mc-kpis { grid-template-columns: repeat(2, 1fr); } }

.mc-kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px;
}
.mc-kpi .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--ink-3); }
.mc-kpi .val { font-size: 20px; font-weight: 700; color: var(--ink); margin-top: 2px; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.mc-kpi .val.pos { color: #0B7A2C; }
.mc-kpi .val.neg { color: #B91C1C; }
.mc-kpi .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; font-family: 'JetBrains Mono', ui-monospace, monospace; }

.mc-chart-card { padding: 14px 16px; }
.mc-chart-wrap { position: relative; width: 100%; min-height: 280px; }
.mc-chart-wrap canvas { width: 100% !important; }

/* Percentile table */
.mc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mc-table th, .mc-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.mc-table th { background: #F4F6F8; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; }
.mc-table td.num { font-family: 'JetBrains Mono', ui-monospace, monospace; text-align: right; }
.mc-table tr.median { background: var(--brand-light, #E8F1FA); font-weight: 700; }
.mc-table td.pos { color: #0B7A2C; }
.mc-table td.neg { color: #B91C1C; }

.mc-empty {
  text-align: center; padding: 60px 20px;
  background: #fff; border: 1px dashed var(--line); border-radius: var(--r-md);
  color: var(--ink-3); font-size: 14px;
}

/* ===== security-tools.css ===== */
/* Shared styles for the Security category generators
 * (API key, token, bearer, webhook, laravel app-key, oauth, jwt, etc.)
 *
 * Loaded by each security-tools page so the visual language is consistent
 * without duplicating ~200 lines of CSS in every PHP shell. */

.page-wrap.page-full { grid-template-columns: 1fr; gap: 0; }
.page-wrap.page-full > main { padding-right: 0; }

.st-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 22px; margin-top: 14px; }
.st-card h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.st-card h3 small { font-weight: 400; color: var(--ink-3); text-transform: none; letter-spacing: 0; font-size: 11px; }

.st-row { display: grid; grid-template-columns: repeat(var(--st-cols, 3), 1fr); gap: 10px 14px; }
@media (max-width: 720px) { .st-row { grid-template-columns: 1fr 1fr; } }
.st-row.cols-2 { --st-cols: 2; }
.st-row.cols-4 { --st-cols: 4; }
@media (max-width: 800px) { .st-row.cols-4 { grid-template-columns: 1fr 1fr; } }
.st-field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.st-field input, .st-field select, .st-field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 14px; background: #fff; color: var(--ink); box-sizing: border-box;
}
.st-field textarea { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; line-height: 1.55; min-height: 70px; resize: vertical; }
.st-field input:focus, .st-field select:focus, .st-field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,78,121,.12); }

.st-toggles { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.st-toggles label { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }

.st-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.st-btn {
  padding: 10px 22px; background: var(--brand); color: #fff; border: none;
  border-radius: 6px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.st-btn:hover { background: #16385A; }
.st-btn.alt   { background: #fff; color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.st-btn.alt:hover { border-color: var(--brand); color: var(--brand); }
.st-btn.tiny  { padding: 6px 12px; font-size: 12px; font-weight: 500; }
.st-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.st-out {
  background: #1A2332; color: #E8ECF1; padding: 16px 18px; border-radius: var(--r-md);
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 14px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-all; margin-top: 14px;
  max-height: 480px; overflow-y: auto;
  position: relative;
}
.st-out:empty::before { content: 'Click "Generate" — the output appears here.'; color: #8896A6; font-style: italic; }
.st-out .keylabel {
  display: inline-block; background: #2B7FC4; color: #fff; padding: 1px 8px;
  border-radius: 3px; font-size: 11px; font-weight: 700; margin-right: 6px; letter-spacing: 0.04em;
}
.st-out .secretlabel { background: #C77B00; }
.st-out .pair { padding: 6px 0; border-bottom: 1px dashed #2A3445; }
.st-out .pair:last-child { border-bottom: 0; }

.st-info {
  background: #E8F1FA; color: #1F4E79; padding: 10px 14px;
  border-radius: 6px; font-size: 12.5px; margin-top: 10px; line-height: 1.55;
}
.st-info code { background: rgba(31,78,121,0.10); padding: 1px 6px; border-radius: 3px; font-size: 12px; }
.st-info b { font-weight: 700; }

.st-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #0B7A2C; color: #fff; padding: 8px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 1000;
}
.st-toast.on { opacity: 1; }

/* ===== swing-trading-strategy-calculator.css ===== */
/* Swing Trading Strategy Calculator — page styles */

.page-wrap.page-full { grid-template-columns: 1fr; gap: 0; }
.page-wrap.page-full > main { padding-right: 0; }

/* Header bar */
.sw-bar {
  display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; margin-top: 14px; align-items: end;
}
@media (max-width: 800px) { .sw-bar { grid-template-columns: 1fr 1fr; } .sw-bar-actions { grid-column: span 2; } }

.sw-bar-input { display: flex; flex-direction: column; gap: 4px; }
.sw-bar-input label {
  font-size: 11px; color: var(--ink-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
}
.sw-bar-input input, .sw-bar-input select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 14px; background: #fff; color: var(--ink); width: 100%;
}
.sw-bar-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: end; }

.sw-btn {
  padding: 8px 14px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink);
}
.sw-btn:hover { border-color: var(--brand); color: var(--brand); }
.sw-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.sw-btn.primary:hover { background: #16385A; color: #fff; }
.sw-btn.danger { color: #B91C1C; }
.sw-btn.danger:hover { border-color: #B91C1C; background: #FBE2DC; }

/* KPIs */
.sw-kpis {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px;
}
@media (max-width: 1100px) { .sw-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .sw-kpis { grid-template-columns: repeat(2, 1fr); } }

.sw-kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px;
}
.sw-kpi .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--ink-3); }
.sw-kpi .val { font-size: 20px; font-weight: 700; color: var(--ink); margin-top: 2px; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.sw-kpi .val.pos { color: #0B7A2C; }
.sw-kpi .val.neg { color: #B91C1C; }
.sw-kpi .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.sw-kpi .sub.pos { color: #0B7A2C; }
.sw-kpi .sub.neg { color: #B91C1C; }

/* Two-column body */
.sw-body { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 1024px) { .sw-body { grid-template-columns: 1fr; } }
.sw-col { display: flex; flex-direction: column; gap: 12px; }

.sw-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px;
}
.sw-card h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--brand); font-weight: 700; margin: 0 0 10px;
}
.sw-help { font-size: 12px; color: var(--ink-2); margin: 0 0 10px; line-height: 1.5; }

/* Entries table */
.sw-table-wrap { overflow-x: auto; }
.sw-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.sw-table th, .sw-table td {
  padding: 8px 8px; text-align: left; border-bottom: 1px solid var(--line);
}
.sw-table th {
  font-weight: 700; color: var(--ink-2); background: #F4F6F8;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
}
.sw-table td.num { text-align: right; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.sw-table input {
  width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px;
  font: inherit; font-size: 13px; background: #fff;
}
.sw-table input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31,78,121,.12); }
.sw-table .rm {
  background: none; border: none; cursor: pointer; color: var(--ink-3);
  padding: 4px 8px; border-radius: 4px; font-size: 16px; line-height: 1;
}
.sw-table .rm:hover { background: #FBE2DC; color: #B91C1C; }
.sw-table tfoot td { background: #F4F6F8; font-weight: 700; }

#sw-add { margin-top: 10px; }

/* Per-account list */
.sw-acct {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  background: #FAFBFC; margin-bottom: 8px;
}
.sw-acct:last-child { margin-bottom: 0; }
.sw-acct-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
}
.sw-acct-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.sw-acct-name.empty { color: var(--ink-3); font-style: italic; }
.sw-acct-pnl { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 700; font-size: 14px; }
.sw-acct-pnl.pos { color: #0B7A2C; }
.sw-acct-pnl.neg { color: #B91C1C; }
.sw-acct-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 14px;
  font-size: 11.5px; color: var(--ink-2);
}
.sw-acct-stats b { color: var(--ink); font-family: 'JetBrains Mono', ui-monospace, monospace; }
.sw-acct-empty { font-size: 12px; color: var(--ink-3); font-style: italic; padding: 4px 0; }

/* Targets card */
.sw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sw-field { display: flex; flex-direction: column; gap: 4px; }
.sw-field label {
  font-size: 11px; color: var(--ink-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
}
.sw-field input {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 13px; background: #fff;
}
.sw-targets {
  margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.sw-target {
  background: #F4F6F8; border-radius: 6px; padding: 8px 10px; font-size: 12px;
}
.sw-target .lbl { color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; }
.sw-target .val { color: var(--ink); font-weight: 700; font-size: 14px; font-family: 'JetBrains Mono', ui-monospace, monospace; margin-top: 2px; }

/* Suggestion mode toggle + panes */
.sw-mode { display: flex; gap: 6px; margin-bottom: 10px; }
.sw-mode-btn {
  flex: 1; padding: 7px 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--ink-2); font-weight: 600;
}
.sw-mode-btn:hover { border-color: var(--brand); color: var(--brand); }
.sw-mode-btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.sw-mode-pane { display: none; }
.sw-mode-pane.on { display: block; }

.sw-suggest {
  margin-top: 10px; padding: 12px 14px;
  background: var(--brand-light, #E8F1FA); border-radius: 6px;
  font-size: 13px; line-height: 1.55; color: var(--ink);
}
.sw-suggest .big {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 700;
  font-size: 18px; color: var(--brand); display: block; margin: 4px 0;
}
.sw-suggest .pyr-rung {
  display: grid; grid-template-columns: 80px 1fr 1fr; gap: 8px;
  padding: 6px 0; border-top: 1px solid #DCE3EB; font-size: 12px;
}
.sw-suggest .pyr-rung:first-of-type { border-top: none; padding-top: 4px; }
.sw-suggest .pyr-rung b { font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--brand); }
.sw-suggest .warn { color: #B91C1C; font-weight: 600; }
.sw-suggest .ok   { color: #0B7A2C; font-weight: 600; }

/* ─── Printable strategy snapshot (PDF export only) ─────────
 * Hidden when not actively printing. We use [hidden] (display:none)
 * rather than off-screen positioning because html2canvas captures
 * the live element's bounding box — and a left:-9999px element ends
 * up with a negative-x bounding box that produces a blank PDF.
 *
 * Width is in mm so html2pdf maps it 1:1 onto an A4 page — using
 * 760 px overshot horizontally (A4 ≈ 794 px at 96 DPI) and pushed
 * bottom content onto a blank page 2. */
.sw-print-doc {
  width: 210mm; padding: 14mm 12mm; background: #fff;
  font-family: Arial, Helvetica, sans-serif; color: #1A1A1A;
  font-size: 10.5pt; line-height: 1.45;
  box-sizing: border-box;
  margin: 0 auto; /* centre when briefly visible during PDF generation */
}
.sw-print-doc[hidden] { display: none; }
.sw-print-doc h1 { font-size: 18pt; margin: 0 0 2pt; color: #1F4E79; }
.sw-print-doc .sub { font-size: 10pt; color: #4B5563; margin-bottom: 10pt; }
.sw-print-doc h2 {
  font-size: 11pt; text-transform: uppercase; letter-spacing: 1pt;
  color: #1A1A1A; border-bottom: 0.6pt solid #1A1A1A;
  padding-bottom: 2pt; margin: 12pt 0 6pt;
}
.sw-print-doc .kpis {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6pt 8pt;
  margin-bottom: 10pt;
}
.sw-print-doc .kpi {
  border: 0.5pt solid #B6C0CC; padding: 5pt 7pt; border-radius: 3pt;
}
.sw-print-doc .kpi .lbl { font-size: 7pt; text-transform: uppercase; letter-spacing: .04em; color: #4B5563; }
.sw-print-doc .kpi .val { font-size: 11pt; font-weight: 700; color: #1A1A1A; margin-top: 1pt; }
.sw-print-doc .kpi .val.pos { color: #0B7A2C; }
.sw-print-doc .kpi .val.neg { color: #B91C1C; }
.sw-print-doc table { width: 100%; border-collapse: collapse; }
.sw-print-doc th, .sw-print-doc td {
  border: 0.4pt solid #B6C0CC; padding: 3pt 5pt;
  text-align: left; font-size: 9pt; vertical-align: top;
}
.sw-print-doc th { background: #E8ECF1; font-weight: 700; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .03em; }
.sw-print-doc td.num { text-align: right; }
.sw-print-doc .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10pt; }
.sw-print-doc .acct {
  border: 0.5pt solid #B6C0CC; border-radius: 3pt; padding: 6pt 8pt; margin-bottom: 5pt;
}
.sw-print-doc .acct .name { font-weight: 700; font-size: 10pt; }
.sw-print-doc .acct .stats { font-size: 9pt; color: #4B5563; margin-top: 2pt; line-height: 1.5; }
.sw-print-doc .acct .pnl { float: right; font-weight: 700; }
.sw-print-doc .acct .pnl.pos { color: #0B7A2C; }
.sw-print-doc .acct .pnl.neg { color: #B91C1C; }
.sw-print-doc .targets { display: grid; grid-template-columns: 1fr 1fr; gap: 4pt 8pt; }
.sw-print-doc .targets div { font-size: 9pt; padding: 3pt 0; border-bottom: 0.3pt dotted #B6C0CC; }
.sw-print-doc .targets div b { color: #1A1A1A; }
.sw-print-doc .footer {
  margin-top: 14pt; padding-top: 6pt; border-top: 0.4pt solid #B6C0CC;
  font-size: 8pt; color: #8896A6; text-align: center;
}

/* ===== trading-journal.css ===== */
/* Trading Journal — page styles */

/* Full-width: sidebar is hidden on this page. */
.page-wrap.page-full { grid-template-columns: 1fr; gap: 0; }
.page-wrap.page-full > main { padding-right: 0; }

/* Action bar */
.tj-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 14px; margin-top: 14px;
}
.tj-btn {
  padding: 8px 14px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink);
}
.tj-btn:hover { border-color: var(--brand); color: var(--brand); }
.tj-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.tj-btn.primary:hover { background: #16385A; color: #fff; }
.tj-btn.danger { color: #B91C1C; }
.tj-btn.danger:hover { border-color: #B91C1C; background: #FBE2DC; }
.tj-btn.small { padding: 6px 10px; font-size: 12px; }
.tj-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.tj-count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* KPIs */
.tj-kpis {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 12px;
}
@media (max-width: 1100px) { .tj-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .tj-kpis { grid-template-columns: repeat(2, 1fr); } }

.tj-kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px;
}
.tj-kpi .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--ink-3); }
.tj-kpi .val { font-size: 20px; font-weight: 700; color: var(--ink); margin-top: 2px; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.tj-kpi .val.tj-small { font-size: 14px; }
.tj-kpi .val.pos { color: #0B7A2C; }
.tj-kpi .val.neg { color: #B91C1C; }
.tj-kpi .sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }

/* Filters */
.tj-filters {
  display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 14px; margin-top: 12px; align-items: end;
}
@media (max-width: 800px) { .tj-filters { grid-template-columns: 1fr 1fr; } }
.tj-filter { display: flex; flex-direction: column; gap: 4px; }
.tj-filter label { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tj-filter input, .tj-filter select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 13px; background: #fff; color: var(--ink);
}

/* Generic card */
.tj-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; margin-top: 12px;
}
.tj-card h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--brand); font-weight: 700; margin: 0 0 10px;
}

.tj-chart-card { padding: 14px 16px; }
.tj-chart-wrap { position: relative; width: 100%; min-height: 220px; }
.tj-chart-wrap canvas { width: 100% !important; height: 220px !important; }

/* Trades table */
.tj-table-wrap { overflow-x: auto; }
.tj-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 880px; }
.tj-table th, .tj-table td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tj-table th {
  font-weight: 700; color: var(--ink-2); background: #F4F6F8;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  position: sticky; top: 0;
}
.tj-table td.num { font-family: 'JetBrains Mono', ui-monospace, monospace; text-align: right; }
.tj-table td.pos { color: #0B7A2C; font-weight: 600; }
.tj-table td.neg { color: #B91C1C; font-weight: 600; }
.tj-table td.dim { color: var(--ink-3); font-style: italic; }
.tj-table .pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.tj-table .pill.long  { background: #E5F5EC; color: #0B7A2C; }
.tj-table .pill.short { background: #FBE2DC; color: #9A3A21; }
.tj-table .pill.open  { background: #FFF3D6; color: #8A5A00; }
.tj-row-actions button {
  background: none; border: none; cursor: pointer; color: var(--ink-3);
  padding: 4px 6px; border-radius: 4px; font-size: 13px;
}
.tj-row-actions button:hover { background: #F4F6F8; color: var(--brand); }
.tj-row-actions button.del:hover { background: #FBE2DC; color: #B91C1C; }

.tj-empty {
  text-align: center; padding: 32px 16px; color: var(--ink-3); font-size: 14px;
}

/* Inline add / edit form card (replaces the old modal)
 * Hidden by default; toggled by the + Add trade button. Lives in the
 * normal flow under the action bar so users see it appear right where
 * they clicked. */
.tj-form-card {
  background: #fff;
  border: 1px solid var(--brand);
  border-radius: var(--r-md);
  padding: 16px 20px 18px;
  margin-top: 12px;
  box-shadow: 0 2px 8px rgba(31, 78, 121, 0.08);
}
.tj-form-card[hidden] { display: none; }
.tj-form-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.tj-form-card-head h3 { margin: 0; font-size: 15px; color: var(--ink); }
.tj-form-close {
  background: none; border: none; cursor: pointer; font-size: 22px;
  color: var(--ink-3); padding: 2px 10px; border-radius: 4px; line-height: 1;
}
.tj-form-close:hover { background: #F4F6F8; color: var(--ink); }

.tj-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px;
}
@media (max-width: 600px) { .tj-form-grid { grid-template-columns: 1fr; } }
.tj-field { display: flex; flex-direction: column; gap: 4px; }
.tj-field.tj-wide { grid-column: span 2; }
@media (max-width: 600px) { .tj-field.tj-wide { grid-column: span 1; } }
.tj-field span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tj-field span em { color: #B91C1C; font-style: normal; margin-left: 2px; }
.tj-field input, .tj-field select, .tj-field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 13px; background: #fff; color: var(--ink); box-sizing: border-box;
}
.tj-field input:focus, .tj-field select:focus, .tj-field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,78,121,.12);
}
.tj-field textarea { resize: vertical; min-height: 60px; font-family: inherit; line-height: 1.45; }

.tj-form-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}

/* Print: blank journal + filled journal containers
 * Off-screen by default so they never paint on the live page. The
 * [hidden] re-assertion is required because .tj-print-* set position
 * (≥1,0,0 specificity) which beats the UA stylesheet for [hidden]. */
.tj-print-blank, .tj-print-data {
  position: absolute; left: -9999px; top: 0;
  background: #fff; padding: 12mm; font-family: Arial, Helvetica, sans-serif; color: #1A1A1A;
  font-size: 10pt;
}
.tj-print-blank[hidden], .tj-print-data[hidden] { display: none; }
.tj-print-blank table, .tj-print-data table { width: 100%; border-collapse: collapse; }
.tj-print-blank th, .tj-print-blank td,
.tj-print-data th,  .tj-print-data td {
  border: 0.5pt solid #1A1A1A; padding: 2mm 2mm;
  text-align: left; font-size: 9pt; vertical-align: top;
}
.tj-print-blank th, .tj-print-data th { background: #E8ECF1; font-weight: 700; font-size: 8.5pt; }
.tj-print-blank td { height: 9mm; color: #B6C0CC; }
.tj-print-data td.num { font-family: 'JetBrains Mono', ui-monospace, monospace; text-align: right; }
.tj-print-data td.pos { color: #0B7A2C; font-weight: 700; }
.tj-print-data td.neg { color: #B91C1C; font-weight: 700; }

@media print {
  /* Collapse the document so the browser doesn't reserve pages for the
     visibility:hidden remainder of the page. We use display:none on every
     direct child of <body> EXCEPT the print container — that takes those
     elements out of layout entirely so the printed document height equals
     just the printable content. */
  html, body {
    height: auto !important; min-height: 0 !important;
    margin: 0 !important; padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  /* Mode 1 — blank journal */
  body.tj-print-blank-mode > *:not(.tj-print-blank) { display: none !important; }
  body.tj-print-blank-mode .tj-print-blank {
    display: block !important;
    position: static !important; left: auto !important; top: auto !important;
    width: 100% !important; padding: 10mm !important;
    box-sizing: border-box !important;
  }
  body.tj-print-blank-mode .tj-print-blank tbody td {
    color: #fff !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }

  /* Mode 2 — filled journal (user trades) */
  body.tj-print-data-mode > *:not(.tj-print-data) { display: none !important; }
  body.tj-print-data-mode .tj-print-data {
    display: block !important;
    position: static !important; left: auto !important; top: auto !important;
    width: 100% !important; padding: 10mm !important;
    box-sizing: border-box !important;
  }
  body.tj-print-data-mode .tj-print-data td.pos { color: #0B7A2C !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.tj-print-data-mode .tj-print-data td.neg { color: #B91C1C !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  @page { size: A4 landscape; margin: 8mm; }
}

