:root {
    --butter-bg: #FFFBEB;
    --butter-accent: #FEF3C7;
    --charcoal: #1A1A1A;
    --gold: #F59E0B;
    --border: #E5E7EB;
}

body { margin: 0; font-family: -apple-system, sans-serif; background: var(--butter-bg); color: var(--charcoal); }
.app-wrapper { display: flex; min-height: 100vh; }

/* Sidebar Container */
.sidebar {
    width: 260px;
    background: var(--charcoal);
    padding: 40px 20px;
    display: flex;
    flex-direction: column; /* This stacks branding, nav, and footer vertically */
    position: sticky;
    top: 0;
    height: 100vh;
    color: white;
    box-sizing: border-box;
}

/* Navigation Links */
#main-nav {
    display: flex;
    flex-direction: column; /* FORCES LINKS TO STACK */
    gap: 10px; /* Space between links */
    margin-top: 20px;
}

.nav-item {
    color: #9CA3AF;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    display: block; /* Makes the background fill the sidebar width */
    transition: 0.2s;
}

.nav-item.active {
    background: var(--gold);
    color: var(--charcoal);
    font-weight: 700;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto; /* Pushes "Secure Node" to the bottom */
    font-size: 11px;
    color: #4B5563;
    border-top: 1px solid #2D2D2D;
    padding-top: 20px;
}

/* Content */
.content-area { flex: 1; padding: 50px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }

/* Stats & Grid */
.stats-row { display: flex; gap: 20px; margin-bottom: 40px; }
.stat-card { background: white; padding: 20px; border-radius: 15px; flex: 1; border: 1px solid var(--border); box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.stat-card .label { font-size: 11px; font-weight: 700; color: #6B7280; text-transform: uppercase; }
.stat-card .value { display: block; font-size: 24px; font-weight: 800; margin-top: 5px; }

.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.user-card { background: white; padding: 25px; border-radius: 15px; border: 1px solid var(--border); transition: 0.3s; }
.user-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.05); }

/* Role Badges */
.badge { font-size: 10px; font-weight: 800; padding: 4px 8px; border-radius: 5px; background: var(--butter-accent); color: var(--gold); }

/* Modal */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }
.modal-content { background: white; margin: 10% auto; padding: 40px; border-radius: 20px; width: 400px; position: relative; }
.close-modal { position: absolute; right: 20px; top: 15px; font-size: 24px; cursor: pointer; }

/* Toasts */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; }
.toast { background: var(--charcoal); color: white; padding: 15px 25px; border-radius: 10px; margin-top: 10px; animation: slideIn 0.3s; border-left: 5px solid var(--gold); }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6); /* Dimmed background */
    backdrop-filter: blur(4px); /* Modern blur effect */
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.close-modal {
    position: absolute;
    right: 20px; top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-modal:hover { color: var(--charcoal); }