* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0f1923;
  --bg2: #1a2b3c;
  --bg3: #243b55;
  --ink: #e8edf2;
  --muted: #8a9bb0;
  --accent: #3b82f6;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --border: #2d4055;
}
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); }
.topnav { display: flex; align-items: center; background: var(--bg2); padding: 0 20px; height: 56px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-brand { font-size: 18px; font-weight: 700; margin-right: 32px; white-space: nowrap; }
.nav-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-tab { background: transparent; border: none; color: var(--muted); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 14px; transition: all .2s; }
.nav-tab:hover { background: var(--bg3); color: var(--ink); }
.nav-tab.active { background: var(--accent); color: #fff; }
.view { display: none; padding: 20px; max-width: 1400px; margin: 0 auto; }
.view.active { display: block; }
.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.view-header h2 { font-size: 22px; }
.date-picker, .controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
input[type=date], input[type=text], select { background: var(--bg2); border: 1px solid var(--border); color: var(--ink); padding: 6px 12px; border-radius: 6px; font-size: 14px; }
input[type=text] { width: 160px; }
textarea { background: var(--bg2); border: 1px solid var(--border); color: var(--ink); padding: 8px 12px; border-radius: 6px; font-size: 13px; font-family: 'Consolas', monospace; flex: 1; min-width: 300px; }
.btn { padding: 6px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 500; transition: opacity .2s; }
.btn:hover { opacity: .85; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-add { background: var(--bg3); color: var(--ink); border: 1px solid var(--border); }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-danger { background: var(--red); color: #fff; }
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; }
.stat-card .label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stat-card .value { font-size: 24px; font-weight: 700; }
.stat-card .sub { font-size: 12px; margin-top: 4px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.chart-row { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.chart-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; flex: 1; min-width: 350px; height: 340px; position: relative; }
.chart-wide { width: 100%; }
.table-section { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 20px; overflow-x: auto; }
.table-section h3 { margin-bottom: 12px; font-size: 16px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 8px 10px; color: var(--muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tr:hover { background: var(--bg3); }
.edit-table input, .edit-table select { width: 100%; min-width: 60px; padding: 4px 6px; font-size: 13px; }
.edit-table td { padding: 4px 6px; }
.paste-section { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.paste-section h3 { margin-bottom: 12px; }
.paste-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.paste-row textarea { flex: 1; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-green { background: rgba(16,185,129,.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,.15); color: var(--red); }
.badge-yellow { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge-blue { background: rgba(59,130,246,.15); color: var(--accent); }
@media (max-width: 768px) {
  .nav-brand { font-size: 16px; }
  .nav-tab { padding: 6px 10px; font-size: 13px; }
  .chart-box { min-width: 100%; }
}
