/* ======================================================
   SHOTOALGO — TRADIGO-INSPIRED DESIGN SYSTEM
   Dual Theme (Dark / Light) | Compact Sidebar | Fintech
   ====================================================== */

/* ---- DARK THEME (DEFAULT) ---- */
:root, [data-theme="dark"] {
    --bg-primary: #0d0f14;
    --bg-secondary: #13161d;
    --bg-card: #181b24;
    --bg-card-solid: #1a1d27;
    --bg-sidebar: #0d0f14;
    --bg-terminal: #0a0c11;
    --bg-input: #181b24;
    --bg-hover: rgba(255, 255, 255, 0.04);
    --bg-table-header: rgba(255, 255, 255, 0.03);
    --bg-table-stripe: rgba(255, 255, 255, 0.015);
    --bg-badge: rgba(99, 102, 241, 0.12);
    --bg-topbar: #13161d;
    --bg-stat: #181b24;

    --text-primary: #e8ecf4;
    --text-secondary: #8b93a7;
    --text-muted: #5a6178;
    --text-heading: #f0f2f8;

    --border-primary: rgba(255, 255, 255, 0.06);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-input: rgba(255, 255, 255, 0.1);
    --border-focus: var(--accent);
    --border-sidebar: rgba(255, 255, 255, 0.06);

    --accent: #7c5cfc;
    --accent-light: #9b82fc;
    --accent-glow: rgba(124, 92, 252, 0.35);
    --accent-gradient: linear-gradient(135deg, #7c5cfc, #5e3ff5);
    --accent-soft: rgba(124, 92, 252, 0.1);

    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.1);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* ---- LIGHT THEME ---- */
[data-theme="light"] {
    --bg-primary: #f5f5f9;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-solid: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-terminal: #f8f9fc;
    --bg-input: #f5f5f9;
    --bg-hover: rgba(0, 0, 0, 0.03);
    --bg-table-header: rgba(0, 0, 0, 0.02);
    --bg-table-stripe: rgba(0, 0, 0, 0.015);
    --bg-badge: rgba(124, 92, 252, 0.08);
    --bg-topbar: #ffffff;
    --bg-stat: #ffffff;

    --text-primary: #1a1d2e;
    --text-secondary: #5a6178;
    --text-muted: #8b93a7;
    --text-heading: #0f1120;

    --border-primary: rgba(0, 0, 0, 0.06);
    --border-card: rgba(0, 0, 0, 0.08);
    --border-input: rgba(0, 0, 0, 0.12);
    --border-sidebar: rgba(0, 0, 0, 0.08);

    --accent-soft: rgba(124, 92, 252, 0.06);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(124, 92, 252, 0.12);
}

/* ---- BROKER ACCENT OVERRIDES ---- */
.broker-shoonya  { --accent: #06b6d4; --accent-light: #22d3ee; --accent-glow: rgba(6,182,212,0.35); --accent-gradient: linear-gradient(135deg,#06b6d4,#0891b2); --accent-soft: rgba(6,182,212,0.1); }
.broker-upstox   { --accent: #8b5cf6; --accent-light: #a78bfa; --accent-glow: rgba(139,92,246,0.35); --accent-gradient: linear-gradient(135deg,#8b5cf6,#7c3aed); --accent-soft: rgba(139,92,246,0.1); }
.broker-aliceblue{ --accent: #3b82f6; --accent-light: #60a5fa; --accent-glow: rgba(59,130,246,0.35); --accent-gradient: linear-gradient(135deg,#3b82f6,#2563eb); --accent-soft: rgba(59,130,246,0.1); }
.broker-papertrade{ --accent: #f59e0b; --accent-light: #fbbf24; --accent-glow: rgba(245,158,11,0.35); --accent-gradient: linear-gradient(135deg,#f59e0b,#d97706); --accent-soft: rgba(245,158,11,0.1); }
.broker-fyers    { --accent: #22c55e; --accent-light: #4ade80; --accent-glow: rgba(34,197,94,0.35); --accent-gradient: linear-gradient(135deg,#22c55e,#16a34a); --accent-soft: rgba(34,197,94,0.1); }
.broker-zerodha  { --accent: #e11d48; --accent-light: #fb7185; --accent-glow: rgba(225,29,72,0.35); --accent-gradient: linear-gradient(135deg,#e11d48,#be123c); --accent-soft: rgba(225,29,72,0.1); }
.broker-groww    { --accent: #6366f1; --accent-light: #818cf8; --accent-glow: rgba(99,102,241,0.35); --accent-gradient: linear-gradient(135deg,#6366f1,#4f46e5); --accent-soft: rgba(99,102,241,0.1); }
.broker-dhan     { --accent: #0ea5e9; --accent-light: #38bdf8; --accent-glow: rgba(14,165,233,0.35); --accent-gradient: linear-gradient(135deg,#0ea5e9,#0284c7); --accent-soft: rgba(14,165,233,0.1); }

/* ---- RESET & GLOBALS ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ============================================
   COMPACT ICON SIDEBAR (Tradigo style)
   ============================================ */
.sidebar {
    width: 64px;
    min-width: 64px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-sidebar);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    transition: background 0.3s ease, border-color 0.3s ease;
    z-index: 20;
}

.sidebar-brand {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand img {
    height: 32px;
    width: 32px;
    object-fit: contain;
    border-radius: 8px;
}

.sidebar-brand .brand-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    box-shadow: var(--shadow-glow);
}

/* NAV LINKS */
.nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 0;
    flex: 1;
    width: 100%;
}

.nav-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-size: 18px;
}

.nav-link span {
    display: none;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}

/* Tooltip on hover */
.nav-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card-solid);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.nav-link:hover::after {
    opacity: 1;
}

/* SIDEBAR STATUS (compact) */
.sidebar-status {
    width: 100%;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border-top: 1px solid var(--border-primary);
}

.sidebar-status h4 { display: none; }

.sidebar-status .status-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#status-text {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.indicator.offline {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}
.indicator.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
    50% { box-shadow: 0 0 16px rgba(34, 197, 94, 0.8); }
}

/* SIDEBAR BACK */
.sidebar-back {
    width: 100%;
    padding: 12px 0;
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border-primary);
}
.sidebar-back a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 18px;
    transition: all 0.2s;
}
.sidebar-back a:hover { color: var(--accent); background: var(--accent-soft); }
.sidebar-back a span { display: none; }

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background 0.3s ease;
}

/* TOP BAR — Tradigo style */
.topbar {
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 60px;
    min-height: 60px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-topbar);
    transition: background 0.3s ease, border-color 0.3s ease;
    gap: 24px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding-right: 24px;
    border-right: 1px solid var(--border-primary);
    height: 100%;
}

