/* --- CSS Custom Variables (Design System Tokens) --- */
:root {
    --bg-base: #060913;
    --bg-surface: rgba(13, 20, 38, 0.7);
    --bg-surface-hover: rgba(22, 34, 64, 0.8);
    --bg-sidebar: #090e1a;
    
    --border-color: rgba(255, 255, 255, 0.07);
    --border-glow: rgba(56, 189, 248, 0.2);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --accent-cyan: #38bdf8;
    --accent-blue: #0284c7;
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.15);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.15);
}

/* --- Base & Resets --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea, select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* --- Animated Glowing Background Elements --- */
.tech-bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -100;
    pointer-events: none;
    overflow: hidden;
}

.grid-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    mix-blend-mode: screen;
}

.orb-primary {
    top: 10%;
    right: 15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
    animation: float-orb 20s infinite alternate ease-in-out;
}

.orb-secondary {
    bottom: 15%;
    left: 10%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
    animation: float-orb 25s infinite alternate-reverse ease-in-out;
}

@keyframes float-orb {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(40px) scale(1.1); }
}

/* --- Layout --- */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* --- Sidebar Navigation --- */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.brand-icon-wrapper {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.brand-icon {
    width: 20px;
    height: 20px;
    color: var(--bg-base);
    stroke-width: 2.5px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 8px;
}

.nav-btn {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    transition: all 0.2s ease;
}

.nav-btn i {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

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

.nav-btn:hover i {
    color: var(--accent-cyan);
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.1) 0%, transparent 100%);
    border-left: 3px solid var(--accent-cyan);
    color: var(--text-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding-left: 13px; /* Offset the 3px border */
}

.nav-btn.active i {
    color: var(--accent-cyan);
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticker-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}

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

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

.status-label {
    color: var(--text-secondary);
}

.footer-version {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* --- Main Content Area --- */
.main-content {
    padding: 40px;
    height: 100vh;
    overflow-y: auto;
}

/* --- Header & Live Ticker --- */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.mobile-toggle-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.header-title-wrapper {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-ticker-container {
    background: rgba(13, 20, 38, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 20px;
    width: 400px;
    overflow: hidden;
    position: relative;
}

.ticker-track {
    display: flex;
    gap: 40px;
    white-space: nowrap;
    animation: ticker-slide 20s linear infinite;
}

.ticker-item {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.trend-up {
    color: var(--success);
    margin-left: 4px;
}

.trend-down {
    color: var(--error);
    margin-left: 4px;
}

@keyframes ticker-slide {
    0% { transform: translateX(10%); }
    100% { transform: translateX(-100%); }
}

/* --- Section Container --- */
.section-container {
    display: none;
}

.section-container.active {
    display: block;
    animation: fade-in 0.4s ease forwards;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 6px;
}

/* --- Stat Cards Grid --- */
.grid-layout-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-premium);
}

.stat-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrapper.copper {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.stat-icon-wrapper.chip {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.stat-icon-wrapper.energy {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.stat-icon-wrapper i {
    width: 24px;
    height: 24px;
}

.stat-details {
    display: flex;
    flex-direction: column;
}

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

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 4px 0;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-value .unit {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.stat-trend {
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Block Styling --- */
.dashboard-block {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
}

.block-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.block-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.block-header-actions .block-title {
    margin-bottom: 0;
}

/* --- Sector Matrix Grid --- */
.sectors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.sector-card {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sector-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(56, 189, 248, 0.3);
}

.sector-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sector-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
}

.sector-companies-count {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    color: var(--text-muted);
}

.sector-card-metric {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 6px 0;
}

.sector-metric-lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sector-metric-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.sector-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sector-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.sector-status-badge.bullish {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sector-status-badge.neutral {
    background-color: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* --- Layout Grids --- */
.grid-layout-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* --- Tables --- */
.table-wrapper {
    overflow-x: auto;
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.styled-table th {
    padding: 16px 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.styled-table td {
    padding: 16px 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.styled-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.styled-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.styled-table tr:last-child td {
    border-bottom: none;
}

.ticker-name-wrapper {
    display: flex;
    flex-direction: column;
}

.ticker-symbol {
    font-weight: 700;
    color: var(--text-primary);
}

.ticker-fullname {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.score-badge {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(2, 132, 199, 0.1));
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent-cyan);
    display: inline-block;
}

/* --- Badges --- */
.badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    display: inline-block;
}

.badge.strong_buy {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge.buy {
    background-color: rgba(56, 189, 248, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.badge.hold {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

/* --- News Feed --- */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.news-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

.news-impact {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
}

/* --- Sector Tabs --- */
.sector-tabs-container {
    margin-bottom: 30px;
}

.sector-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.sector-tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

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

.sector-tab-btn.active {
    background-color: var(--bg-surface-hover);
    color: var(--accent-cyan);
}

.sector-analysis-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
}

.sector-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.sector-analysis-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
}

.sector-macro-summary {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.sector-companies-subgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.company-subcard {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.company-subcard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.company-subcard-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.company-subcard-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- Timeline --- */
.timeline-container {
    position: relative;
    padding-left: 32px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 2px;
    height: calc(100% - 16px);
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -32px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--bg-base);
    border: 3px solid var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
}

.timeline-card {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.timeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.timeline-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.timeline-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.meta-partner {
    color: var(--text-secondary);
}

.meta-value {
    color: var(--success);
    font-weight: 600;
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- Forms & Inputs (Simulator) --- */
.simulator-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.styled-select, .styled-input, .styled-textarea {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.styled-select:focus, .styled-input:focus, .styled-textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
}

.styled-select option {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: var(--bg-base);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    opacity: 0.95;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.25);
}

.btn-primary i {
    width: 18px;
    height: 18px;
}

.simulation-results-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 400px;
}

.sim-placeholder-text {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

.sim-placeholder-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    stroke-width: 1.5px;
}

.sim-output {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sim-metric-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.sim-metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.sim-metric-lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.sim-metric-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 6px;
    display: block;
}

.sim-metric-delta {
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 4px;
}

.sim-badge-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
    margin-top: 10px;
}

.sim-badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sim-badge-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sim-explanation-card {
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: var(--radius-md);
    padding: 20px;
}

.sim-explanation-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 8px;
}

.sim-explanation-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

/* --- Dialog Modals (<dialog>) --- */
.detail-dialog {
    margin: auto;
    background: transparent;
    border: none;
    max-width: 650px;
    width: calc(100% - 40px);
    outline: none;
}

.detail-dialog::backdrop {
    background-color: rgba(3, 5, 11, 0.8);
    backdrop-filter: blur(8px);
}

.dialog-content {
    background: #090e1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: dialog-show 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes dialog-show {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.dialog-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialog-header-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dialog-badge {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.dialog-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.dialog-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dialog-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.dialog-close-btn i {
    width: 20px;
    height: 20px;
}

.dialog-body {
    padding: 30px;
    max-height: 75vh;
    overflow-y: auto;
}

.dialog-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.dialog-stat-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.dialog-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.dialog-stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.font-accent { color: var(--accent-cyan); }
.font-success { color: var(--success); }

.dialog-section {
    margin-bottom: 24px;
}

.dialog-sub-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.dialog-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.indicators-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.ind-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.ind-lbl {
    color: var(--text-muted);
}

.ind-val {
    font-weight: 600;
    color: var(--text-primary);
}

.dialog-contracts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dialog-contract-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.dialog-contract-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.dialog-contract-partner {
    font-weight: 600;
    color: var(--accent-cyan);
}

.dialog-contract-val {
    color: var(--success);
    font-weight: 700;
}

.dialog-contract-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* --- Responsive Adaptations --- */
@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .mobile-toggle-btn {
        display: block;
    }
    
    .grid-layout-2-1 {
        grid-template-columns: 1fr;
    }
    
    .live-ticker-container {
        display: none;
    }
}

@media (max-width: 768px) {
    .grid-layout-3 {
        grid-template-columns: 1fr;
    }
    
    .sectors-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .top-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
