:root {
    --bg-dark: #07070a;
    --bg-panel: rgba(20, 20, 28, 0.4);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-main: #f0f0f5;
    --text-muted: #8a8a9d;
    --neon-blue: #00f3ff;
    --neon-blue-dim: rgba(0, 243, 255, 0.15);
    --neon-purple: #9d00ff;
    --neon-purple-dim: rgba(157, 0, 255, 0.15);
    --neon-orange: #ff3366;
    --neon-orange-dim: rgba(255, 51, 102, 0.15);
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    background-image: radial-gradient(circle at 15% 50%, rgba(157, 0, 255, 0.05), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(0, 243, 255, 0.05), transparent 25%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 10, 15, 0.5);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 8px;
}

.logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-radius: 8px;
    box-shadow: 0 0 15px var(--neon-blue-dim);
}

.brand h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.badge {
    background: var(--neon-purple-dim);
    border: 1px solid var(--neon-purple);
    color: var(--neon-purple);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.nav-item.active {
    color: var(--neon-blue);
    background: var(--neon-blue-dim);
    border-left: 3px solid var(--neon-blue);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 72px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    background: rgba(7, 7, 10, 0.5);
    backdrop-filter: blur(10px);
    z-index: 5;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 8px 16px;
    border-radius: 20px;
    width: 300px;
}

.search-bar svg {
    color: var(--text-muted);
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    width: 100%;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-blue), #0077ff);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--neon-blue-dim);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 243, 255, 0.3);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: url('/mascot.png') center/cover;
    border: 2px solid var(--border-glass);
}

/* Dashboard Content */
.dashboard-scroll {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.dashboard-scroll h2 {
    font-size: 28px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 32px;
}

.glass {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.metric-card {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}
.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.15);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    animation: breathingGlow 3s infinite ease-in-out alternate;
}

@keyframes breathingGlow {
    from { filter: drop-shadow(0 0 5px currentColor); }
    to { filter: drop-shadow(0 0 15px currentColor) drop-shadow(0 0 25px currentColor); }
}

.neon-blue { background: var(--neon-blue-dim); color: var(--neon-blue); box-shadow: 0 0 20px var(--neon-blue-dim); }
.neon-purple { background: var(--neon-purple-dim); color: var(--neon-purple); box-shadow: 0 0 20px var(--neon-purple-dim); }
.neon-orange { background: var(--neon-orange-dim); color: var(--neon-orange); box-shadow: 0 0 20px var(--neon-orange-dim); }

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

.metric-value {
    font-size: 32px;
    font-weight: 700;
}

.metric-trend {
    margin-top: 12px;
    font-size: 12px;
    font-weight: 500;
}
.up { color: #00ff88; }
.stable { color: var(--text-muted); }
.warn { color: var(--neon-orange); }

.alert-state::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--neon-orange);
    box-shadow: 0 0 10px var(--neon-orange);
}

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

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

.panel-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* Agent List */
.agent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.agent-row:hover {
    border-color: var(--border-glass);
    background: rgba(255,255,255,0.02);
}

.agent-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot.active { background: #00ff88; box-shadow: 0 0 8px #00ff88; }
.status-dot.idle { background: var(--text-muted); }

.agent-name {
    font-weight: 500;
    font-size: 14px;
}

.agent-task {
    font-size: 12px;
    color: var(--text-muted);
}

/* Terminal Panel */
.terminal-panel {
    display: flex;
    flex-direction: column;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}
.terminal-dots span {
    width: 10px; height: 10px; border-radius: 50%;
}
.terminal-dots span:nth-child(1) { background: #ff5f56; }
.terminal-dots span:nth-child(2) { background: #ffbd2e; }
.terminal-dots span:nth-child(3) { background: #27c93f; }

.terminal-window {
    background: #020202;
    border-radius: 8px;
    flex: 1;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.05);
}

.log-line {
    margin-bottom: 6px;
    line-height: 1.4;
}

.log-line.system {
    color: #6b7a99;
}
.log-line.action {
    color: var(--neon-blue);
}
.log-line.success {
    color: #00ff88;
}
.log-line.warn {
    color: #ffbd2e;
}
.log-line.error {
    color: #ff5f56;
    text-shadow: 0 0 8px rgba(255, 95, 86, 0.4);
}
.log-line.soul {
    color: #cc88ff;
    font-style: italic;
}
.log-line::before {
    content: "›";
    margin-right: 8px;
    opacity: 0.5;
}

/* API Configuration Section */
.api-panel {
    margin-bottom: 24px;
}

.api-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.dark-input, .dark-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 10px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.dark-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a9d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    cursor: pointer;
}

.dark-input:focus, .dark-select:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue-dim);
}

/* Usage Meter */
.usage-meter-container {
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
    position: relative;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, var(--neon-blue));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    transition: width 1s cubic-bezier(0.1, 0, 0.1, 1);
}

