:root {
    --bg-base: #0F172A;
    --bg-surface: #1E293B;
    --bg-surface-hover: #334155;

    --primary: #3B82F6;
    --primary-hover: #2563EB;

    --text-main: #F8FAFC;
    --text-muted: #94A3B8;

    --border: #334155;

    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;

    --radius: 8px;
    --font: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

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

.sidebar {
    width: 340px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 10;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Sidebar Elements */
header.logo-area {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    color: var(--primary);
}

header h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

header h1 span {
    color: var(--primary);
}

.input-section {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
}

.helper-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -8px;
}

textarea {
    background-color: var(--bg-base);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: var(--radius);
    padding: 12px;
    font-family: monospace;
    font-size: 0.85rem;
    height: 200px;
    resize: none;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Utils */
.flex {
    display: flex;
}

.gap-2 {
    gap: 8px;
}

.flex-1 {
    flex: 1;
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--bg-base);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: #2e3b4e;
}

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

.btn-outline:hover {
    color: var(--text-main);
    border-color: var(--text-main);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Health Overview */
.health-overview {
    padding: 24px;
}

.health-score {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 24px;
}

.score-ring {
    width: 100%;
    height: 100%;
}

.ring-bg {
    fill: none;
    stroke: var(--bg-base);
    stroke-width: 3.8;
}

.ring-fill {
    fill: none;
    stroke: var(--success);
    stroke-width: 3.8;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out, stroke 0.3s;
}

.score-text {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-text span {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.score-text small {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-box {
    background-color: var(--bg-base);
    padding: 12px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-val {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Main Content Header */
.header-actions {
    height: 72px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-base);
    z-index: 5;
}

.header-actions h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.toggle-group {
    display: flex;
    background-color: var(--bg-surface);
    border-radius: var(--radius);
    padding: 4px;
    border: 1px solid var(--border);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
}

/* Views */
.view-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    overflow: auto;
}

.view.active {
    opacity: 1;
    pointer-events: all;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.empty-state svg {
    color: var(--border);
    margin-bottom: 24px;
}

.empty-state h3 {
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 1.2rem;
}

/* Graph Container */
#graphContainer {
    width: 100%;
    height: 100%;
    background-color: var(--bg-base);
}

#graphContainer svg {
    width: 100%;
    height: 100%;
    cursor: grab;
}

#graphContainer svg:active {
    cursor: grabbing;
}

/* Issues View */
.issues-list {
    padding: 32px;
    max-width: 800px;
    margin: 0 auto;
}

.issue-section {
    margin-bottom: 32px;
}

.issue-section h3 {
    margin-bottom: 16px;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.issue-card {
    background-color: var(--bg-surface);
    border-left: 4px solid var(--border);
    padding: 16px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 12px;
}

.issue-card.error {
    border-left-color: var(--error);
}

.issue-card.warning {
    border-left-color: var(--warning);
}

.issue-card.success {
    border-left-color: var(--success);
}

.issue-card h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    font-weight: 500;
}

.issue-card code {
    background-color: var(--bg-base);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.mismatch-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mismatch-row {
    display: flex;
    justify-content: space-between;
    background-color: var(--bg-base);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.pkg-name {
    color: var(--text-muted);
}

.pkg-ver {
    font-family: monospace;
    font-weight: 600;
    color: var(--warning);
}