:root {
    --bg-dark: #0f111a;
    --bg-panel: rgba(26, 29, 41, 0.7);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-primary: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --accent-secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-color: rgba(255, 255, 255, 0.1);
    --gold-glow: rgba(245, 158, 11, 0.4);
    --glass-blur: blur(12px);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100vh;
}

/* Glassmorphism utilities */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Header */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #e2e8f0, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo .icon {
    font-size: 1.8rem;
}

.badge {
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-tier {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    margin-left: 0.5rem;
}

.bottom-nav {
    margin-top: auto;
    padding: 0.75rem 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.footer-content p {
    margin-bottom: 0.25rem;
}

.trademark-notice {
    font-size: 0.7rem;
    opacity: 0.7;
}

.header-controls {

    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.dot.active {
    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 6px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline:hover {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}
.btn-golden {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    color: #fffbeb;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.btn-golden:hover {
    box-shadow: 0 0 20px var(--gold-glow);
    transform: translateY(-1px);
}

/* Dashboard Grid Component */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
}

.col-left,
.col-right {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.panel {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.live-indicator {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 2px 6px;
    border-radius: 4px;
    animation: flash 2s infinite;
}

@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.stat-card h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 0 10px var(--accent-glow);
}

/* Activity Feed */
#activity-feed {
    flex: 2;
}

.feed-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feed-item {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--accent-primary);
    padding: 1rem;
    border-radius: 4px;
    animation: slideIn 0.3s ease-out;
}

.feed-item.type-issue {
    border-color: var(--warning);
}

.feed-item.type-mr {
    border-color: var(--accent-secondary);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.feed-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.feed-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.feed-item.type-issue .feed-badge {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.feed-item.type-mr .feed-badge {
    background: rgba(236, 72, 153, 0.2);
    color: var(--accent-secondary);
}

.feed-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.feed-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-tag {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
}

.status-tag.done {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-tag.progress {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-primary);
}

/* AI Analysis Panel */
.highlight-panel {
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.analysis-content {
    overflow-y: auto;
    font-size: 0.9rem;
    white-space: pre-wrap;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex: 1;
    font-family: 'Consolas', monospace;
    color: #a7e22e;
    /* Code-like green for AI output */
}

/* Configuration & Pipelines */
.config-list,
.pipeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.config-item,
.pipeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 0.85rem;
}

.config-key {
    color: var(--text-muted);
}

.config-val {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

.pipe-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pipe-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pipe-indicator.success {
    background: var(--success);
    box-shadow: 0 0 5px var(--success);
}

.pipe-indicator.failed {
    background: var(--danger);
    box-shadow: 0 0 5px var(--danger);
}

.pipe-indicator.running {
    background: var(--warning);
    box-shadow: 0 0 5px var(--warning);
}

.empty-state {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Duo Agent Tools Panel */
.badge-duo {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.tool-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tool-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
}

.tool-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    padding-top: 2px;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    margin-bottom: 4px;
}

.tool-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}
