import gradio as gr import pandas as pd # Custom CSS to match the screenshot exactly custom_css = """ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap'); .gradio-container { background-color: #06090f !important; font-family: 'Inter', sans-serif !important; color: white !important; } /* Sidebar Styling */ .sidebar-content { padding: 20px; background: #0b0f19; height: 100%; border-right: 1px solid #1f2937; } .logo-area { text-align: center; margin-bottom: 30px; } .status-badge { background: rgba(16, 185, 129, 0.1); border: 1px solid #10b981; color: #10b981; padding: 8px 15px; border-radius: 20px; font-size: 12px; text-align: center; margin-bottom: 40px; } /* Metric Cards */ .metrics-row { display: flex; gap: 15px; margin-bottom: 25px; } .card { flex: 1; background: #111827; padding: 20px; border-radius: 12px; text-align: center; border-top: 3px solid #3b82f6; /* Default blue */ } .card.threat { border-top-color: #ef4444; } .card.safe { border-top-color: #10b981; } .card.rate { border-top-color: #8b5cf6; } .card-val { font-size: 28px; font-weight: 700; margin-bottom: 5px; } .card-label { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: 1px; } /* Accordion & Buttons */ .establish-btn { background: linear-gradient(90deg, #3b82f6 0%, #00d4ff 100%) !important; border: none !important; color: white !important; font-weight: 600 !important; } /* Bottom Input Bar */ .chat-container { background: #111827 !important; border: 1px solid #3b82f6 !important; border-radius: 10px !important; } """ with gr.Blocks(css=custom_css, theme=gr.themes.Default()) as demo: # --- SIDEBAR PANEL --- with gr.Sidebar(elem_id="sidebar"): with gr.Column(elem_classes="sidebar-content"): with gr.Column(elem_classes="logo-area"): gr.HTML("""
No activity recorded yet.
") gr.Markdown("---") gr.Markdown("### 📄 DOCUMENT UPLOAD") gr.File(label=None, file_count="multiple", elem_id="file-upload") gr.Markdown("200MB per file • PDF, TXT, DOCX
") # --- MAIN CONTENT AREA --- with gr.Column(): # Header Section gr.HTML("""Secured by IntelliGuard • 4-Layer Prompt Injection Detection