/* ==========================================================================
   NovaPanel - Dark Modern Theme & Design Tokens
   ========================================================================== */

:root {
    --bg-dark: #0b0f19;
    --bg-card: #131b2e;
    --bg-card-hover: #1b2640;
    --bg-sidebar: #0e1424;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.3);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-secondary: #0ea5e9;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;

    --gradient-brand: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
    --gradient-card: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);

    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

body.dark-theme {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #1f293d;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* App Container Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    transition: all 0.3s ease;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-brand);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.brand-text h2 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.droplet-badge {
    display: inline-block;
    font-size: 10px;
    background: rgba(14, 165, 233, 0.15);
    color: var(--accent-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(14, 165, 233, 0.3);
    margin-top: 2px;
}

.server-status-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin: 16px 0;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-indicator.online {
    width: 8px;
    height: 8px;
    background-color: var(--accent-success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-success);
}

.server-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Nav Menu */
.nav-menu {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.nav-section {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 1px;
    padding: 12px 10px 4px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background-color: var(--bg-card-hover);
    color: #fff;
}

.nav-item.active {
    background: var(--gradient-brand);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info .avatar {
    font-size: 28px;
    color: var(--accent-primary);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.user-role {
    font-size: 10px;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Topbar Header */
.topbar {
    height: 64px;
    background-color: rgba(14, 20, 36, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease;
}

.btn-icon:hover {
    color: #fff;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    width: 320px;
}

.search-box i {
    color: var(--text-dim);
    font-size: 14px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13px;
    width: 100%;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vps-quick-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: var(--accent-primary-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.btn-outline-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-danger);
}

.btn-outline-danger:hover {
    background: var(--accent-danger);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Content Body */
.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.page-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title-bar h1 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.page-title-bar .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.quick-info-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--accent-secondary);
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.cpu-bg { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.ram-bg { background: rgba(14, 165, 233, 0.15); color: var(--accent-secondary); }
.disk-bg { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
.net-bg { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }

.stat-info {
    flex: 1;
}

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

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 4px 0 8px 0;
}

.progress-bar-wrap {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.cpu-bar { background: var(--accent-primary); }
.ram-bar { background: var(--accent-secondary); }
.disk-bar { background: var(--accent-success); }
.net-bar { background: var(--accent-warning); }

.stat-sub {
    font-size: 11px;
    color: var(--text-dim);
}

/* Live Charts Section */
.charts-row {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.flex-2 { flex: 2; }
.flex-1 { flex: 1; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-success);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.chart-body {
    height: 240px;
    position: relative;
}

/* Services Mini List */
.services-list-mini {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.service-name {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.green-icon { color: var(--accent-success); }
.blue-icon { color: var(--accent-secondary); }
.purple-icon { color: var(--accent-primary); }
.cyan-icon { color: #06b6d4; }
.orange-icon { color: var(--accent-warning); }

.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-full);
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Bottom Grid Tables */
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.custom-table th {
    padding: 10px 14px;
    color: var(--text-dim);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.domain-cell small {
    display: block;
    color: var(--text-dim);
    font-size: 11px;
}

.badge-ssl {
    font-size: 11px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.tag {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.btn-icon-sm {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    cursor: pointer;
    font-size: 13px;
}
.btn-icon-sm:hover { color: #fff; }

/* Audit Logs */
.audit-logs {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.log-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.log-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.log-icon.success { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
.log-icon.info { background: rgba(14, 165, 233, 0.15); color: var(--accent-secondary); }

.log-content p {
    font-size: 12px;
    color: var(--text-main);
}

.log-content small {
    font-size: 10px;
    color: var(--text-dim);
}

/* Terminal Console Styling */
.terminal-container {
    background: #050811;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    font-family: var(--font-mono);
}

.terminal-header {
    background: #0d1222;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.term-dots {
    display: flex;
    gap: 6px;
}
.term-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.term-title {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.terminal-body {
    padding: 16px;
    min-height: 420px;
    max-height: 520px;
    overflow-y: auto;
    font-size: 13px;
    color: #4ade80;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.term-line.output {
    color: #cbd5e1;
    white-space: pre-wrap;
}

.term-highlight {
    color: #38bdf8;
    font-weight: 600;
}

.term-prompt-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-text {
    color: #818cf8;
    font-weight: 600;
}

#term-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 13px;
    flex: 1;
}

/* 1-Click Apps */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.wordpress-icon { background: rgba(33, 117, 155, 0.2); color: #21759b; }
.phpmyadmin-icon { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.node-icon { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.docker-icon { background: rgba(14, 165, 233, 0.2); color: #0ea5e9; }

.app-card h3 { font-size: 16px; color: #fff; }
.app-card p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.btn-block { width: 100%; justify-content: center; margin-top: 8px; }

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 480px;
    max-width: 90%;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

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

.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.form-control {
    background: #0a0f1d;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: #fff;
    font-size: 13px;
    outline: none;
}
.form-control:focus { border-color: var(--accent-primary); }

.btn-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }

/* Badges */
.badge-success { background: rgba(16, 185, 129, 0.2); color: #10b981; padding: 4px 8px; border-radius: 4px; font-size: 11px; }

/* Login Gateway Backdrop & Card */
.login-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 17, 0.95);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 36px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(99, 102, 241, 0.15);
    backdrop-filter: blur(20px);
}

.password-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100% !important;
    padding-right: 48px !important;
    box-sizing: border-box !important;
}

.eye-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 15px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.eye-toggle-btn:hover {
    color: #818cf8;
    background: rgba(255, 255, 255, 0.1);
}

.login-logo {
    text-align: center;
}

.login-logo i {
    font-size: 40px;
    margin-bottom: 10px;
}

.login-logo h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.login-logo p {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.login-error-msg {
    font-size: 12px;
    color: #ef4444;
    text-align: center;
    font-weight: 600;
    display: none;
}
