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

body{
    background:#f6f7f9;
    font-family:Segoe UI, Arial, sans-serif;
    padding:18px;
    color:#1f2937;
}

/* CONTAINER */

.container{
    width:100%;
}

/* TITLE */

h1{
    font-size:20px;
    margin-bottom:18px;
    color:#2563eb;
    font-weight:650;
}

/* TAG BAR */

.tag-bar{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-bottom:16px;
}

.tag-bar button{
    border:none;
    padding:8px 14px;
    border-radius:7px;
    color:white;
    cursor:pointer;
    font-weight:650;
    font-size:13px;
    transition:0.2s;
}

.tag-bar button:hover{
    transform:translateY(-1px);
}

.tag-bar button.active{
    outline:2px solid #111827;
}

.tag-all{
    background:#374151;
}

.tag-swing{
    background:#22c55e;
}

.tag-long{
    background:#3b82f6;
}

.tag-short{
    background:#22c55e;
}

.tag-watch{
    background:#f59e0b;
}

.tag-ignore{
    background:#ef4444;
}

.tag-miss{
    background:#6b7280;
}

.tag-bought{
    background:#10b981;
}

.tag-empty{
    background:#0ea5e9;
}

/* SEARCH */

.search-box{
    margin-bottom:14px;
}

.search-box input{
    width:260px;
    padding:10px 13px;
    border-radius:8px;
    border:1px solid #d1d5db;
    background:white;
    font-size:13px;
    color:#111827;
    outline:none;
}

.search-box input:focus{
    border-color:#2563eb;
}

/* TABLE */

.table-container{
    background:white;
    border-radius:8px;
    overflow:auto;
    border:1px solid #e5e7eb;
    max-height:82vh;
}

/* TABLE */

table{
    width:100%;
    border-collapse:collapse;
    min-width:1220px;
}

/* HEADER */

thead th{
    position:sticky;
    top:0;
    background:#2f3b4b;
    color:#f8fafc;
    padding:10px 12px;
    font-size:13px;
    font-weight:600;
    z-index:5;
    white-space:nowrap;
    letter-spacing:0;
}

/* CELLS */

td{
    padding:9px 12px;
    border-bottom:1px solid #e5e7eb;
    font-size:13px;
    text-align:center;
    color:#1f2937;
    line-height:1.35;
}

/* ROW */

tbody tr:hover{
    background:#f8fafc;
}

/* SYMBOL */

.symbol{
    text-align:left;
    font-weight:650;
    color:#111827;
}

/* COLORS */

.green{
    color:#16a34a;
    font-weight:600;
}

.red{
    color:#dc2626;
    font-weight:600;
}

.profit-cell{
    white-space:nowrap;
    font-variant-numeric:tabular-nums;
}

.profit-value{
    color:#1f2937;
    font-weight:500;
}

.growth-pill{
    display:inline-flex;
    align-items:center;
    margin-left:6px;
    padding:2px 7px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
    line-height:1.2;
}

.growth-pill.positive{
    color:#047857;
    background:#d1fae5;
}

.growth-pill.negative{
    color:#b91c1c;
    background:#fee2e2;
}

/* BO INPUT */

.bo-input{
    width:90px;
    padding:5px 8px;
    border-radius:6px;
    border:1px solid #d1d5db;
    text-align:center;
    background:white;
    color:#111827;
}

/* DROPDOWN */

.tag-select{
    padding:5px 8px;
    border-radius:6px;
    border:1px solid #d1d5db;
    background:white;
    font-size:12px;
    color:#111827;
}

/* SCROLLBAR */

::-webkit-scrollbar{
    width:10px;
    height:10px;
}

::-webkit-scrollbar-thumb{
    background:#cbd5e1;
    border-radius:10px;
}

::-webkit-scrollbar-thumb:hover{
    background:#94a3b8;
}

/* ── DUAL TAB NAV ─────────────────────────────────────────── */

.dash-nav{
    display:flex;
    gap:48px;
    justify-content:center;
    align-items:center;
    padding:22px 0 20px;
}

.nav-title{
    font-size:21px;
    font-weight:750;
    text-decoration:none;
    letter-spacing:0.4px;
    transition:opacity 0.18s;
    white-space:nowrap;
}

