:root {
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --border-color: #334155;
    --glass-bg: rgba(30, 41, 59, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.logo-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 30px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    transform: translateX(5px);
}

.nav-links a.active {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: radial-gradient(circle at top right, #1e293b 0%, var(--bg-color) 60%);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
}

.top-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--glass-bg);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Views */
.view-content {
    padding: 0 40px 40px;
    animation: fadeIn 0.4s ease forwards;
}

.hidden {
    display: none !important;
}

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

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

/* Dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.stat-icon.purple { background-color: rgba(139, 92, 246, 0.1); color: var(--accent-purple); }
.stat-icon.green { background-color: rgba(16, 185, 129, 0.1); color: var(--accent-green); }

.stat-data h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-data h2 {
    font-size: 24px;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.activity-list {
    list-style: none;
    margin-top: 16px;
}

.activity-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.activity-list li:last-child {
    border-bottom: none;
}

/* Buttons and Inputs */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background-color: var(--accent-purple);
    color: white;
}

.btn-secondary:hover {
    background-color: #7c3aed;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.w-100 { width: 100%; justify-content: center; }

/* Actions bar */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.action-buttons {
    display: flex;
    gap: 12px;
}

/* Tables */
.table-card {
    padding: 0;
    overflow: hidden;
}

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

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

.data-table th {
    background-color: rgba(30, 41, 59, 0.5);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.badge-success { background-color: rgba(16, 185, 129, 0.2); color: var(--accent-green); }

/* Drag and drop zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    background-color: rgba(30, 41, 59, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background-color: rgba(59, 130, 246, 0.05);
}

.upload-zone i {
    font-size: 64px;
    color: var(--primary);
    margin-bottom: 16px;
}

.upload-zone h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.upload-zone p {
    color: var(--text-muted);
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    background-color: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
}

/* Investigador Trends View */
#view-investigador {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.trends-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.trend-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.trend-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

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

.trend-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.trend-trend {
    font-size: 18px;
}
.trend-trend.up { color: var(--accent-green); }
.trend-trend.right { color: var(--text-muted); }

.trend-card h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-main);
}

.trend-card ul {
    list-style: none;
    font-size: 13px;
    color: var(--text-muted);
}

.trend-card ul li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.trend-card ul li:last-child {
    border-bottom: none;
}

/* Agent Chat UI */
.agent-chat-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    height: 450px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.agent-chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(30, 41, 59, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.agent-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.message.bot {
    align-self: flex-start;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.agent-chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.agent-chat-input-area input {
    flex: 1;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    color: white;
    outline: none;
}

.agent-chat-input-area input:focus {
    border-color: var(--primary);
}
/* Responsive Design (Mobile) */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 10px 0;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 2000;
        background: var(--sidebar-bg);
    }

    .logo-box {
        padding: 0 20px 10px;
        margin-bottom: 10px;
        font-size: 18px;
    }

    .nav-links {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        gap: 5px;
    }

    .nav-links a {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
        background: rgba(255,255,255,0.05);
    }

    .nav-links a.active {
        transform: none;
    }

    .top-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .user-profile {
        width: 100%;
        justify-content: center;
    }

    .view-content {
        padding: 0 15px 20px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .actions-bar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .action-buttons {
        flex-wrap: wrap;
        width: 100%;
    }

    .action-buttons .btn {
        flex: 1;
        justify-content: center;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -5px;
    }

    .data-table th, .data-table td {
        padding: 12px 10px;
        font-size: 13px;
        white-space: nowrap;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .trends-grid {
        grid-template-columns: 1fr;
    }

    .agent-chat-container {
        height: 350px;
    }
}

/* Scrollbar styling for mobile nav */
.nav-links::-webkit-scrollbar {
    height: 3px;
}
.nav-links::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}
