/* ============ AUTH FORM PAGES (login, register, forgot, reset) ============ */
body.auth-page { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0f1923; display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; }
.login-box { background: #1a2d3d; padding: 40px; border-radius: 8px; width: 340px; max-width: 90%; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.login-box h1 { color: #e0e0e0; font-size: 22px; margin: 0 0 8px; text-align: center; }
.login-box p { color: #7a8a99; font-size: 13px; margin: 0 0 24px; text-align: center; }
.login-box label { color: #a0b0c0; font-size: 12px; font-weight: 600; display: block; margin-bottom: 4px; }
.login-box input { width: 100%; padding: 10px; border: 1px solid #2a3f52; border-radius: 4px; background: #0f1923; color: #e0e0e0; font-size: 14px; margin-bottom: 16px; box-sizing: border-box; }
.login-box input:focus { outline: none; border-color: #4a9eff; }
.login-box button { width: 100%; padding: 12px; background: #2563eb; color: #fff; border: none; border-radius: 4px; font-size: 14px; font-weight: 600; cursor: pointer; }
.login-box button:hover { background: #1d4ed8; }
.login-error { color: #ff6b6b; font-size: 12px; margin-bottom: 12px; }
.login-success { color: #4ade80; font-size: 12px; margin-bottom: 12px; text-align: center; }
.hp-field { position: absolute; left: -9999px; }

/* ============ MAIN APP ============ */
body { font-family: Arial, sans-serif; margin: 20px; background: #fff; }
h1 { color: #1a365d; }
h2 { color: #2d3748; margin-top: 25px; margin-bottom: 10px; }
h3 { margin-top: 18px; margin-bottom: 8px; }
.main-tab-content > h2:first-child, .main-tab-content > div + h2 { margin-top: 10px; }
table { border-collapse: collapse; width: 100%; margin: 15px 0; }
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; font-size: 13px; }
th { background: #00aa00; color: white; cursor: pointer; }
th:hover { background: #008800; }
tr:nth-child(even) { background: #f9f9f9; }
.btn { background: #00aa00; color: white; padding: 8px 16px; border: none; cursor: pointer; margin: 3px; text-decoration: none; display: inline-block; border-radius: 4px; font-size: 12px; }
.btn:hover { background: #008800; }
.btn-csv { background: #0066cc; }
.btn-csv:hover { background: #0055aa; }
.btn-edit { background: #ff9900; }
.btn-edit:hover { background: #cc7700; }
.btn-balance { background: #6600cc; }
.btn-balance:hover { background: #5500aa; }
.btn-danger { background: #cc0000; }
.btn-danger:hover { background: #990000; }
.btn-gray { background: #888; }
.btn-gray:hover { background: #666; }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.win { color: green; font-weight: bold; }
.loss { color: red; font-weight: bold; }
.even { color: gray; font-weight: bold; }
input.edit { width: 80px; padding: 4px; font-size: 12px; border: 1px solid #ccc; border-radius: 3px; }
.trend-up { color: green; font-weight: bold; }
.trend-down { color: red; font-weight: bold; }
.trend-flat { color: gray; }
tr.high-row { background: #ffffcc !important; }
tr.fade-row { background: #ffeeee !important; }
.balance-box { display: inline-block; background: #f5f5f5; border: 2px solid #00aa00; border-radius: 8px; padding: 15px 25px; margin: 8px; text-align: center; min-width: 120px; }
.balance-label { font-size: 11px; color: #666; text-transform: uppercase; }
.balance-value { font-size: 22px; font-weight: bold; color: #00aa00; }
.balance-value.cash { color: #0066cc; }
.balance-value.pnl-pos { color: green; }
.balance-value.pnl-neg { color: red; }
.settings-box { background: #fffacd; border: 1px solid #ff9900; border-radius: 5px; padding: 10px; margin: 10px 0; display: inline-block; font-size: 13px; }
.flash { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; padding: 10px 15px; border-radius: 5px; margin-bottom: 15px; animation: flashFade 4s forwards; }
@keyframes flashFade { 0% { opacity:1; } 70% { opacity:1; } 100% { opacity:0; height:0; padding:0; margin:0; border:0; overflow:hidden; } }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; }
.modal { background: white; margin: 80px auto; padding: 25px; width: 450px; border-radius: 10px; max-height: 80vh; overflow-y: auto; }
.modal h3 { margin-top: 0; }
.modal input, .modal select { width: 100%; padding: 8px; margin: 5px 0; box-sizing: border-box; }
.modal label { font-size: 13px; font-weight: bold; display: block; margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.page-controls { margin: 10px 0; }
.page-btn { background: #ddd; border: 1px solid #999; padding: 4px 10px; margin: 2px; cursor: pointer; }
.page-btn:hover { background: #bbb; }
.page-btn.active { background: #00aa00; color: white; border-color: #00aa00; }
.page-btn.disabled { background: #eee; color: #ccc; border-color: #ccc; cursor: default; pointer-events: none; }
.status-review { background: #ff9900; color: white; padding: 2px 6px; border-radius: 3px; }
.status-pending { background: #3b82f6; color: white; padding: 2px 6px; border-radius: 3px; }
.chart-settings { background: #f0f4f8; border: 2px solid #1a365d; border-radius: 8px; padding: 12px 20px; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 15px; align-items: center; }
.chart-settings label { font-size: 12px; font-weight: bold; color: #2d3748; }
.chart-settings select, .chart-settings input[type=checkbox] { margin-left: 5px; }
.chart-card { border: 2px solid #ddd; border-radius: 8px; overflow: hidden; position: relative; }
.chart-card.price-up { border-color: #22c55e; }
.chart-card.price-down { border-color: #ef4444; }
.chart-price-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #1a365d; color: white; }
.chart-price-bar .symbol-name { font-size: 16px; font-weight: bold; }
.chart-price-bar .live-price { font-size: 22px; font-weight: bold; }
.chart-price-bar .price-up { color: #4ade80; }
.chart-price-bar .price-down { color: #f87171; }
.chart-price-bar .price-change { font-size: 13px; margin-left: 8px; }
.chart-price-bar .price-details { font-size: 11px; color: #94a3b8; }
.chart-toggle-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chart-toggle-list label { display: flex; align-items: center; gap: 3px; font-size: 12px; background: #e2e8f0; padding: 3px 8px; border-radius: 4px; cursor: pointer; }
.refresh-indicator { font-size: 11px; color: #666; margin-left: 10px; }
.refresh-active { color: #22c55e; font-weight: bold; }
.snapshot-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 16px 0; }
.snap-box { background: #f5f5f5; border: 1px solid #ddd; border-radius: 6px; padding: 10px 16px; text-align: center; min-width: 100px; }
.snap-box .snap-label { font-size: 10px; color: #666; text-transform: uppercase; font-weight: bold; }
.snap-box .snap-value { font-size: 18px; font-weight: bold; color: #1a365d; }
.snap-box .snap-value.snap-win { color: green; }
.snap-box .snap-value.snap-loss { color: red; }
.snap-box .snap-sub { font-size: 10px; color: #888; }
.snap-divider { border-left: 2px solid #ddd; margin: 0 5px; }
.snap-model-row { display: flex; gap: 15px; margin: 8px 0 16px 0; }
.snap-model { background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 6px; padding: 8px 14px; font-size: 12px; }
.snap-model strong { color: #1a365d; }
.collapse-toggle { cursor: pointer; user-select: none; }
.collapse-toggle::after { content: ' ▼'; font-size: 12px; color: #888; }
.collapse-toggle.collapsed::after { content: ' ►'; }
.collapsible { overflow: hidden; }
.collapsible.collapsed { display: none; }

/* ============ MAIN PAGE TABS ============ */
.main-tab-bar { display: flex; gap: 0; background: #f5f5f5; border-bottom: 2px solid #00aa00; margin: 0 0 15px 0; }
.main-tab-btn { font-size: 14px; font-weight: 700; color: #666; padding: 12px 24px; border: none; background: #f5f5f5; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.main-tab-btn:hover { color: #333; background: #eee; }
.main-tab-btn.active { color: #00aa00; background: white; border-bottom-color: #00aa00; }
.main-tab-content { display: none; padding-top: 10px; }
.main-tab-content.active { display: block; }

/* ============ MARKET INTEL ============ */
.mi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mi-panel { border: 1px solid #ddd; overflow: hidden; }
.mi-panel-full { border: 1px solid #ddd; margin-top: 15px; }
.mi-panel-header { background: #1a365d; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; }
.mi-panel-header h3 { font-size: 13px; font-weight: 700; color: white; margin: 0; }
.mi-badge { font-size: 11px; padding: 2px 8px; border-radius: 3px; font-weight: 700; }
.mi-badge-green { background: rgba(0,170,0,0.2); color: #00aa00; }
.mi-badge-red { background: rgba(204,0,0,0.2); color: #cc0000; }
.mi-badge-blue { background: rgba(0,102,204,0.2); color: #0066cc; }
.mi-badge-yellow { background: rgba(255,153,0,0.2); color: #ff9900; }
.mi-panel-body { max-height: 380px; overflow-y: auto; }
.mi-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mi-table th { font-size: 10px; font-weight: 700; color: #666; text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 10px; background: #f9f9f9; border-bottom: 1px solid #ddd; text-align: left; position: sticky; top: 0; z-index: 1; }
.mi-table td { padding: 5px 10px; border-bottom: 1px solid #f0f0f0; font-size: 12px; }
.mi-table tr:hover { background: #f5fff5; }
.mi-sym { font-weight: 700; color: #1a365d; }
.mi-sym.mi-owned { color: #00aa00; }
.mi-sym.mi-owned::after { content: ' ●'; font-size: 7px; vertical-align: super; }
.mi-gain { color: #00aa00; font-weight: 700; }
.mi-loss { color: #cc0000; font-weight: 700; }
.mi-vol { color: #0066cc; }
.mi-range-bar { width: 50px; height: 4px; background: #e0e0e0; border-radius: 2px; display: inline-block; vertical-align: middle; position: relative; }
.mi-range-bar .mi-fill { height: 100%; border-radius: 2px; position: absolute; left: 0; top: 0; }
.mi-picks-bar { display: flex; gap: 8px; padding: 10px 14px; flex-wrap: wrap; background: #fffdf0; border: 1px solid #ddd; margin-bottom: 15px; }
.mi-pick-chip { font-size: 11px; padding: 4px 10px; border-radius: 4px; border: 1px solid #ddd; background: white; display: flex; gap: 6px; align-items: center; }
.mi-pick-chip .mi-chip-sym { font-weight: 700; color: #1a365d; }
.mi-pick-chip .mi-chip-model { color: #999; font-size: 10px; }
.mi-pick-chip .mi-chip-price { color: #0066cc; }
.mi-pick-chip.mi-chip-bought { border-color: #00aa00; background: #f0fff0; }
.mi-pick-chip.mi-chip-review { border-color: #ff9900; background: #fffdf0; }

/* Market Intel sub-tabs */
.mi-tab-bar { display: flex; background: #f5f5f5; border-bottom: 1px solid #ddd; margin-bottom: 12px; }
.mi-tab-btn { font-size: 12px; font-weight: 600; color: #666; padding: 8px 16px; border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; }
.mi-tab-btn:hover { color: #333; }
.mi-tab-btn.active { color: #00aa00; border-bottom-color: #00aa00; }
.mi-tab-content { display: none; padding-top: 10px; }
.mi-tab-content.active { display: block; }
.mi-widget { height: 480px; }

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