/* Global & Reset */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background-color: #0f172a; color: #f8fafc; min-height: 100vh; padding-bottom: 80px; transition: background-color 0.3s, color 0.3s; }
body.light { background-color: #f1f5f9; color: #0f172a; }

/* Header & Nav */
header { position: sticky; top: 0; z-index: 50; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(8px); border-bottom: 1px solid #1e293b; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
body.light header { background: rgba(255, 255, 255, 0.95); border-bottom: 1px solid #e2e8f0; }
.logo-title { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.badge { font-size: 0.7rem; background: rgba(59, 130, 246, 0.2); color: #60a5fa; padding: 2px 6px; rounded: 4px; border: 1px solid rgba(59, 130, 246, 0.3); }

/* Banner */
.banner { background: #1e293b; border-left: 4px solid #3b82f6; padding: 10px 14px; margin: 12px 16px 0 16px; border-radius: 6px; font-size: 0.85rem; color: #94a3b8; display: flex; justify-content: space-between; align-items: center; }
body.light .banner { background: #ffffff; color: #475569; border-left-color: #2563eb; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

/* Cards & Grid */
.container { padding: 16px; max-width: 800px; margin: 0 auto; }
.card { background: #1e293b; border-radius: 12px; padding: 16px; margin-bottom: 16px; border: 1px solid #334155; }
body.light .card { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 2px 4px rgba(0,0,0,0.04); }
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; color: #60a5fa; }
body.light .card-title { color: #2563eb; }

/* Inputs & Buttons */
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; color: #94a3b8; }
body.light .form-label { color: #64748b; }
.form-control { width: 100%; padding: 10px 12px; background: #0f172a; border: 1px solid #334155; border-radius: 8px; color: #f8fafc; font-size: 0.9rem; }
body.light .form-control { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
.form-control:focus { outline: none; border-color: #3b82f6; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; font-weight: 600; font-size: 0.9rem; border-radius: 8px; border: none; cursor: pointer; transition: opacity 0.2s; width: 100%; }
.btn:active { opacity: 0.8; }
.btn-primary { background: #2563eb; color: #ffffff; }
.btn-secondary { background: #334155; color: #f8fafc; }
body.light .btn-secondary { background: #e2e8f0; color: #0f172a; }
.btn-success { background: #16a34a; color: #ffffff; }
.btn-danger { background: #dc2626; color: #ffffff; }
.btn-sm { padding: 4px 8px; font-size: 0.75rem; border-radius: 4px; width: auto; }

/* Flex & Grid Utils */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 0.75rem; padding: 4px 8px; background: #0f172a; border: 1px solid #334155; border-radius: 16px; cursor: pointer; color: #94a3b8; }
body.light .chip { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }
.chip.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Stats & PnL */
.stat-val { font-size: 1.4rem; font-weight: 700; margin-top: 2px; }
.text-profit { color: #4ade80; }
.text-loss { color: #f87171; }
body.light .text-profit { color: #16a34a; }
body.light .text-loss { color: #dc2626; }

/* Bottom Nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #0f172a; border-top: 1px solid #1e293b; display: flex; justify-content: space-around; padding: 8px 0; z-index: 100; }
body.light .bottom-nav { background: #ffffff; border-top-color: #e2e8f0; }
.nav-item { display: flex; flex-col; align-items: center; justify-content: center; color: #64748b; font-size: 0.7rem; text-decoration: none; border: none; background: none; cursor: pointer; flex: 1; }
.nav-item.active { color: #3b82f6; font-weight: 700; }
.nav-icon { font-size: 1.2rem; margin-bottom: 2px; }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 0.8rem; }
.cal-head { font-weight: 600; color: #64748b; padding: 4px; }
.cal-day { background: #0f172a; border: 1px solid #334155; border-radius: 6px; padding: 6px 2px; min-height: 52px; display: flex; flex-direction: column; justify-content: space-between; }
body.light .cal-day { background: #f8fafc; border-color: #e2e8f0; }
.cal-date { font-size: 0.7rem; color: #94a3b8; }
.cal-pnl { font-size: 0.65rem; font-weight: 700; word-break: break-all; }

/* Hidden Tabs */
.tab-content { display: none; }
.tab-content.active { display: block; }
