:root {
  --bg: #0f1115; --panel: #171a21; --line: #262b35; --text: #e7e9ee; --muted: #8b93a3;
  --accent: #3b82f6; --green: #22c55e; --red: #ef4444; --amber: #f59e0b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 17px; margin: 18px 0 10px; }
nav { display: flex; gap: 4px; padding: 8px 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
nav button { background: none; border: none; color: var(--muted); padding: 8px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
nav button.active { background: var(--panel); color: var(--text); }
main { padding: 8px 24px 40px; max-width: 1100px; }
.hidden { display: none !important; }
.portfolio-bar { display: flex; gap: 8px; }
button { background: var(--accent); color: #fff; border: none; padding: 8px 14px; border-radius: 6px; cursor: pointer; font: inherit; margin: 8px 8px 0 0; }
button.ghost { background: var(--panel); border: 1px solid var(--line); color: var(--text); }
button.danger { background: var(--red); }
button.link { background: none; color: var(--muted); padding: 2px 6px; margin: 0; }
button:disabled { opacity: .5; cursor: default; }
input, select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font: inherit; width: 100%; }
table input { padding: 4px 6px; max-width: 120px; text-align: right; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.card span { display: block; color: var(--muted); font-size: 13px; }
.card strong { font-size: 22px; font-weight: 600; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
tfoot td { border-bottom: none; font-weight: 600; }
.r { text-align: right; }
.pos { color: var(--green); } .neg { color: var(--red); } .warn { color: var(--amber); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.row-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
label.check input { width: auto; }
.msg { padding: 10px 14px; border-radius: 8px; margin-top: 14px; }
.msg.ok { background: #14301f; color: #86efac; } .msg.err { background: #3a1616; color: #fca5a5; }
hr { border: none; border-top: 1px solid var(--line); margin: 24px 0 8px; }
details { margin-bottom: 16px; } summary { cursor: pointer; color: var(--accent); }
