/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0e1a;
    color: #e2e8f0;
    overflow-x: hidden;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(145deg, #1e293b 0%, #334155 100%);
    border-right: 1px solid #475569;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid #475569;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #60a5fa;
    margin-bottom: 0.25rem;
}

.logo p {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 400;
}

/* Navigation */
.nav-menu {
    flex: 1;
    padding: 1rem 0;
}

.nav-menu ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-left-color: #60a5fa;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-left-color: #3b82f6;
}

.nav-item i {
    width: 1.25rem;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.nav-item span {
    font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #475569;
    background: rgba(0, 0, 0, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: #e2e8f0;
}

.user-info i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
    color: #60a5fa;
}

.last-updated {
    font-size: 0.75rem;
    color: #64748b;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    background: #0f172a;
}

/* Header */
.header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h2 {
    font-size: 1.875rem;
    font-weight: 600;
    color: #f8fafc;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-refresh {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-refresh:hover {
    background: #2563eb;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Status Dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-dot.idle {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.status-dot.working {
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Content Container */
.content-container {
    padding: 2rem;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #f8fafc;
}

.section-header p {
    color: #94a3b8;
    font-size: 1rem;
}

/* Agents Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Agent Cards */
.agent-card {
    background: linear-gradient(145deg, #1e293b 0%, #334155 100%);
    border: 1px solid #475569;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.agent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: #60a5fa;
}

.agent-card:hover::before {
    opacity: 1;
}

.agent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.agent-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f8fafc;
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agent-status.online {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.agent-status.idle {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.agent-status.working {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.agent-status.offline {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.agent-role {
    color: #60a5fa;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.agent-description {
    color: #cbd5e1;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.agent-footer {
    display: flex;
    justify-content: between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #475569;
}

.agent-last-seen {
    font-size: 0.75rem;
    color: #64748b;
}

/* Agent Stats */
.agents-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(145deg, #1e293b 0%, #334155 100%);
    border: 1px solid #475569;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.online {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.stat-icon.idle {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.stat-icon.working {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.stat-icon.offline {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.stat-info h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
    
    .agents-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .content-container {
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .sidebar {
        width: 100%;
        position: static;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard {
        flex-direction: column;
    }
    
    .agents-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}