﻿:root {
    --bg-base: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary: #25F4EE;
    --secondary: #FE2C55;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

html {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

/* Sidebar */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 30px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.nav-menu a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 12px 24px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--primary);
    background: rgba(37, 244, 238, 0.1);
    border-right: 3px solid var(--primary);
}

/* Indicador "Ao vivo" na sidebar */
.live-indicator {
    margin-top: auto;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.live-indicator .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    margin-right: 6px;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.6);
    animation: pulse-dot 1.6s infinite;
}

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.live-clock {
    color: var(--text-main);
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

/* Dashboard Grid */
.dashboard-grid {
    padding: 40px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.dashboard-grid.page[hidden] {
    display: none;
}

.glass {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 4; } /* 4 to fill full width in a 4-col grid */

/* KPI Cards */
.kpi-card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-family: 'Space Mono', monospace;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.kpi-trend {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.kpi-trend.positive { color: var(--success); }
.kpi-trend.negative { color: var(--danger); }

.kpi-card.highlight {
    background: linear-gradient(135deg, rgba(37,244,238,0.1) 0%, rgba(254,44,85,0.1) 100%);
    border-color: rgba(37,244,238,0.3);
}

.highlight-text {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Charts */
.chart-container {
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

.chart-container canvas {
    flex: 1;
    max-height: 280px;
}

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

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Buttons */
.btn-neo {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-neo:hover {
    background: var(--primary);
    color: #000;
}

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

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

.data-table th, .data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.data-table td {
    font-size: 0.95rem;
}

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

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-error { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.status-doubt { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.status-suggestion { background: rgba(16, 185, 129, 0.2); color: var(--success); }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