.topbar-brand img {
    height: 28px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

.topbar-brand h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    white-space: nowrap;
}

.topbar-brand h1 span {
    color: var(--accent);
}

/* Horizontal tab nav */
.topbar-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    height: 100%;
}

.topbar-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: 100%;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.topbar-tab:hover {
    color: var(--text-primary);
}

.topbar-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.topbar-tab i {
    font-size: 14px;
}

/* Right side controls */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.topbar-right .controls {
    display: flex;
    gap: 8px;
}

/* THEME TOGGLE — Tradigo style */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-hover);
    border: 1px solid var(--border-input);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 16px;
}

.theme-toggle:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.theme-toggle::after {
    content: '🌙';
    font-size: 16px;
}
[data-theme="light"] .theme-toggle::after {
    content: '☀️';
}

/* CONTENT AREA */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-primary);
}

/* ============================================
   VIEWS (TAB PANELS)
   ============================================ */
.view {
    display: none;
    flex-direction: column;
    animation: fadeIn 0.25s ease;
}
.view.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   OVERALL STATISTICS ROW (Tradigo style)
   ============================================ */
.stats-row {
    display: flex;
    gap: 1px;
    margin-bottom: 24px;
    background: var(--border-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-card);
}

.stat-item {
    flex: 1;
    background: var(--bg-stat);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-item .stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item .stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
}

.stat-item .stat-value.positive { color: var(--success); }
.stat-item .stat-value.negative { color: var(--danger); }

/* Legacy stat-card grid (for backward compat) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.purple { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.stat-icon.orange { background: var(--warning-bg); color: var(--warning); }

.stat-info p {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.stat-info h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-heading);
}

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
}

.chart-container .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chart-container .chart-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-container .chart-header h3 i {
    color: var(--accent);
    font-size: 14px;
}

.chart-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.chart-canvas-wrap {
    position: relative;
    height: 280px;
}

.chart-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Two charts side by side */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* ============================================
   PANELS / CARDS
   ============================================ */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.25s ease;
}

.panel-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-heading);
}
.panel-header h3 i {
    color: var(--accent);
    font-size: 14px;
}

.panel-body {
    padding: 20px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}
.btn-danger:hover { background: var(--danger-bg); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-input);
}
.btn-ghost:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
}

.btn-success {
    background: var(--success);
    color: white;
    border: none;
}
.btn-success:hover { opacity: 0.9; }

.btn-stop {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}
.btn-stop:hover { background: var(--danger-bg); }

/* Logout button style */
.btn-logout {
    background: none;
    border: 1px solid var(--border-input);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* ============================================
   TERMINAL LOGS
   ============================================ */
.log-panel {
    flex: 1;
    min-height: 300px;
}

.terminal {
    padding: 16px 20px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.7;
    overflow-y: auto;
    flex: 1;
    background: var(--bg-terminal);
    color: var(--text-secondary);
}

.log-line {
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.015);
    word-break: break-word;
    transition: background 0.1s;
}
.log-line:hover { background: rgba(255,255,255,0.02); }

.log-line.error { color: var(--danger); }
.log-line.success, .log-line.start { color: var(--success); }
.log-line.warning { color: var(--warning); }
.log-line.system, .log-line.system_msg { color: var(--accent-light); }
.log-line .timestamp {
    color: var(--text-muted);
    margin-right: 8px;
    font-size: 10px;
}

