:root {
    --nx-bg-main: #0a0b0e;
    --nx-bg-surface: #12151c;
    --nx-bg-card: #181d26;
    --nx-bg-card-hover: #222936;
    --nx-primary: #e50914;
    --nx-primary-hover: #ff1e27;
    --nx-accent: #00d1b2;
    --nx-text: #ffffff;
    --nx-text-muted: #8b95a5;
    --nx-border: rgba(255, 255, 255, 0.08);
    --nx-sidebar-width: 260px;
}

body {
    background-color: var(--nx-bg-main);
    color: var(--nx-text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism & Cards */
.nx-card {
    background: var(--nx-bg-card);
    border: 1px solid var(--nx-border);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nx-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.nx-stat-card {
    background: linear-gradient(135deg, var(--nx-bg-card) 0%, rgba(26, 32, 44, 0.6) 100%);
    border: 1px solid var(--nx-border);
    border-radius: 14px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.nx-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--nx-primary);
}

.nx-stat-card.stat-accent::before { background: var(--nx-accent); }
.nx-stat-card.stat-warning::before { background: #ffb800; }
.nx-stat-card.stat-danger::before { background: #e50914; }
.nx-stat-card.stat-success::before { background: #10b981; }

/* Sidebar */
.nx-sidebar {
    width: var(--nx-sidebar-width);
    background-color: var(--nx-bg-surface);
    border-right: 1px solid var(--nx-border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.nx-sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid var(--nx-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nx-sidebar-brand .logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 0%, #ff4b55 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nx-sidebar-brand .badge-control {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(229, 9, 20, 0.2);
    color: #ff4b55;
    border: 1px solid rgba(229, 9, 20, 0.4);
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
}

.nx-nav {
    padding: 1rem 0.75rem;
    flex: 1;
    overflow-y: auto;
}

.nx-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: var(--nx-text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.nx-nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nx-nav-item.active {
    color: #ffffff;
    background: rgba(229, 9, 20, 0.15);
    border: 1px solid rgba(229, 9, 20, 0.3);
    font-weight: 600;
}

.nx-nav-item.active i {
    color: var(--nx-primary);
}

.nx-content {
    margin-left: var(--nx-sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

@media (max-width: 992px) {
    .nx-sidebar {
        transform: translateX(-100%);
    }
    .nx-sidebar.show {
        transform: translateX(0);
    }
    .nx-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* Custom Table */
.nx-table {
    color: var(--nx-text);
    background: transparent;
}

.nx-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--nx-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--nx-border);
    padding: 0.85rem 1rem;
}

.nx-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--nx-border);
    vertical-align: middle;
    font-size: 0.9rem;
}

.nx-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge-online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-offline {
    background: rgba(229, 9, 20, 0.15);
    color: #ff6b72;
    border: 1px solid rgba(229, 9, 20, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-latency {
    font-family: monospace;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

/* Form Controls */
.form-control, .form-select {
    background-color: #0e1117 !important;
    border: 1px solid var(--nx-border) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 0.6rem 0.9rem !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--nx-primary) !important;
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.2) !important;
}

.form-check-input:checked {
    background-color: var(--nx-primary);
    border-color: var(--nx-primary);
}

/* Buttons */
.btn-primary {
    background-color: var(--nx-primary);
    border-color: var(--nx-primary);
    font-weight: 600;
    border-radius: 8px;
    padding: 0.6rem 1.25rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--nx-primary-hover);
    border-color: var(--nx-primary-hover);
    transform: translateY(-1px);
}

.btn-outline-light {
    border-color: var(--nx-border);
    color: #cbd5e1;
    border-radius: 8px;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* Mobile & TV Device Mockups for Appearance Preview */
.preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
    padding: 1.5rem;
    background: #08090b;
    border-radius: 16px;
    border: 1px solid var(--nx-border);
}

/* Phone Mockup */
.mockup-phone {
    width: 280px;
    height: 560px;
    background: #111;
    border: 10px solid #222;
    border-radius: 36px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mockup-phone .screen {
    flex: 1;
    background: var(--preview-bg, #0b0c0e);
    color: var(--preview-text, #ffffff);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* TV Mockup */
.mockup-tv {
    width: 520px;
    height: 310px;
    background: #111;
    border: 12px solid #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mockup-tv::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 40%;
    width: 20%;
    height: 8px;
    background: #333;
    border-radius: 4px;
}

.mockup-tv .screen {
    flex: 1;
    background: var(--preview-bg, #0b0c0e);
    color: var(--preview-text, #ffffff);
    display: flex;
    flex-direction: row;
    overflow: hidden;
    position: relative;
}

/* Common Mockup UI Elements */
.preview-hero {
    height: 140px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    background-image: linear-gradient(to top, rgba(0,0,0,0.9), transparent), url('/assets/img/default-backdrop.png');
}

.preview-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--preview-primary, #e50914);
    color: #fff;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: bold;
}

.preview-card-grid {
    display: flex;
    gap: 8px;
    overflow-x: hidden;
    padding: 8px 12px;
}

.preview-card {
    width: 65px;
    height: 95px;
    background: var(--preview-card, #1f222a);
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.05);
}

.preview-card.focus-ring {
    border: 2px solid var(--preview-accent, #00d1b2);
    transform: scale(1.05);
}