.nav-long{
    color:#1d4ed8;
}

.nav-short{
    color:#6d28d9;
}

.nav-active{
    opacity:1;
}

.nav-inactive{
    opacity:0.28;
}

.nav-inactive:hover{
    opacity:0.65;
}

/* ── UPTREND TAG ──────────────────────────────────────────── */

.tag-uptrend{
    background:#8b5cf6;
}

/* ── SAVE STATUS FLASH ────────────────────────────────────── */

.tag-select.save-ok{
    border-color:#16a34a;
    box-shadow:0 0 0 2px #bbf7d0;
    transition:border-color 0.1s,box-shadow 0.1s;
}

.tag-select.save-fail{
    border-color:#dc2626;
    box-shadow:0 0 0 2px #fecaca;
    transition:border-color 0.1s,box-shadow 0.1s;
}


/* ── PORTFOLIO NAV TAB ────────────────────────────────────── */

.nav-portfolio { color:#7c3aed; }

/* ── PORTFOLIO PAGE ───────────────────────────────────────── */

.pf-bar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:14px;
    flex-wrap:wrap;
    gap:10px;
}

.pf-summary {
    display:flex;
    align-items:center;
    gap:24px;
    flex-wrap:wrap;
}

.pf-stat {
    display:flex;
    align-items:center;
    gap:6px;
    font-size:14px;
}

.pf-stat-lbl {
    color:#6b7280;
    font-size:12px;
}

