:root {
    --bg: #070b14;
    --card: rgba(255, 255, 255, .05);
    --border: rgba(255, 255, 255, .1);
    --text: #fff;
    --muted: #9aa4bd;
    --primary: #4f8cff;
    --secondary: #7c4dff;
    --success: #4cff7b;
    --danger: #ff4c4c;
    --warning: #ffb74c;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Space Grotesk", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Animated background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(79, 140, 255, .25), transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(124, 77, 255, .2), transparent 35%);
    z-index: -2;
}

.stars {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(white 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: .12;
    animation: moveStars 80s linear infinite;
}

@keyframes moveStars {
    from { transform: translateY(0); }
    to { transform: translateY(-500px); }
}

.container {
    width: min(1100px, 90%);
    margin: auto;
}

/* Header */
header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(20px);
    background: rgba(7, 11, 20, .7);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Form Styles (Login & Settings) */
.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.auth-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    text-align: center;
}

.auth-card p {
    color: var(--muted);
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--muted);
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: .3s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 140, 255, 0.3);
}

.btn-secondary {
    border: 1px solid rgba(255, 255, 255, .12);
    color: white;
    background: transparent;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, .05);
}

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

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 76, 76, 0.3);
}

.btn-success {
    background: var(--success);
    color: var(--bg);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 255, 123, 0.3);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Dashboard Styles */
.dashboard {
    padding: 40px 0;
    flex: 1;
}

.welcome-section {
    margin-bottom: 40px;
}

.welcome-section h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.welcome-section p {
    color: var(--muted);
}

/* Status Widget */
.node-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .node-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.main-card {
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
}

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

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

.status-badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.online {
    background: rgba(76, 255, 123, 0.1);
    color: var(--success);
    border: 1px solid rgba(76, 255, 123, 0.2);
}

.status-badge.offline {
    background: rgba(255, 76, 76, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 76, 76, 0.2);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.metric-card .label {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.metric-card .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
}

/* Console Log / Process control */
.console-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    font-family: monospace;
    height: 180px;
    overflow-y: auto;
    color: #a7b5d4;
    margin-bottom: 20px;
    white-space: pre-wrap;
    font-size: 0.9rem;
}

.control-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Info side card */
.side-card {
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    height: fit-content;
}

.info-list {
    list-style: none;
    margin-top: 20px;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list li span:first-child {
    color: var(--muted);
}

.info-list li span:last-child {
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: var(--muted);
    margin-top: auto;
}

/* Alert notifications */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-danger {
    background: rgba(255, 76, 76, 0.15);
    color: #ff8080;
    border: 1px solid rgba(255, 76, 76, 0.3);
}

.alert-success {
    background: rgba(76, 255, 123, 0.15);
    color: #80ff9e;
    border: 1px solid rgba(76, 255, 123, 0.3);
}

/* Tab menu */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    padding: 12px 24px;
    border-radius: 12px;
    transition: 0.3s;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    background: var(--card);
    color: var(--primary);
    border: 1px solid var(--border);
    box-shadow: 0 4px 15px rgba(79, 140, 255, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    text-align: left;
}

th, td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

td {
    color: var(--text);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Simple grid for forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

