:root {
    --bg-dark: #0f172a;
    --panel-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --green: #10b981;
    --red: #ef4444;
    --accent: #3b82f6;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Roboto Mono', monospace;
    height: 100vh;
    overflow: hidden; /* Evita scroll, estilo app nativa */
    display: flex;
    flex-direction: column;
}

/* --- BARRA SUPERIOR --- */
.top-bar {
    background-color: var(--panel-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* Selector Estilizado */
#coin-selector {
    background: var(--bg-dark);
    color: white;
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: 6px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

#coin-selector:hover { border-color: var(--accent); }

/* --- LAYOUT PRINCIPAL (GRID) --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 350px; /* Gráfica flexible | Panel lateral fijo */
    height: calc(100vh - 60px);
}

/* --- SECCIÓN GRÁFICA (IZQUIERDA) --- */
.chart-section {
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

#chart-container {
    flex-grow: 1; /* Ocupa todo el espacio disponible */
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

/* --- SECCIÓN DATOS (DERECHA) --- */
.data-sidebar {
    background-color: #162032;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto;
}

/* Tarjeta de Precio */
.price-card {
    text-align: right;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

.asset-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

#price {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 5px 0;
    display: block;
}

#change {
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Tarjeta IA (Highlight) */
.ai-card {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--accent);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.ai-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
    font-weight: bold;
    letter-spacing: 1px;
}

#prediction-text {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

/* Stats Grid */
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-box {
    background: var(--panel-bg);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1rem;
    font-weight: bold;
}

/* Utilidades de Color */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.bg-green { background-color: rgba(16, 185, 129, 0.15); color: var(--green); }
.bg-red { background-color: rgba(239, 68, 68, 0.15); color: var(--red); }

/* Responsive para móvil */
@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .chart-section { height: 50vh; order: 2; }
    .data-sidebar { height: auto; order: 1; padding: 15px; flex-direction: row; flex-wrap: wrap; justify-content: space-between;}
    .ai-card { width: 100%; }
}