/* TimeMarket.org - Polymarket Style */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f5f5f7;
    --bg-card: #ffffff;
    --bg-hover: #fafafa;
    --bg-input: #f5f5f7;
    --border: #e8e8ec;
    --border2: #d4d4d8;
    --text: #14151a;
    --text2: #5c5e6a;
    --text3: #9194a1;
    --yes: #00875a;
    --yes-bg: #e6f4ee;
    --yes-hover: #d0ebdf;
    --no: #dc3545;
    --no-bg: #fce8ea;
    --no-hover: #f8d0d4;
    --blue: #2563eb;
    --blue-bg: #eff4ff;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 1px 5px rgba(0,0,0,0.02);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --transition: 150ms ease;
}

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---- Header ---- */
header { background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 20px; max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; cursor: pointer; flex-shrink: 0; }
.logo svg rect { fill: var(--text); }
.logo svg path { fill: var(--bg-card); }
.logo-text { font-size: 17px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); }

.search-wrap { position: relative; flex: 1; max-width: 420px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text3); pointer-events: none; }
#search-input { width: 100%; padding: 9px 14px 9px 38px; background: var(--bg-input); border: 1px solid transparent; border-radius: 24px; color: var(--text); font-size: 14px; outline: none; transition: all var(--transition); }
#search-input:focus { background: var(--bg-card); border-color: var(--border2); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
#search-input::placeholder { color: var(--text3); }

#main-nav { display: flex; gap: 2px; }
.nav-link { color: var(--text2); font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 8px; transition: all var(--transition); }
.nav-link:hover { color: var(--text); background: var(--bg-input); }
.nav-link.active { color: var(--text); background: var(--bg-input); font-weight: 600; }

#auth-area { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.balance-badge { background: var(--yes-bg); color: var(--yes); padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--transition); }
.balance-badge:hover { background: var(--yes-hover); }
.user-menu { position: relative; }
.user-btn { background: var(--bg-input); border: 1px solid var(--border); color: var(--text); padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; transition: all var(--transition); }
.user-btn:hover { background: var(--bg); border-color: var(--border2); }
.user-dropdown { display: none; position: absolute; top: calc(100% + 6px); right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 170px; overflow: hidden; box-shadow: var(--shadow-lg); z-index: 200; }
.user-dropdown.show { display: block; animation: dropIn 0.12s ease; }
.user-dropdown a { display: block; padding: 11px 18px; color: var(--text2); font-size: 14px; transition: all var(--transition); }
.user-dropdown a:hover { background: var(--bg-input); color: var(--text); }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---- Home ---- */
.home-top { padding: 24px 0 0; }
.home-top h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }

.cat-bar { display: flex; gap: 8px; padding: 16px 0; overflow-x: auto; scrollbar-width: none; }
.cat-bar::-webkit-scrollbar { display: none; }
.cat-pill { padding: 8px 18px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text2); border-radius: 24px; font-size: 14px; font-weight: 500; white-space: nowrap; transition: all var(--transition); flex-shrink: 0; }
.cat-pill:hover { border-color: var(--border2); color: var(--text); }
.cat-pill.active { background: var(--text); color: #fff; border-color: var(--text); }

.sort-bar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; }
.sort-left { display: flex; gap: 2px; }
.sort-pill { padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--text3); border-radius: 6px; transition: all var(--transition); }
.sort-pill:hover { color: var(--text2); background: var(--bg-input); }
.sort-pill.active { color: var(--text); background: var(--bg-input); font-weight: 600; }
.market-count { font-size: 13px; color: var(--text3); }

/* ---- Market Cards ---- */
.markets-grid { display: flex; flex-direction: column; gap: 8px; padding-bottom: 48px; }

.market-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); transition: all var(--transition); box-shadow: var(--shadow-card); }
.market-card:hover { border-color: var(--border2); box-shadow: var(--shadow); }

