* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; color: #1a1a1a; background: #f7f7f5; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.nav { background: #fff; border-bottom: 1px solid #e5e5e0; }
.nav-inner { max-width: 1400px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 24px; }
.nav-inner strong { font-size: 16px; }
.nav nav { display: flex; gap: 16px; flex: 1; }
.nav nav a { color: #555; padding: 6px 10px; border-radius: 6px; }
.nav nav a.active { background: #eef2ff; color: #2563eb; }
.logout { color: #888; font-size: 13px; }

.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
.foot { max-width: 1400px; margin: 24px auto; padding: 16px 20px; font-size: 12px; color: #888; }

h1 { font-size: 22px; margin: 0 0 8px; font-weight: 600; }
h2 { font-size: 16px; margin: 28px 0 10px; font-weight: 600; }
.muted { color: #888; }
.pos { color: #15803d; }
.neg { color: #b91c1c; }
.alert { background: #fee; color: #b91c1c; padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 13px; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; padding: 32px; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); width: 320px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { text-align: center; margin-bottom: 8px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #555; }

/* Forms */
input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], select {
  border: 1px solid #d4d4d0; border-radius: 6px; padding: 8px 10px; font-size: 13px; background: #fff; font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px #dbeafe; }
button { background: #2563eb; color: #fff; border: none; padding: 9px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; font-weight: 500; }
button:hover { background: #1d4ed8; }
.link-btn { background: none; color: #b91c1c; padding: 0; font-size: 12px; }
.link-btn:hover { background: none; text-decoration: underline; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; padding: 14px; background: #fff; border-radius: 8px; border: 1px solid #e5e5e0; }
.filter { display: flex; flex-direction: column; gap: 4px; }
.filter label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.03em; }
.filter input, .filter select { min-width: 140px; }
.check { flex-direction: row !important; align-items: center; gap: 6px; padding-top: 8px; text-transform: none !important; }

/* Weights */
.weights { background: #fff; border: 1px solid #e5e5e0; border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.weights-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.weights-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.w .wlbl { font-size: 12px; color: #555; display: flex; justify-content: space-between; margin-bottom: 4px; }
.w input[type="range"] { width: 100%; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e5e0; border-radius: 8px; overflow: hidden; }
table.data th, table.data td { padding: 9px 10px; text-align: left; font-size: 13px; border-bottom: 1px solid #f0f0eb; }
table.data th { background: #fafaf7; font-weight: 600; color: #555; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; cursor: pointer; user-select: none; }
table.data tbody tr:hover { background: #fafaf7; }
table.data td.r, table.data th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: none; }

.score-pill { display: inline-block; min-width: 36px; padding: 3px 8px; background: #eef2ff; color: #2563eb; border-radius: 4px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.star { cursor: pointer; color: #ccc; font-size: 16px; user-select: none; }
.star.on { color: #f59e0b; }

/* Portfolio */
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid #e5e5e0; border-radius: 8px; padding: 14px 16px; }
.kpi .lbl { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
.kpi .val { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .val .sub { font-size: 13px; font-weight: 400; margin-left: 6px; }

.tx-form { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.5fr 2fr auto; gap: 8px; background: #fff; padding: 14px; border-radius: 8px; border: 1px solid #e5e5e0; margin-bottom: 16px; }
.tx-form input, .tx-form select { width: 100%; }

.side-buy { color: #15803d; font-weight: 600; }
.side-sell { color: #b91c1c; font-weight: 600; }

@media (max-width: 900px) {
  .tx-form { grid-template-columns: 1fr 1fr; }
}
