:root {
    --bg-app: #fcfbf9;
    --bg-sidebar: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --accent-color: #2d3436;
    --border-color: #dfe6e9;
    --highlight-blue: #74b9ff;
    --highlight-red: #ff7675;
    --highlight-green: #55efc4;
    --highlight-yellow: #ffeaa7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-app);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 380px;
    /* Slightly wider for vertical buttons */
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.sidebar header {
    margin-bottom: 2rem;
}

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

.brand h1 {
    font-family: 'Merriweather', serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 2.2rem;
}

/* Controls */
.control-group {
    margin-bottom: 2rem;
}

.control-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.toggle-group {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.toggle-group.vertical {
    display: flex;
    flex-direction: column;
}

.toggle-btn {
    width: 100%;
    border: none;
    background: white;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
}

.toggle-btn:last-child {
    border-bottom: none;
}

.toggle-btn.active {
    background: var(--accent-color);
    color: white;
    font-weight: 500;
}

.toggle-btn:hover:not(.active) {
    background: #f5f5f5;
}

input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
}

/* Details Panel */
.details-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: auto;
    border: 1px solid var(--border-color);
}

.details-panel.hidden {
    display: none;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.avatar {
    width: 48px;
    height: 48px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Merriweather', serif;
    font-weight: 700;
}

.profile-header h2 {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    margin: 0;
}

.badge {
    font-size: 0.75rem;
    background: #dfe6e9;
    padding: 2px 8px;
    border-radius: 10px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.metric strong {
    font-size: 0.9rem;
}

.risk-badge.high {
    color: #d63031;
}

.risk-badge.low {
    color: #00b894;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    flex: 1;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    border: none;
}

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

.btn.secondary {
    background: white;
    border: 1px solid var(--border-color);
}

.empty-state {
    margin-top: auto;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
    padding: 2rem;
}

.details-panel:not(.hidden)~.empty-state {
    display: none;
}

/* Viz Container */
.viz-container {
    flex: 1;
    position: relative;
    background: var(--bg-app);
}

#graph {
    width: 100%;
    height: 100%;
}

.legend {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-size: 0.8rem;
    min-width: 150px;
}

.legend h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}