.mc-body { padding: 16px 20px; cursor: pointer; display: flex; align-items: center; gap: 20px; }
.mc-info { flex: 1; min-width: 0; }
.mc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mc-cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; padding: 2px 8px; border-radius: 4px; }
.mc-cat-crypto { background: #fff3e0; color: #e65100; }
.mc-cat-economics { background: #e8f5e9; color: #2e7d32; }
.mc-cat-tech { background: #f3e5f5; color: #7b1fa2; }
.mc-cat-science { background: #e3f2fd; color: #1565c0; }
.mc-cat-sports { background: #fce4ec; color: #c62828; }
.mc-cat-politics { background: #fff8e1; color: #f57f17; }
.mc-cat-other { background: #f5f5f5; color: #616161; }
.mc-time { font-size: 12px; color: var(--text3); }
.mc-title { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text3); margin-top: 4px; }

/* Right side: probability + buy buttons */
.mc-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.mc-prob-big { font-size: 28px; font-weight: 800; letter-spacing: -1px; color: var(--text); min-width: 60px; text-align: right; }
.mc-prob-sub { font-size: 11px; color: var(--text3); font-weight: 500; text-align: right; }

.mc-buy-btns { display: flex; gap: 6px; }
.mc-buy-btn { padding: 10px 20px; border-radius: var(--radius-xs); font-size: 14px; font-weight: 700; transition: all var(--transition); min-width: 72px; text-align: center; }
.mc-buy-yes { background: var(--yes-bg); color: var(--yes); }
.mc-buy-yes:hover { background: var(--yes-hover); }
.mc-buy-no { background: var(--no-bg); color: var(--no); }
.mc-buy-no:hover { background: var(--no-hover); }
.mc-buy-label { display: block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; margin-bottom: 1px; }
.mc-buy-pct { display: block; font-size: 16px; font-weight: 800; }

/* ---- Market Detail ---- */
.back-btn { background: none; color: var(--text3); font-size: 13px; padding: 20px 0 8px; display: flex; align-items: center; gap: 4px; font-weight: 500; }
.back-btn:hover { color: var(--text); }
.back-btn svg { width: 16px; height: 16px; }

.market-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; padding-bottom: 48px; align-items: start; }
@media (max-width: 900px) { .market-layout { grid-template-columns: 1fr; } }

.market-header { margin-bottom: 20px; }
.market-title { font-size: 24px; font-weight: 700; line-height: 1.3; margin: 8px 0 14px; letter-spacing: -0.3px; }
.market-desc { color: var(--text2); font-size: 14px; line-height: 1.7; margin-bottom: 20px; padding: 16px; background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border); }

.market-stats-row { display: flex; gap: 32px; flex-wrap: wrap; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.mstat-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.mstat-value { font-size: 16px; font-weight: 700; margin-top: 2px; }

.prob-display { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 24px 0; }
.prob-card { border-radius: var(--radius-sm); padding: 24px 20px; text-align: center; }
.prob-card-yes { background: var(--yes-bg); border: 1px solid #c3e6d5; }
.prob-card-no { background: var(--no-bg); border: 1px solid #f0c0c5; }
.prob-side { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.prob-card-yes .prob-side { color: var(--yes); }
.prob-card-no .prob-side { color: var(--no); }
.prob-num { font-size: 48px; font-weight: 800; letter-spacing: -2px; line-height: 1; }
.prob-card-yes .prob-num { color: var(--yes); }
.prob-card-no .prob-num { color: var(--no); }
.prob-cents { font-size: 13px; color: var(--text3); margin-top: 6px; }

.resolved-banner { padding: 18px; border-radius: var(--radius-sm); margin: 20px 0; font-size: 15px; text-align: center; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.resolved-banner.yes { background: var(--yes-bg); color: var(--yes); border: 1px solid #c3e6d5; }
.resolved-banner.no { background: var(--no-bg); color: var(--no); border: 1px solid #f0c0c5; }
.resolved-banner svg { width: 20px; height: 20px; }

/* Activity */
.activity-section { margin-top: 28px; }
.activity-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: var(--text2); }
.activity-list { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.activity-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.activity-item:last-child { border-bottom: none; }
.activity-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-input); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text3); flex-shrink: 0; }
.activity-text { flex: 1; color: var(--text2); }
.activity-text strong { color: var(--text); font-weight: 600; }
.activity-action-buy { color: var(--yes); font-weight: 600; }
.activity-action-sell { color: var(--no); font-weight: 600; }
.activity-time { color: var(--text3); font-size: 12px; white-space: nowrap; }
.activity-amount { font-weight: 700; white-space: nowrap; }

/* ---- Trade Panel ---- */
.trade-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); position: sticky; top: 72px; overflow: hidden; box-shadow: var(--shadow-card); }

.trade-tabs { display: flex; border-bottom: 1px solid var(--border); }
.trade-tab { flex: 1; padding: 14px; font-size: 14px; font-weight: 600; color: var(--text3); transition: all var(--transition); text-align: center; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.trade-tab:hover { color: var(--text2); }
.trade-tab.active { color: var(--text); border-bottom-color: var(--text); }

.trade-body { padding: 20px; }

.outcome-btns { display: flex; gap: 8px; margin-bottom: 20px; }
.outcome-btn { flex: 1; padding: 16px 12px; border-radius: var(--radius-sm); transition: all var(--transition); text-align: center; border: 2px solid transparent; cursor: pointer; }
.outcome-btn-yes { background: var(--yes-bg); color: var(--yes); }
.outcome-btn-yes.active { border-color: var(--yes); background: var(--yes-hover); }
.outcome-btn-no { background: var(--no-bg); color: var(--no); }
.outcome-btn-no.active { border-color: var(--no); background: var(--no-hover); }
.outcome-price { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.outcome-label { display: block; font-size: 12px; font-weight: 600; margin-top: 2px; opacity: 0.8; }

.trade-input-section { margin-bottom: 16px; }
.trade-input-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text3); margin-bottom: 8px; font-weight: 500; }
.trade-input-wrap { position: relative; }
.trade-input-wrap .currency { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text3); font-weight: 600; font-size: 16px; }
#trade-amount { width: 100%; padding: 14px 16px 14px 30px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); font-size: 18px; font-weight: 700; outline: none; transition: all var(--transition); }
#trade-amount:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); background: var(--bg-card); }

.preset-amounts { display: flex; gap: 6px; margin-top: 10px; }
.preset-btn { flex: 1; padding: 8px 4px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: 13px; font-weight: 600; color: var(--text2); transition: all var(--transition); text-align: center; }
.preset-btn:hover { border-color: var(--border2); color: var(--text); }
.preset-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); }

.trade-details { background: var(--bg-input); border-radius: var(--radius-xs); padding: 14px 16px; margin-bottom: 16px; }
.trade-detail-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.trade-detail-row span:first-child { color: var(--text3); }
.trade-detail-row span:last-child { font-weight: 600; color: var(--text); }
.trade-detail-row.highlight { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 10px; }
.trade-detail-row.highlight span:last-child { font-weight: 800; font-size: 14px; }
.return-positive { color: var(--yes) !important; }

.trade-balance-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 13px; }
.trade-balance-row span:first-child { color: var(--text3); }
.trade-balance-row a { color: var(--blue); font-weight: 600; font-size: 12px; }

.trade-submit { width: 100%; padding: 16px; border-radius: var(--radius-sm); font-size: 16px; font-weight: 700; transition: all var(--transition); letter-spacing: -0.2px; }
.trade-submit-yes { background: var(--yes); color: #fff; }
.trade-submit-yes:hover { filter: brightness(1.08); }
.trade-submit-no { background: var(--no); color: #fff; }
.trade-submit-no:hover { filter: brightness(1.08); }
.trade-submit:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }

.trade-login { padding: 40px 20px; text-align: center; }
.trade-login p { color: var(--text3); margin-bottom: 16px; font-size: 14px; }

.trade-error { color: var(--no); font-size: 13px; margin-top: 10px; text-align: center; }
.panel-closed { color: var(--text3); padding: 48px 20px; text-align: center; font-size: 14px; }

/* ---- Portfolio ---- */
.page-title { font-size: 24px; font-weight: 700; padding: 28px 0 20px; letter-spacing: -0.3px; }

.portfolio-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 28px; }
@media (max-width: 768px) { .portfolio-grid { grid-template-columns: repeat(2, 1fr); } }
.pf-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; box-shadow: var(--shadow-card); }
.pf-card-highlight { border-color: var(--border2); }
.pf-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.pf-value { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -0.5px; }
.pf-actions { display: flex; gap: 8px; margin-top: 12px; }

.section-title { font-size: 15px; font-weight: 600; margin: 24px 0 14px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; font-size: 12px; }

.positions-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 28px; }
.position-card { display: grid; grid-template-columns: 1fr auto auto auto; gap: 20px; align-items: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 20px; cursor: pointer; transition: all var(--transition); box-shadow: var(--shadow-card); }
.position-card:hover { border-color: var(--border2); box-shadow: var(--shadow); }
@media (max-width: 768px) { .position-card { grid-template-columns: 1fr 1fr; gap: 10px; } }
.pos-market { font-size: 14px; font-weight: 600; line-height: 1.3; }
.pos-side { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-top: 4px; }
.pos-side-yes { background: var(--yes-bg); color: var(--yes); }
.pos-side-no { background: var(--no-bg); color: var(--no); }
.pos-detail { text-align: right; }
.pos-detail-label { font-size: 11px; color: var(--text3); font-weight: 500; }
.pos-detail-value { font-size: 15px; font-weight: 700; }

