:root {
    --bg-main: #0B0F19;
    --bg-panel: rgba(17, 24, 39, 0.7);
    --bg-card: rgba(31, 41, 55, 0.4);
    --bg-card-hover: rgba(55, 65, 81, 0.6);
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --accent: #6366F1;
    --accent-glow: rgba(99, 102, 241, 0.5);
    --border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(12px);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow: hidden;
    /* Efecto de luces de fondo sutiles */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
}

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

/* SIDEBAR */
.sidebar {
    width: 280px;
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 10;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    text-align: center;
}

.logo-container i {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.logo-container h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-container p {
    font-size: 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}

.divisions-nav {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Esconder barra de scroll */
.divisions-nav::-webkit-scrollbar { width: 4px; }
.divisions-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.nav-item {
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, transparent 100%);
    color: var(--accent);
    border-left: 3px solid var(--accent);
}

.nav-item .color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #10B981;
    border-radius: 50%;
}

.pulse {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}

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

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.top-header {
    height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 15, 25, 0.5);
    backdrop-filter: var(--glass-blur);
    z-index: 5;
}

.search-container {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 20px;
    width: 500px;
    height: 48px;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-container i {
    color: var(--text-muted);
    font-size: 20px;
    margin-right: 12px;
}

.search-container input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    width: 100%;
    font-size: 15px;
}

.stat-badge {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* AGENTS GRID */
.agents-container {
    padding: 40px;
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
}


.grid-header {
    margin-bottom: 24px;
}

.grid-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* CARD GLASSMORPHISM */
.agent-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: var(--card-color, var(--accent));
    opacity: 0.8;
}

.agent-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    border-color: rgba(255,255,255, 0.2);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}

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

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255,255,255,0.05);
}

.badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255,255,255,0.1);
}

.agent-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.agent-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 12px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #111827;
    border: 1px solid var(--border);
    border-radius: 24px;
    width: 100%;
    max-width: 600px;
    padding: 40px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 24px; right: 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover { color: white; }

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.modal-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: rgba(255,255,255,0.05);
}

.modal-body h3 {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    margin-top: 24px;
}

.modal-body p {
    font-size: 16px;
    line-height: 1.6;
    color: #D1D5DB;
}

.modal-body code {
    display: block;
    background: rgba(0,0,0,0.5);
    padding: 16px;
    border-radius: 8px;
    font-family: monospace;
    color: #A5B4FC;
    border: 1px solid rgba(255,255,255,0.1);
}

.modal-actions {
    margin-top: 32px;
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #4F46E5;
}

.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

@keyframes spin { 100% { transform: rotate(360deg); } }