/* Capability Library (Workflows) */
.capability-header {
    margin-top: 48px;
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.capability-section {
    margin-bottom: 40px;
}

.capability-section h4 {
    color: var(--neon-purple);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 8px;
}

.capability-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.capability-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.capability-card:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
}

.capability-info h5 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-main);
}

.capability-info p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Modern Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #8a8a9d;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue-dim);
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: #fff;
}

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.kanban-column {
    flex: 1;
    background: rgba(20, 20, 28, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 400px;
}

.kanban-header {
    padding: 16px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(0,0,0,0.2);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.kanban-cards {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
}

.k-card {
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.k-card:active {
    cursor: grabbing;
}

.k-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border-color: rgba(255,255,255,0.2);
}

.k-agent {
    font-size: 13px;
    font-weight: 600;
    color: var(--neon-blue);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.k-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-main);
}

.k-progress-bg {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.k-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-blue));
    transition: width 0.5s ease-out;
}

.k-actions {
    display: flex;
    gap: 8px;
}

.btn-mini {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mini:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
}

/* Image Studio Block */
.image-studio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .image-studio-grid, .orchestrator-grid {
        grid-template-columns: 1fr;
    }
}

/* Orchestrator Layout */
.orchestrator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Single Page Application Views */
.nav-view {
    display: none;
    animation: fadeInView 0.3s ease-out forwards;
}

.nav-view.active-view {
    display: block;
}

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

/* Vault Warden Baby Gate */
.vault-warden-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}

.vault-modal {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--neon-purple);
    box-shadow: 0 0 30px rgba(157, 0, 255, 0.2);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeInScale 0.4s ease-out forwards;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ─── Modal Overlay ─────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(7, 7, 10, 0.85);
    backdrop-filter: blur(12px);
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInView 0.2s ease-out forwards;
}

.modal-box {
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
    animation: fadeInScale 0.25s ease-out forwards;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

/* ─── Data Table (Ledger / Knowledge) ───────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-glass);
}

.data-table td {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    line-height: 1.5;
}

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

.data-table .td-id {
    color: var(--text-muted);
    width: 40px;
}

.data-table .td-time {
    color: var(--text-muted);
    white-space: nowrap;
    font-size: 11px;
    width: 140px;
}

.data-table .td-type {
    color: #cc88ff;
    width: 140px;
}

.empty-state {
    text-align: center;
    padding: 48px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.empty-state svg {
    margin-bottom: 12px;
    opacity: 0.3;
}

/* ─── Provider Pills ─────────────────────────────────── */
.provider-pill {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}
.provider-pill:hover {
    border-color: var(--neon-purple);
    color: var(--text-main);
}
.provider-pill.active {
    background: rgba(157, 0, 255, 0.15);
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    font-weight: 600;
}

/* ─── Kanban wrapper scroll ──────────────────────────── */
.kanban-wrapper {
    overflow-x: auto;
}

/* ═══════════════════════════════════════════════════
   TALK TO CLAW — Chat Interface
═══════════════════════════════════════════════════ */

.chat-view-wrapper {
    display: none; /* overridden by active-view */
    flex-direction: column;
    height: calc(100vh - 72px); /* full height minus topbar */
    overflow: hidden;
    padding: 0;
}

.chat-view-wrapper.active-view {
    display: flex !important;
}

.chat-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px 16px;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(7, 7, 10, 0.6);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

/* Message list — scrollable, takes all remaining space */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* Individual message row */
.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    animation: fadeInView 0.2s ease-out forwards;
}

/* CLAW messages — left aligned */
.claw-message {
    justify-content: flex-start;
}

/* User messages — right aligned */
.user-message {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

/* Bubbles */
.chat-bubble {
    max-width: 68%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

.claw-bubble {
    background: rgba(157, 0, 255, 0.08);
    border: 1px solid rgba(157, 0, 255, 0.25);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}

.user-bubble {
    background: rgba(0, 243, 255, 0.08);
    border: 1px solid rgba(0, 243, 255, 0.2);
    color: var(--text-main);
    border-bottom-right-radius: 4px;
}

/* ─────────────────────────────────────── */
/* Markdown Rendering Inside Chat Bubbles  */
/* ─────────────────────────────────────── */
.chat-bubble p {
    margin-bottom: 8px;
}
.chat-bubble p:last-child {
    margin-bottom: 0;
}
.chat-bubble code {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #4CAF50;
}
.chat-bubble pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.chat-bubble pre code {
    background: transparent;
    padding: 0;
    color: var(--text-main);
}
.chat-bubble ul, .chat-bubble ol {
    padding-left: 20px;
    margin-bottom: 8px;
}
.chat-bubble blockquote {
    border-left: 3px solid var(--neon-purple);
    padding-left: 12px;
    margin: 8px 0;
    font-style: italic;
    color: var(--text-muted);
}
.chat-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}
.chat-bubble th, .chat-bubble td {
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.chat-bubble th {
    background: rgba(255, 255, 255, 0.05);
}

/* CLAW avatar circle */
.claw-avatar-bubble {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-purple), #5500cc);
    border: 1px solid rgba(157, 0, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(157, 0, 255, 0.3);
}

/* User avatar circle */
.user-avatar-bubble {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-blue), #0044ff);
    border: 1px solid rgba(0, 243, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
}

/* Thinking indicator */
.thinking-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
}

.thinking-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--neon-purple);
    opacity: 0.6;
    animation: thinkPulse 1.4s infinite ease-in-out;
}
.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinkPulse {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
    40%           { transform: scale(1.2); opacity: 1; }
}