/* Log filter bar */
.log-filters {
    display: flex;
    gap: 4px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-card);
}

.log-filter-btn {
    padding: 5px 12px;
    border: 1px solid var(--border-input);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.log-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.log-filter-btn.active { 
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow: auto;
    flex: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
    transition: background 0.1s;
}

th {
    background: var(--bg-table-header);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

tbody tr { transition: background 0.1s; }
tbody tr:nth-child(even) { background: var(--bg-table-stripe); }
tbody tr:hover { background: var(--bg-hover); }

.cell-symbol { font-weight: 700; color: var(--text-heading); }
.cell-positive { color: var(--success); font-weight: 600; }
.cell-negative { color: var(--danger); font-weight: 600; }
.cell-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-badge);
    color: var(--accent-light);
}

/* ============================================
   SETTINGS / FORMS
   ============================================ */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
}

.form-divider {
    margin: 16px 0;
    border: none;
    border-top: 1px solid var(--border-primary);
}

/* ============================================
   VIEW HEADER
   ============================================ */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.view-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-heading);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 260px;
}
.toast.success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.toast.error { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.toast.info { background: var(--info-bg); border-color: var(--info); color: var(--info); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   SCROLLBARS
   ============================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-input); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.3;
}
.empty-state p { font-size: 13px; }

/* ============================================
   DAILY PNL CARDS
   ============================================ */
.daily-pnl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.daily-pnl-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.daily-pnl-card .dpnl-date {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.daily-pnl-card .dpnl-value {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
}
.daily-pnl-card .dpnl-value.positive { color: var(--success); }
.daily-pnl-card .dpnl-value.negative { color: var(--danger); }

.daily-pnl-card .dpnl-trades {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   HOLDINGS SUMMARY
   ============================================ */
.holdings-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.holdings-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
}

.holdings-summary-card .hs-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.holdings-summary-card .hs-value {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
}

/* ============================================
   LANDING PAGE (BROKER SELECTOR)
   ============================================ */
.landing-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary);
    overflow: auto;
}

.landing-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(124,92,252,0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(6,182,212,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.landing-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 60px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-topbar);
    position: relative;
    z-index: 2;
}

.landing-topbar .brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-topbar .brand-group img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.landing-topbar .brand-group h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
}
.landing-topbar .brand-group h1 span { color: var(--accent); }

.landing-topbar .right-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-container {
    position: relative;
    z-index: 1;
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 32px;
    width: 100%;
}

.landing-container h2.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.landing-container h2.section-title i {
    color: var(--accent);
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.landing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.landing-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--card-accent, var(--accent-gradient));
    opacity: 0;
    transition: opacity 0.3s;
}

.landing-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-accent, var(--accent));
    box-shadow: var(--shadow-md);
}
.landing-card:hover::before { opacity: 1; }

.landing-card .broker-card-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    margin-bottom: 12px;
    border-radius: 8px;
}

.landing-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
}
.landing-card p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.landing-card .card-status {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.landing-card.shoonya { --card-accent: #06b6d4; }
.landing-card.upstox { --card-accent: #8b5cf6; }
.landing-card.aliceblue { --card-accent: #3b82f6; }
.landing-card.papertrade { --card-accent: #f59e0b; }
.landing-card.fyers { --card-accent: #22c55e; }
.landing-card.zerodha { --card-accent: #e11d48; }
.landing-card.groww { --card-accent: #6366f1; }
.landing-card.dhan { --card-accent: #0ea5e9; }

.landing-footer {
    text-align: center;
    margin-top: 40px;
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.5;
}

.landing-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
}

/* ============================================
   ANIMATIONS
   ============================================ */
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.15s; }
.anim-delay-3 { animation-delay: 0.2s; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in {
    animation: slideUp 0.4s ease forwards;
    opacity: 0;
}

/* ============================================
   PAPER TRADING MODALS
   ============================================ */
.pt-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.pt-modal {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.pt-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-primary);
}
.pt-modal-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-heading);
}
.pt-modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--bg-hover);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.pt-modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.pt-modal-body { padding: 22px; }
.pt-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Report Date Items */
.report-date-item {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}
.report-date-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.report-date-item.active {
    background: var(--bg-badge);
    color: var(--accent);
    font-weight: 600;
}

/* ============================================
   LOGO HELPERS
   ============================================ */
#site-logo { height: 32px; width: auto; object-fit: contain; display: block; }
.broker-card-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
}
.broker-terminal-logo {
    height: 22px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .stats-row { flex-wrap: wrap; }
    .stat-item { min-width: 120px; }
    .charts-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .landing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { width: 50px; min-width: 50px; }
    .nav-link { width: 36px; height: 36px; font-size: 16px; }
    .content-area { padding: 16px; }
    .topbar { padding: 0 16px; gap: 12px; }
    .topbar-brand h1 { display: none; }
    .topbar-tab span { display: none; }
    .stats-row { flex-direction: column; }
    .landing-grid { grid-template-columns: 1fr; }
}

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