.pf-refresh-btn {
    padding:8px 16px;
    border-radius:8px;
    background:#7c3aed;
    color:white;
    border:none;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
    transition:0.15s;
}
.pf-refresh-btn:hover:not(:disabled) { background:#6d28d9; }
.pf-refresh-btn:disabled { opacity:0.5; cursor:not-allowed; }

/* ── GTT NAV TAB ──────────────────────────────────────────── */

.nav-gtt { color:#0891b2; }

/* ── GTT PAGE ─────────────────────────────────────────────── */

.gtt-bar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:14px;
    flex-wrap:wrap;
    gap:10px;
}

.gtt-filters {
    display:flex;
    gap:0;
    border:1px solid #e5e7eb;
    border-radius:8px;
    overflow:hidden;
    background:white;
}

.gtt-filter {
    border:none;
    border-right:1px solid #e5e7eb;
    padding:8px 18px;
    background:white;
    color:#374151;
    cursor:pointer;
    font-weight:600;
    font-size:13px;
    transition:0.15s;
    white-space:nowrap;
}
.gtt-filter:last-child { border-right:none; }
.gtt-filter:hover      { background:#f3f4f6; }

.gtt-f-all.active     { background:#374151; color:white; }
.gtt-f-buy.active     { background:#16a34a; color:white; }
.gtt-f-sell.active    { background:#dc2626; color:white; }
.gtt-f-pending.active { background:#f59e0b; color:white; }
.gtt-f-cancel.active  { background:#6b7280; color:white; }

.gtt-right {
    display:flex;
    align-items:center;
    gap:12px;
}

.gtt-count {
    font-size:13px;
    color:#6b7280;
    font-weight:600;
}

.gtt-refresh-btn {
    padding:8px 16px;
    border-radius:8px;
    background:#0891b2;
    color:white;
    border:none;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
    transition:0.15s;
}
.gtt-refresh-btn:hover:not(:disabled) { background:#0e7490; }
.gtt-refresh-btn:disabled { opacity:0.5; cursor:not-allowed; }

.gtt-loading {
    display:flex;
    align-items:center;
    gap:14px;
    padding:36px 0;
    color:#6b7280;
    font-size:14px;
    justify-content:center;
}

.gtt-error {
    padding:14px 18px;
    border-radius:8px;
    background:#fee2e2;
    color:#b91c1c;
    font-size:14px;
    margin-top:16px;
}

.gtt-empty {
    text-align:center;
    padding:48px;
    color:#9ca3af;
    font-size:15px;
}

/* GTT table cells */
.gtt-name   { text-align:left; font-weight:650; color:#111827; }
.gtt-qty    { font-variant-numeric:tabular-nums; }
.gtt-ltp    { font-variant-numeric:tabular-nums; white-space:nowrap; }
.gtt-trigger{ font-variant-numeric:tabular-nums; white-space:nowrap; color:#374151; }
.gtt-expiry { color:#6b7280; font-size:12px; white-space:nowrap; }

/* Action pill */
.gtt-action {
    display:inline-block;
    padding:3px 10px;
    border-radius:5px;
    font-size:12px;
    font-weight:700;
}
.action-buy  { background:#dcfce7; color:#15803d; }
.action-sell { background:#fee2e2; color:#b91c1c; }

/* Status badges — 3 types only */
.gtt-badge {
    display:inline-block;
    padding:4px 10px;
    border-radius:6px;
    font-size:12px;
    font-weight:600;
    white-space:nowrap;
}
.badge-pending  { background:#fef3c7; color:#92400e; }
.badge-executed { background:#dcfce7; color:#15803d; }
.badge-cancelled{ background:#f3f4f6; color:#6b7280; }

/* ── HOMEPAGE GTT CARD ────────────────────────────────────── */

.home-card-gtt {
    background:#ecfeff;
    border-color:#a5f3fc;
}
.home-card-gtt:hover { border-color:#0891b2; }
.home-card-gtt .home-card-title { color:#0e7490; }
.home-card-gtt .home-card-btn   { background:#0891b2; }

/* ── SMALL CAP NAV TAB ────────────────────────────────────── */

.nav-smallcap { color:#7c3aed; }

/* ── HOMEPAGE SMALL CAP CARD ──────────────────────────────── */

.home-card-smallcap {
    background:#f5f3ff;
    border-color:#ddd6fe;
}
.home-card-smallcap:hover { border-color:#7c3aed; }
.home-card-smallcap .home-card-title { color:#5b21b6; }
.home-card-smallcap .home-card-btn   { background:#7c3aed; }

/* ── UNIVERSE NAV TAB ─────────────────────────────────────── */

.nav-universe { color:#15803d; }

.uni-bar {
    display:flex;
    align-items:center;
    gap:16px;
    margin-bottom:14px;
    flex-wrap:wrap;
}

.uni-count {
    font-size:13px;
    color:#6b7280;
    font-weight:600;
}

/* ── MA44 NAV TAB ─────────────────────────────────────────── */

.nav-ma44 { color:#d97706; }

/* ── HOMEPAGE — 3rd card ─────────────────────────────────── */

.home-card-ma44 {
    background:#fffbeb;
    border-color:#fde68a;
}
.home-card-ma44:hover { border-color:#d97706; }
.home-card-ma44 .home-card-title { color:#b45309; }
.home-card-ma44 .home-card-btn   { background:#d97706; }

/* ── MA44 SCANNER PAGE ────────────────────────────────────── */

.ma44-bar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:16px;
    flex-wrap:wrap;
    gap:10px;
}

.ma44-stats {
    font-size:13px;
    color:#6b7280;
}

.ma44-stats strong { color:#111827; }

.ma44-refresh-btn {
    padding:8px 16px;
    border-radius:8px;
    background:#d97706;
    color:white;
    border:none;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
    transition:0.15s;
}
.ma44-refresh-btn:hover:not(:disabled) { background:#b45309; }
.ma44-refresh-btn:disabled { opacity:0.55; cursor:not-allowed; }

.ma44-loading {
    display:flex;
    align-items:center;
    gap:14px;
    padding:36px 0;
    color:#6b7280;
    font-size:14px;
    justify-content:center;
}

.ma44-spinner {
    width:22px;
    height:22px;
    border:3px solid #e5e7eb;
    border-top-color:#d97706;
    border-radius:50%;
    animation:spin 0.8s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }

.ma44-scanning-dot {
    display:inline-block;
    width:8px;
    height:8px;
    border-radius:50%;
    background:#d97706;
    margin-right:6px;
    animation:pulse 1s ease-in-out infinite;
}
@keyframes pulse {
    0%,100% { opacity:1; }
    50%      { opacity:0.3; }
}

.ma44-section-head {
    padding:10px 14px;
    font-size:13px;
    font-weight:700;
    border-radius:8px 8px 0 0;
    color:white;
    display:flex;
    align-items:center;
    gap:8px;
}
.fresh-head  { background:#16a34a; }
.await-head  { background:#d97706; }
.trig-head   { background:#7c3aed; }

.ma44-badge {
    background:rgba(255,255,255,0.25);
    border-radius:999px;
    padding:1px 8px;
    font-size:12px;
}

.ma44-empty {
    text-align:center;
    padding:48px;
    color:#9ca3af;
    font-size:15px;
}
/* ── BACKTEST NAV TAB ─────────────────────────────────────── */

.nav-bt { color:#0891b2; }

/* ── HOMEPAGE 4th CARD ────────────────────────────────────── */

.home-card-bt {
    background:#ecfeff;
    border-color:#a5f3fc;
}
.home-card-bt:hover { border-color:#0891b2; }
.home-card-bt .home-card-title { color:#0e7490; }
.home-card-bt .home-card-btn   { background:#0891b2; }

/* ── GTT BADGE IN WATCHLIST ───────────────────────────────── */

.wl-gtt-cell { white-space:nowrap; }

.wl-gtt-empty { color:#d1d5db; font-size:12px; }

.wl-gtt-pill {
    display:inline-block;
    padding:2px 7px;
    border-radius:5px;
    font-size:11px;
    font-weight:700;
    white-space:nowrap;
    font-variant-numeric:tabular-nums;
}
.wl-gtt-buy  { background:#dcfce7; color:#15803d; }
.wl-gtt-sell { background:#fee2e2; color:#b91c1c; }

/* ── DELETE BUTTON ────────────────────────────────────────── */

.delete-btn {
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 5px;
    opacity: 0.45;
    transition: opacity 0.15s, background 0.15s;
    line-height: 1;
}

.delete-btn:hover {
    opacity: 1;
    background: #fee2e2;
}

/* ── BACKTEST PAGE ────────────────────────────────────────── */

.bt-search-bar {
    display:flex;
    gap:10px;
    align-items:center;
    margin-bottom:20px;
    flex-wrap:wrap;
}

.bt-input {
    width:300px;
    padding:11px 14px;
    border-radius:8px;
    border:2px solid #d1d5db;
    font-size:15px;
    font-weight:600;
    color:#111827;
    letter-spacing:0.5px;
    outline:none;
    text-transform:uppercase;
    transition:border-color 0.15s;
}
.bt-input:focus { border-color:#0891b2; }

.bt-btn {
    padding:11px 22px;
    border-radius:8px;
    background:#0891b2;
    color:white;
    border:none;
    font-size:14px;
    font-weight:700;
    cursor:pointer;
    transition:0.15s;
}
.bt-btn:hover:not(:disabled) { background:#0e7490; }
.bt-btn:disabled { opacity:0.5; cursor:not-allowed; }

.bt-error {
    padding:14px 18px;
    border-radius:8px;
    background:#fee2e2;
    color:#b91c1c;
    font-size:14px;
    margin-bottom:16px;
}

/* Summary cards */
.bt-summary-row {
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-bottom:4px;
}

.bt-card {
    background:white;
    border:1px solid #e5e7eb;
    border-radius:10px;
    padding:12px 18px;
    min-width:90px;
    text-align:center;
}
.bt-card-val {
    font-size:18px;
    font-weight:700;
    color:#111827;
}
.bt-card-lbl {
    font-size:11px;
    color:#6b7280;
    margin-top:3px;
    white-space:nowrap;
}
.bt-card-green .bt-card-val { color:#16a34a; }
.bt-card-red   .bt-card-val { color:#dc2626; }

/* Trade log */
.bt-head { background:#374151; border-radius:8px 8px 0 0; }

.bt-row-win     { background:#f0fdf4; }
.bt-row-loss    { background:#fff5f5; }
.bt-row-timeout { background:#fffbeb; }

.bt-pnl { font-size:14px; }

.bt-reason-target  { color:#16a34a; font-weight:600; }
.bt-reason-sl      { color:#dc2626; font-weight:600; }
.bt-reason-timeout { color:#d97706; font-weight:600; }