/* ========== Dashboard Styles — NovaNode-Watcher ========== */

.dash-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Sidebar ── */
.dash-sidebar {
    width: 260px;
    background: rgba(10, 14, 23, 0.95);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    letter-spacing: 0.2px;
}

.sidebar-link:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.15);
}

.sidebar-link span {
    font-size: 17px;
    width: 24px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 16px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 8px 16px 4px;
    opacity: 0.6;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-username {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-plan {
    font-size: 11px;
    color: var(--accent-bright);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ── Main Content ── */
.dash-main {
    flex: 1;
    margin-left: 260px;
    padding: 40px 48px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 36px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.dash-page {
    display: none;
    animation: pageFade 0.35s ease;
}

.dash-page.active {
    display: block;
}

@keyframes pageFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Stat Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: border-color 0.3s, transform 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    border-color: var(--border-bright);
    transform: translateY(-2px);
}

.stat-card:hover::after {
    opacity: 0.6;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ── Cards ── */
.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
}

.dash-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.dash-card .card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: -10px;
    margin-bottom: 20px;
}

/* ── Tables ── */
.table-wrap {
    overflow-x: auto;
    margin: 0 -24px -24px;
    padding: 0 24px 24px;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.dash-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    vertical-align: middle;
}

.dash-table tr:last-child td {
    border-bottom: none;
}

.dash-table tr:hover td {
    background: rgba(139, 92, 246, 0.03);
}

/* ── Badges ── */
.severity-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.severity-critical {
    background: rgba(244, 63, 94, 0.12);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.severity-high {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.severity-medium {
    background: rgba(6, 182, 212, 0.12);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.severity-low {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── License Cards ── */
.license-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    transition: border-color 0.3s;
}

.license-card:hover {
    border-color: var(--border-bright);
}

.license-key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-bright);
    user-select: all;
}

.license-meta {
    display: flex;
    gap: 24px;
    margin-top: 12px;
}

.license-meta span {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Button Overrides ── */
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-danger {
    background: rgba(244, 63, 94, 0.12);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.25);
    font-weight: 600;
}

.btn-danger:hover {
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.4);
}

/* ── Admin Panel Specific ── */
.admin-section {
    margin-bottom: 28px;
}

.admin-section .dash-card + .dash-card {
    margin-top: 20px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.version-input-row {
    display: flex;
    gap: 12px;
    max-width: 400px;
}

.version-input-row input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    transition: border-color 0.3s;
}

.version-input-row input:focus {
    border-color: var(--accent);
}

/* Select dropdowns */
.plan-select {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: 6px;
    outline: none;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.3s;
}

.plan-select:focus {
    border-color: var(--accent);
}

/* ── Toggle Switches ── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.toggle-label small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

/* ── Empty States ── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dash-sidebar {
        width: 70px;
    }
    .dash-sidebar .nav-logo-text,
    .sidebar-username,
    .sidebar-plan,
    .sidebar-section-label {
        display: none;
    }
    .sidebar-link {
        justify-content: center;
        padding: 12px;
        gap: 0;
    }
    .dash-main {
        margin-left: 70px;
        padding: 24px 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