.ledger-list { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-card); }
.ledger-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ledger-item:last-child { border-bottom: none; }
.ledger-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.ledger-icon-deposit, .ledger-icon-signup_bonus { background: var(--yes-bg); color: var(--yes); }
.ledger-icon-withdrawal { background: var(--no-bg); color: var(--no); }
.ledger-icon-buy { background: var(--blue-bg); color: var(--blue); }
.ledger-icon-sell { background: #fff8e1; color: #f57f17; }
.ledger-icon-payout { background: #f3e5f5; color: #7b1fa2; }
.ledger-info { flex: 1; }
.ledger-type { font-weight: 600; text-transform: capitalize; }
.ledger-note { color: var(--text3); font-size: 12px; margin-top: 1px; }
.ledger-amount { font-weight: 700; text-align: right; }
.ledger-time { color: var(--text3); font-size: 12px; text-align: right; white-space: nowrap; }

/* ---- Admin ---- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 28px; }
.admin-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; text-align: center; box-shadow: var(--shadow-card); }
.admin-stat.highlight { background: var(--yes-bg); border-color: #c3e6d5; }
.admin-stat-val { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.admin-stat.highlight .admin-stat-val { color: var(--yes); }
.admin-stat-label { font-size: 11px; color: var(--text3); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

.create-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-card); }
.create-form .input { margin-bottom: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-card); }
.admin-table th { text-align: left; color: var(--text3); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg-input); }
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.admin-table tbody tr { transition: background var(--transition); }
.admin-table tbody tr:hover { background: var(--bg-hover); }
.admin-table .market-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; cursor: pointer; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border: none; border-radius: var(--radius-xs); font-size: 14px; font-weight: 600; transition: all var(--transition); }
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-outline { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--border2); background: var(--bg-input); }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-xs { padding: 5px 12px; font-size: 12px; border-radius: 5px; }
.btn-full { width: 100%; }
.btn-yes { background: var(--yes-bg); color: var(--yes); border: 1px solid #c3e6d5; }
.btn-yes:hover { background: var(--yes-hover); }
.btn-no { background: var(--no-bg); color: var(--no); border: 1px solid #f0c0c5; }
.btn-no:hover { background: var(--no-hover); }

/* ---- Inputs ---- */
.input { width: 100%; padding: 11px 16px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); outline: none; transition: all var(--transition); }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); background: var(--bg-card); }
.input::placeholder { color: var(--text3); }
textarea.input { resize: vertical; }
select.input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239194a1' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ---- Modal ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); animation: fadeIn 0.15s ease; }
.modal { background: var(--bg-card); border-radius: 16px; width: 420px; max-width: 92vw; box-shadow: var(--shadow-lg); animation: scaleIn 0.2s ease; overflow: hidden; }
.modal h3 { font-size: 18px; font-weight: 700; padding: 24px 24px 16px; }
.modal-body { padding: 0 24px 24px; }
.modal .input { margin-bottom: 12px; }
.modal-tabs { display: flex; }
.modal-tab { flex: 1; padding: 16px; background: transparent; border: none; border-bottom: 2px solid var(--border); color: var(--text3); font-size: 15px; font-weight: 600; transition: all var(--transition); }
.modal-tab.active { color: var(--text); border-bottom-color: var(--blue); }
.modal-note { font-size: 13px; color: var(--text3); margin-top: 14px; text-align: center; }
.form-error { color: var(--no); font-size: 13px; margin: 8px 0; min-height: 18px; }

