:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #121826;
    --bg-card: #182234;
    --bg-card-hover: #1e2b42;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(79, 140, 255, 0.3);
    
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.25);
    --accent-green: #10b981;
    --accent-green-bg: rgba(16, 185, 129, 0.12);
    --accent-red: #ef4444;
    --accent-red-bg: rgba(239, 68, 68, 0.12);
    --accent-orange: #f59e0b;
    --accent-purple: #8b5cf6;
    
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 24px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 20px var(--accent-blue-glow);
}

.brand-text h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.status-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--accent-blue-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-blue-glow);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

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

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin: 6px 0;
}

.stat-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.section-tag {
    font-size: 12px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.ipo-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.ipo-card:hover {
    border-color: var(--border-highlight);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.company-name {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 6px 0 2px 0;
}

.company-symbol {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
}

.board-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-mainboard {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-sme {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.gmp-display {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.gmp-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.gmp-value {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    margin: 4px 0;
}

.gmp-pos {
    color: var(--accent-green);
    text-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.gmp-neg {
    color: var(--accent-red);
    text-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.gmp-na {
    color: var(--text-muted);
}

.confidence-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.conf-high {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.conf-moderate {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.conf-low {
    background: var(--accent-red-bg);
    color: var(--accent-red);
}

/* Card Meta Grid */
.card-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.meta-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

.doc-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
    margin-top: 2px;
}

.doc-downloaded {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.doc-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.doc-not_applicable {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

/* Peers Drawer */
.peers-drawer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.drawer-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 12px;
}

.peers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.peer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
}

.peer-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.peer-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.peer-sec-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.tag-same-sec {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.tag-diff-sec {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.peer-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.empty-peers { color: var(--text-muted); font-size: 13px; }
