:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #0d1321;
    --bg-card: #111827;
    --bg-hover: #1a2332;
    --border: #1e2a3a;
    --border-hover: #2d3f52;
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #22c55e;
    --accent-orange: #f97316;
    --accent-red: #ef4444;
    --accent-cyan: #06b6d4;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

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

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

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

.logo-icon {
    font-size: 28px;
}

.logo-title {
    font-size: 16px;
    font-weight: 600;
    display: block;
}

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

.sidebar-stats {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
}

.stat-value.green {
    color: var(--accent-green);
}

.stat-value.red {
    color: var(--accent-red);
}

.sidebar-nav {
    padding: 16px 12px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.nav-icon {
    font-size: 16px;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-purple);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.nav-badge.orange {
    background: var(--accent-orange);
}

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

.plan-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.upgrade-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.content-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
}

.btn-submit {
    padding: 8px 16px;
    background: var(--accent-green);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-card-icon {
    font-size: 24px;
}

.stat-card-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-card-badge.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.stat-card-badge.green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
}

.stat-card-badge.orange {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
}

.stat-card-badge.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Panels */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

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

.panel-header h2 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-icon {
    font-size: 18px;
}

/* Scenarios List */
.scenarios-list {
    padding: 12px;
}

.scenario-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-primary);
    transition: all 0.2s;
}

.scenario-item:hover {
    background: var(--bg-hover);
}

.scenario-item.attacking {
    border: 1px solid var(--accent-red);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.scenario-item.defended {
    border: 1px solid var(--accent-green);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

.scenario-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scenario-icon {
    font-size: 18px;
}

.scenario-name {
    font-size: 14px;
    font-weight: 500;
    display: block;
}

.scenario-desc {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.scenario-severity {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.scenario-severity.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.scenario-severity.high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
}

.scenario-severity.medium {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

/* Console */
.console-status {
    font-size: 12px;
    color: var(--text-muted);
}

.console-status.running {
    color: var(--accent-green);
}

.console {
    background: #0c0c0c;
    padding: 16px;
    height: 280px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 13px;
}

.console-line {
    padding: 3px 0;
    color: var(--text-secondary);
}

.console-line.info {
    color: var(--accent-cyan);
}

.console-line.attack {
    color: var(--accent-red);
}

.console-line.defense {
    color: var(--accent-green);
}

/* Results */
.results-content {
    display: flex;
    padding: 24px;
    gap: 32px;
}

.result-score-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.score-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-green) 0deg, var(--accent-green) 0deg, var(--bg-primary) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-ring::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border-radius: 50%;
}

.score-number {
    position: relative;
    z-index: 1;
    font-size: 28px;
    font-weight: 700;
}

.score-status {
    font-size: 20px;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.score-status.pass {
    color: var(--accent-green);
}

.score-label {
    font-size: 13px;
    color: var(--text-muted);
}

.result-details {
    flex: 1;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Runs List */
.runs-list {
    padding: 16px;
}

.run-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 8px;
}

.run-id {
    font-family: monospace;
    font-size: 13px;
    margin-bottom: 4px;
}

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

.run-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.run-score {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-purple);
}

.run-status {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.run-status.pass {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
}

/* Scenarios Grid */
.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.scenario-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.scenario-detail-card.featured {
    border-color: var(--accent-purple);
}

.sdc-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.sdc-icon {
    font-size: 28px;
}

.sdc-bounty {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 14px;
}

.scenario-detail-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.scenario-detail-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.sdc-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sdc-tag {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.sdc-tag.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.sdc-tag.high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
}

.sdc-tag.medium {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

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

/* Pipeline Stats */
.pipeline-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.pipeline-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 32px;
    text-align: center;
}

.ps-value {
    font-size: 28px;
    font-weight: 700;
    display: block;
}

.ps-value.green {
    color: var(--accent-green);
}

.ps-value.purple {
    color: var(--accent-purple);
}

.ps-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Reports List */
.reports-list {
    padding: 16px;
}

.report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 8px;
}

.report-status {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.report-status.pending {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.report-status.accepted {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
}

.report-status.paid {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    position: relative;
}

.pricing-card.featured {
    border-color: var(--accent-purple);
}

.pc-ribbon {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-purple);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.pc-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.pc-price {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 24px;
}

.pc-price span {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 400;
}

.pc-features {
    list-style: none;
    text-align: left;
    margin-bottom: 24px;
}

.pc-features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.pc-features li.disabled {
    color: var(--text-muted);
}

/* Bounty Table */
.bounty-table {
    padding: 16px;
}

.bounty-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.bounty-row.header {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.severity-tag {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.severity-tag.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.severity-tag.high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
}

.severity-tag.medium {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.severity-tag.low {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-content h2 {
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-price {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 24px;
}