/* ---- Toast ---- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 14px 28px; border-radius: 10px; font-size: 14px; font-weight: 500; z-index: 2000; animation: toastIn 0.2s ease; box-shadow: var(--shadow-lg); }
.toast-info { background: var(--text); color: #fff; }
.toast-success { background: var(--yes); color: #fff; }
.toast-error { background: var(--no); color: #fff; }
.toast-hide { animation: toastOut 0.2s ease forwards; }

/* ---- Status badges ---- */
.status-badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 10px; }
.status-open { background: var(--yes-bg); color: var(--yes); }
.status-resolved { background: var(--bg-input); color: var(--text3); }
.status-cancelled { background: var(--no-bg); color: var(--no); }
.pnl-pos { color: var(--yes); }
.pnl-neg { color: var(--no); }

/* ---- Animations ---- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(-50%) translateY(0); } to { opacity: 0; transform: translateX(-50%) translateY(12px); } }

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 80px 20px; color: var(--text3); gap: 10px; font-size: 14px; }
.loading::before { content: ''; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--text3); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--text3); padding: 28px 0; font-size: 14px; }
.empty a { color: var(--blue); font-weight: 500; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .header-inner { padding: 0 16px; gap: 10px; }
    .search-wrap { display: none; }
    .container { padding: 0 16px; }
    .mc-body { flex-direction: column; align-items: flex-start; }
    .mc-right { width: 100%; justify-content: space-between; }
    .market-title { font-size: 20px; }
    .prob-num { font-size: 36px; }
    .portfolio-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
