:root {
    --primary-color: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --secondary-color: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --sidebar-bg: #1e1b4b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --radius-lg: 1.25rem;
    --radius-md: 0.75rem;
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-light: #0f172a;
    --bg-white: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: white;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
}

.sidebar-logo i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-logo h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.875rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
}

.menu-link:hover, .menu-link.active {
    background-color: var(--primary-color);
    color: white;
}

.menu-link i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    padding: 2rem 3rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.search-bar {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-bar input {
    background: white;
    border: none;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border-radius: 12px;
    width: 100%;
    box-shadow: var(--card-shadow);
}

.search-bar i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

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

/* Cards & Components */
.glass-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(124, 58, 237, 0.1);
    margin-bottom: 1.5rem;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .glass-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.stat-card h2 {
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 1.75rem;
}

.stat-card .trend {
    font-size: 0.875rem;
    font-weight: 600;
}

.sparkline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    opacity: 0.3;
}

/* Tables */
.table {
    margin: 0;
}

.table thead th {
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #f8fafc;
}

.thumbnail-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
}

.thumbnail-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 14px 0 rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

/* Charts Placeholder */
.chart-container {
    height: 250px;
    position: relative;
}

.donut-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 20px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Utilities */
.text-primary-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-banner {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    position: relative;
}

.ai-robot {
    position: absolute;
    right: 20px;
    bottom: -10px;
    width: 180px;
    pointer-events: none;
}

.bg-gradient-primary {
    background: radial-gradient(circle at top right, var(--bg-light), var(--bg-white));
    min-height: 100vh;
}

body.dark-mode .bg-gradient-primary {
    background: radial-gradient(circle at top right, #1e1b4b, var(--bg-light));
}

/* TTS Highlighting */
.tts-word {
    transition: background-color 0.2s ease;
    border-radius: 4px;
    padding: 0 2px;
}

.tts-highlight {
    background-color: rgba(124, 58, 237, 0.25) !important; /* Roxo translúcido */
    color: var(--primary-dark) !important;
    font-weight: 500;
}

/* Pulse Animation */
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
.pulse-animation {
    animation: pulse-red 2s infinite;
}
/* Media Queries - Responsividade Mobile */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    
    .app-header {
        flex-direction: row-reverse;
        gap: 15px;
    }
    
    .search-bar {
        display: none; /* Esconder busca no mobile por enquanto para simplificar */
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .app-header {
        margin-bottom: 1.5rem;
    }
    
    .page-body {
        padding: 0;
    }
    
    .glass-card {
        padding: 1.25rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
}

/* Hamburger Menu Button */
.menu-toggle {
    display: none;
    background: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    color: var(--primary-color);
    font-size: 1.25rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

@media (max-width: 991.98px) {
    .menu-toggle {
        display: flex;
    }
}
