:root {
    /* Idakto Admin Theme: Official Colors */
    --primary-color: #00057B; /* Deep Blue Idakto */
    --primary-light: #6791FF; /* Light Blue Idakto */
    --secondary-color: #29c4a9; /* Idakto Green/Teal */
    --bg-color: #F8FAFC; /* Light gray/white background */
    --surface-color: #FFFFFF;
    --sidebar-bg: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --radius-md: 8px;
    --radius-lg: 16px;
    --font-family: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.brand {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}
.brand-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.side-nav {
    padding: 24px 16px;
    flex: 1;
}
.nav-section {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    margin-top: 20px;
    padding-left: 8px;
}
.nav-section:first-child { margin-top: 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}
.nav-item i { width: 20px; color: var(--text-secondary); text-align: center; transition: color 0.2s; }
.nav-item:hover { background-color: #F1F5F9; }
.nav-item.active { background-color: #EDE9FE; color: var(--primary-color); }
.nav-item.active i { color: var(--primary-color); }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    height: 70px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 5;
}
.header-title h1 {
    font-size: 1.25rem;
    font-weight: 600;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}
.search-bar {
    position: relative;
}
.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}
.search-bar input {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: #F1F5F9;
    font-family: var(--font-family);
    width: 250px;
    outline: none;
    transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--primary-light); background-color: white; }

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}
.admin-profile img { width: 36px; height: 36px; border-radius: 50%; }

/* Panels Container */
.panels-container {
    padding: 32px;
    padding-bottom: 120px; /* Space for the fixed omnibar */
}
.dashboard-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}
.dashboard-panel.active { display: block; }
.dashboard-panel.active.flex-panel { display: flex; flex-direction: column; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Integration Modules Cards */
.integrated-module-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.module-info {
    display: flex;
    align-items: center;
    gap: 16px;
}
.mod-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #F3E8FF;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.module-info h4 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-size: 1.05rem;
}
.module-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.mod-status {
    background: #D1FAE5;
    color: #059669;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
}
.stat-icon {
    width: 56px; height: 56px;
    background: #EDE9FE; color: var(--primary-color);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.stat-icon.verified { background: #D1FAE5; color: #10B981; }
.stat-icon.pending { background: #FEF3C7; color: #F59E0B; }
.stat-info h3 { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 4px; font-weight: 500; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); }

/* Table */
.table-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.table-header h2 { font-size: 1.1rem; font-weight: 600; }
.btn-primary {
    background: var(--primary-color); color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-family: var(--font-family); font-weight: 500;
}
.table-responsive { overflow-x: auto; }
.users-table {
    width: 100%;
    border-collapse: collapse;
}
.users-table th, .users-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.users-table th { font-size: 0.8rem; text-transform: uppercase; color: var(--text-secondary); font-weight: 600; background: #F8FAFC; }
.users-table td { font-size: 0.95rem; }
.users-table tr:last-child td { border-bottom: none; }

.badge {
    padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }

/* Integration Layout */
.integration-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}
.integration-info h2 { font-size: 1.5rem; margin-bottom: 10px; color: var(--primary-color); }
.integration-info p { color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }

/* Integration Chat */
.integration-chat-container {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.chat-messages {
    padding: 24px;
    height: 350px;
    overflow-y: auto;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 85%;
}
.message.outgoing {
    flex-direction: row-reverse;
    align-self: flex-end;
}
.message .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.message .bubble {
    background: white;
    padding: 14px 18px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    position: relative;
    word-break: break-word;
}
.message.outgoing .bubble {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.15);
}
.message.incoming .bubble {
    border-top-left-radius: 4px;
}

/* Markdown Styles inside Bubbles */
.message .bubble p { margin: 0 0 10px 0; }
.message .bubble p:last-child { margin: 0; }
.message .bubble strong { font-weight: 600; }
.message .bubble ul, .message .bubble ol { margin: 8px 0; padding-left: 20px; }
.message .bubble li { margin-bottom: 4px; }
.message .bubble h1, .message .bubble h2, .message .bubble h3 { margin: 12px 0 8px 0; font-weight: 600; font-size: 1.1rem; }
.message .bubble code { 
    background: rgba(0,0,0,0.05); 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-family: 'SFMono-Regular', Consolas, monospace; 
    font-size: 0.85em; 
}
.message.outgoing .bubble code { background: rgba(255,255,255,0.2); }
.message .bubble pre {
    background: #1E1E1E;
    color: #D4D4D4;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}
.message .bubble pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.chat-input-area { padding: 16px; background: white; border-top: 1px solid var(--border-color); display: flex; gap: 10px; }
.chat-input-area input { flex: 1; border: 1px solid var(--border-color); border-radius: 20px; padding: 10px 16px; outline: none; }
.chat-input-area input:focus { border-color: var(--primary-color); }
.chat-input-area button { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-color); color: white; border: none; cursor: pointer; }

/* Code Area */
.integration-code {
    display: flex;
    flex-direction: column;
}
.code-placeholder {
    background: #1E293B; color: #94A3B8; border-radius: var(--radius-lg); height: 100%; min-height: 500px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.code-placeholder i { font-size: 3rem; opacity: 0.5; }
.code-result-area { background: #1E1E1E; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); height: 100%; min-height: 500px;}
.code-header { background: #2D2D2D; padding: 12px 20px; display: flex; justify-content: space-between; color: #A0A0A0; font-family: monospace; font-size: 0.85rem; border-bottom: 1px solid #1E1E1E;}
.btn-copy { background: transparent; color: #A0A0A0; border: none; cursor: pointer; }
.btn-copy:hover { color: white; }
pre { margin: 0; padding: 20px; overflow-x: auto; height: calc(100% - 45px); }
code { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 0.9rem; line-height: 1.5; color: #D4D4D4; }
.hidden { display: none !important; }

/* Omnibar (Native Agentic Bar) fixed at bottom */
.agentic-omnibar {
    position: fixed;
    bottom: 40px;
    left: 260px; /* Sidebar width */
    right: 0;
    margin: 0 auto;
    width: 60%;
    max-width: 800px;
    z-index: 100;
    display: flex;
    align-items: center;
    background: var(--surface-color);
    border: 2px solid var(--primary-light);
    border-radius: 30px;
    padding: 10px 20px;
    box-shadow: 0 10px 30px rgba(109, 40, 217, 0.2);
    transition: all 0.3s ease;
}
.agentic-omnibar:focus-within {
    box-shadow: 0 15px 40px rgba(109, 40, 217, 0.4);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}
.omni-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-right: 12px;
}
.agentic-omnibar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    padding: 8px 0;
    color: var(--text-primary);
    font-family: var(--font-family);
}
.agentic-omnibar input::placeholder {
    color: #94A3B8;
}
.omni-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.omni-btn:hover { background: #5B21B6; }
.omni-btn.loading { opacity: 0.7; cursor: not-allowed; }

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #10B981;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 1rem;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast.error { background: #EF4444; }
\n/* Code Highlighting Override */\n.chat-messages pre code.hljs { background: transparent !important; padding: 0 !important; }\n.code-result-area pre code.hljs { background: transparent !important; }
\n/* Markdown Highlights */\n.hljs-strong { font-weight: bold !important; color: #F8FAFC !important; }\n.hljs-emphasis { font-style: italic !important; }\n.hljs-section { font-weight: bold !important; color: #38BDF8 !important; }