/* Input row anchored to bottom */
.chat-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px 20px;
    border-top: 1px solid var(--border-glass);
    background: rgba(7, 7, 10, 0.7);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.chat-text-input {
    flex: 1;
    height: 48px;
    border-radius: 24px !important;
    padding: 0 20px !important;
    font-size: 14px !important;
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Mic button */
.chat-mic-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(157, 0, 255, 0.1);
    border: 2px solid rgba(157, 0, 255, 0.4);
    color: var(--neon-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-mic-btn:hover {
    background: rgba(157, 0, 255, 0.2);
    border-color: var(--neon-purple);
    box-shadow: 0 0 16px rgba(157, 0, 255, 0.3);
}

.chat-mic-btn.listening {
    background: rgba(255, 0, 85, 0.15);
    border-color: #ff0055;
    color: #ff0055;
    animation: micPulse 1s infinite;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.4); }
    50%       { box-shadow: 0 0 0 10px rgba(255, 0, 85, 0); }
}

/* ═══════════════════════════════════════════════════════ */
/* TRADING DASHBOARD — Feature #1                         */
/* ═══════════════════════════════════════════════════════ */

.trade-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 18px 20px;
    text-align: center;
    backdrop-filter: blur(12px);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.trade-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.trade-stat-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.trade-stat-card:hover::before {
    opacity: 1;
}

.trade-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.trade-stat-value {
    font-size: 24px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.5px;
}

.portfolio-token-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.2s ease;
}

.portfolio-token-card:hover {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(0, 255, 136, 0.15);
}

.portfolio-token-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.portfolio-token-symbol {
    font-size: 13px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.portfolio-token-mint {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.25);
    font-family: 'JetBrains Mono', monospace;
}

.portfolio-token-balance {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
}

.portfolio-token-usd {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════ */
/* LIGHT THEME — Feature #7                               */
/* ═══════════════════════════════════════════════════════ */

body.light-theme {
    --bg-dark: #f5f5f8;
    --bg-panel: rgba(255, 255, 255, 0.7);
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-main: #1a1a2e;
    --text-muted: #6b7280;
    background-image: radial-gradient(circle at 15% 50%, rgba(157, 0, 255, 0.03), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(0, 243, 255, 0.03), transparent 25%);
}

body.light-theme .sidebar {
    background: rgba(255, 255, 255, 0.85);
    border-right-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .panel.glass {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

body.light-theme .topbar {
    background: rgba(255, 255, 255, 0.8);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .dark-input {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-main);
}

body.light-theme .trade-stat-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .chat-bubble.claw-bubble {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .chat-bubble.user-bubble {
    background: rgba(157, 0, 255, 0.08);
    border-color: rgba(157, 0, 255, 0.15);
}

body.light-theme .nav-item:hover,
body.light-theme .nav-item.active {
    background: rgba(0, 0, 0, 0.06);
}

/* ═══════════════════════════════════════════════════════ */
/* MOBILE RESPONSIVE — Feature #9                         */
/* ═══════════════════════════════════════════════════════ */

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9;
    backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        width: 260px;
        z-index: 100;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .topbar {
        padding: 12px 16px !important;
    }

    .search-bar {
        display: none !important;
    }

    #btnTestWebhook {
        display: none !important;
    }

    .dashboard-scroll {
        padding: 16px !important;
    }

    /* Stack trade panels vertically */
    #view-trading > div[style*="display:flex"] {
        flex-direction: column !important;
    }

    #view-trading section.panel {
        max-width: 100% !important;
        min-width: unset !important;
    }

    #tradeStatsRow {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    #healthGrid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    #tradeStatsRow {
        grid-template-columns: 1fr !important;
    }

    #healthGrid {
        grid-template-columns: 1fr !important;
    }

    .trade-stat-value {
        font-size: 20px !important;
    }
}

/* ═══════════════════════════════════════════════════════ */
/* NOTIFICATION TOAST — Feature #8                        */
/* ═══════════════════════════════════════════════════════ */

.notif-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(20, 20, 28, 0.95);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 12px;
    padding: 14px 20px;
    color: #f0f0f5;
    font-size: 13px;
    max-width: 360px;
    z-index: 9999;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.4s ease, toastOut 0.4s ease 4.6s forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.light-theme .notif-toast {
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a2e;
    border-color: rgba(0, 255, 136, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

@keyframes toastIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}
