:root {
    --bg-page: #0a0a0a;
    --bg-sidebar: #0a0a0a;
    --bg-card: #111111;
    --bg-card-alt: #1a1a1a;
    --bg-card-hover: #1e1e1e;
    --bg-input: #1a1a1a;
    --border-color: #2a2a2a;
    --border-light: #333;
    --text-primary: #fff;
    --text-secondary: #aaa;
    --text-muted: #999;
    --accent-green: #4ade80;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-blue: #3b82f6;
    --accent-success: #4ade80;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;
    --accent-info: #3b82f6;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text-primary); }
img { max-width: 100%; }
ul, ol { list-style: none; }

.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-page);
}

#sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width var(--transition);
    overflow: hidden;
}

#sidebar.collapsed { width: 64px; }
#sidebar.collapsed .nav-item span,
#sidebar.collapsed .nav-group-title,
#sidebar.collapsed .sidebar-logo span { display: none; }

.sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.sidebar-logo svg { flex-shrink: 0; }

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.nav-group { margin-bottom: 8px; }

.nav-group-title {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #666;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    transition: all var(--transition);
    position: relative;
    cursor: pointer;
}

.nav-item:hover {
    background: #1e1e1e;
    color: var(--text-primary);
}

.nav-item.active {
    background: #252525;
    color: var(--text-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--accent-green);
    border-radius: 0 2px 2px 0;
}

.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item:hover svg,
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

#main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

#sidebar.collapsed + #main { margin-left: 64px; }

#topbar {
    height: var(--topbar-height);
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(10, 10, 10, 0.85);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

#pageTitle {
    font-size: 16px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 18px;
    transition: all var(--transition);
}

.topbar-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.user-dropdown { position: relative; }

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.user-dropdown-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px;
    display: none;
    z-index: 200;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.user-dropdown-menu.open { display: block; }

.user-dropdown-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.user-dropdown-menu a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

#pageContent {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.page-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.page-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 16px;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.terminal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.terminal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #161616;
    border-bottom: 1px solid var(--border-color);
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:nth-child(3) { background: #28c840; }

.terminal-card-path {
    font-size: 12px;
    color: #666;
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

.terminal-card-body {
    padding: 20px;
}

.notification-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.notification-banner.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.notification-banner-icon { font-size: 18px; flex-shrink: 0; }
.notification-banner-text { flex: 1; font-size: 14px; color: var(--text-secondary); }
.notification-banner-action {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    font-size: 13px;
    transition: all var(--transition);
}
.notification-banner-action:hover { background: rgba(59, 130, 246, 0.25); }
.notification-banner-close {
    color: var(--text-muted);
    font-size: 18px;
    transition: color var(--transition);
    flex-shrink: 0;
}
.notification-banner-close:hover { color: var(--text-primary); }

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.metric-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.metric-card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.metric-card-bar { margin-bottom: 12px; }

.metric-card-details {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.metric-card-icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    opacity: 0.05;
}

.metric-card-icon svg { width: 80px; height: 80px; }

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.tag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
}

.tag-btn:hover {
    border-color: #555;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.tag-btn.active {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.tag-btn-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.instance-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.instance-card:hover {
    border-color: #444;
    background: #161616;
}

.instance-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.instance-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.instance-card-region {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-page);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.instance-card-name { font-size: 15px; font-weight: 600; }

.instance-card-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.instance-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.instance-card-info { display: flex; flex-direction: column; gap: 2px; }

.instance-card-info-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.instance-card-info-value {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.instance-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.instances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.instances-header { margin-bottom: 24px; }
.instances-header h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.instances-header p { font-size: 14px; color: var(--text-secondary); }

.instances-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.instances-toolbar .search-box { flex: 1; min-width: 240px; max-width: 400px; }

.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
}

.form-control:focus { border-color: #555; }
.form-control::placeholder { color: #666; }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-blue);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    border: none;
}

.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-green);
    color: #000;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    border: none;
}

.btn-success:hover { opacity: 0.85; }

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
}

.btn-danger:hover { background: rgba(239, 68, 68, 0.22); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition);
}

.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card-hover); border-color: #555; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
}

.btn-secondary:hover { background: var(--bg-card-hover); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition);
}

.icon-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.card-hover:hover {
    border-color: #444;
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title { font-size: 16px; font-weight: 600; }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: rgba(74, 222, 128, 0.1); color: var(--accent-green); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--accent-yellow); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.progress-bar-fill.success { background: var(--accent-green); }
.progress-bar-fill.danger { background: var(--accent-red); }
.progress-bar-fill.warning { background: var(--accent-yellow); }
.progress-bar-fill.info { background: var(--accent-blue); }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(6px);
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
}

.modal-header h3 { font-size: 18px; font-weight: 600; }

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition);
}

.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.modal-body { padding: 20px; }

.modal-footer {
    display: flex;
    gap: 8px;
    padding: 0 20px 20px;
    justify-content: flex-end;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 360px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success { border-left: 3px solid var(--accent-green); }
.toast-error { border-left: 3px solid var(--accent-red); }
.toast-warning { border-left: 3px solid var(--accent-yellow); }
.toast-info { border-left: 3px solid var(--accent-blue); }

.login-page {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

.login-left {
    flex: 1.2;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-left-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 60px;
}

.login-left-brand {
    font-size: 22px;
    font-weight: 700;
}

.login-hero h1 {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
}

.login-hero .highlight {
    color: var(--accent-green);
}

.login-hero p {
    color: var(--text-secondary);
    margin-top: 16px;
    max-width: 500px;
    line-height: 1.7;
}

.login-terminals {
    position: relative;
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.login-terminal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.login-terminal-header {
    padding: 8px 14px;
    background: #161616;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.login-terminal-dots {
    display: flex;
    gap: 5px;
}

.login-terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.login-terminal-dots span:nth-child(1) { background: #ff5f57; }
.login-terminal-dots span:nth-child(2) { background: #ffbd2e; }
.login-terminal-dots span:nth-child(3) { background: #28c840; }

.login-terminal-path {
    font-size: 11px;
    color: #555;
    font-family: monospace;
}

.login-terminal-body {
    padding: 14px;
    font-size: 13px;
}

.login-terminal-cmd {
    color: var(--accent-green);
    font-family: monospace;
    margin-bottom: 6px;
}

.login-terminal-text {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}

.login-terminal.large {
    grid-column: span 1;
}

.login-terminal.offset {
    position: relative;
}

.login-right {
    flex: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-form-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.login-form-card h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.login-form-card .form-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-form-card .form-control {
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    padding: 12px 14px;
}

.login-form-card .forgot-link {
    text-align: right;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: block;
}

.login-form-card .forgot-link:hover {
    color: var(--text-primary);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.login-btn:hover {
    opacity: 0.9;
}

.login-footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.login-footer-text a {
    color: var(--accent-green);
    font-weight: 500;
}

.login-footer-text a:hover {
    text-decoration: underline;
}

.login-copyright {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: #444;
    position: absolute;
    bottom: 0;
    width: 100%;
}

.home-hero {
    padding: 40px 0;
    text-align: center;
}

.home-hero h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.home-hero p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.servers-section { margin-top: 32px; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h3 { font-size: 18px; font-weight: 600; }

.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.server-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
    cursor: pointer;
}

.server-card:hover {
    border-color: #444;
    transform: translateY(-2px);
    background: #161616;
}

.server-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.server-card-name { font-size: 16px; font-weight: 600; }

.server-card-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-green);
}

.server-card-price span {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
}

.server-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.server-card-spec {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-page);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.server-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.server-card-quota { font-size: 13px; color: var(--text-muted); }

.search-box { position: relative; }

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.search-box input:focus { border-color: #555; }

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    transition: color var(--transition);
}

.detail-back:hover { color: var(--text-primary); }

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.detail-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-header-name { font-size: 22px; font-weight: 700; }
.detail-header-edit { color: var(--text-muted); transition: color var(--transition); }
.detail-header-edit:hover { color: var(--text-primary); }

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.detail-info-item { display: flex; flex-direction: column; gap: 4px; }

.detail-info-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-info-value { font-size: 14px; color: var(--text-primary); font-weight: 500; }
.detail-info-value.small { font-size: 12px; font-family: monospace; color: var(--text-secondary); }

.detail-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.detail-actions .btn-secondary,
.detail-actions .btn-primary,
.detail-actions .btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pill-group { display: flex; flex-wrap: wrap; gap: 12px; }
.pill-item { display: flex; flex-direction: column; gap: 6px; }
.pill-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

.pill-value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    font-family: monospace;
}

.pill-value button { color: var(--text-muted); transition: color var(--transition); }
.pill-value button:hover { color: var(--text-primary); }

.table-container { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #161616;
}

.data-table tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
.data-table tr:hover td { background: var(--bg-card-hover); }

.ticket-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ticket-filter-btn {
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    background: transparent;
    transition: all var(--transition);
    cursor: pointer;
}

.ticket-filter-btn:hover { border-color: #555; color: var(--text-primary); }
.ticket-filter-btn.active { border-color: var(--text-primary); color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }

.ticket-list { display: flex; flex-direction: column; gap: 8px; }

.ticket-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    cursor: pointer;
}

.ticket-item:hover { border-color: #444; }

.ticket-item-left { display: flex; align-items: center; gap: 12px; }
.ticket-item-title { font-size: 14px; font-weight: 500; }
.ticket-item-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ticket-item-right { display: flex; align-items: center; gap: 12px; }

.chat-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.chat-bubble.user {
    background: var(--accent-blue);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-bubble.admin {
    background: var(--bg-card-alt);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chat-bubble-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 24px; font-weight: 700; }

.recharge-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.recharge-option {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.recharge-option:hover { border-color: #555; background: var(--bg-card-hover); }

.recharge-option.selected {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

.recharge-option.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 14px;
    color: var(--accent-blue);
    font-weight: 700;
}

.recharge-option-amount { font-size: 20px; font-weight: 700; }
.recharge-option-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.payment-method:hover { border-color: #555; }

.payment-method.selected {
    border-color: var(--accent-green);
    background: rgba(74, 222, 128, 0.06);
}

.payment-method.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    color: var(--accent-green);
    font-weight: 700;
}

.payment-method-icon { font-size: 24px; }
.payment-method-name { font-size: 14px; font-weight: 500; }

.amount-input {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    color: var(--text-primary);
    width: 100%;
    outline: none;
}

.amount-input:focus { border-color: #555; }

.fee-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fee-table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.fee-table td:last-child { text-align: right; font-weight: 600; }
.fee-table tr:last-child td { border-bottom: none; font-size: 16px; }

.billing-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.billing-info-card .card-title { margin-bottom: 16px; }

.billing-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.billing-info-item { display: flex; flex-direction: column; gap: 4px; }

.billing-info-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.billing-info-value { font-size: 14px; color: var(--text-primary); font-weight: 500; }

.notes-inline { display: flex; align-items: center; gap: 8px; }

.notes-inline input {
    flex: 1;
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
}

.notes-inline input:focus { border-color: #555; }
.notes-inline .btn-sm { white-space: nowrap; }

.auto-renew-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.auto-renew-toggle .toggle-track {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: var(--border-color);
    position: relative;
    transition: background var(--transition);
}

.auto-renew-toggle .toggle-track.active { background: var(--accent-green); }

.auto-renew-toggle .toggle-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-primary);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--transition);
}

.auto-renew-toggle .toggle-track.active .toggle-thumb { transform: translateX(18px); }
.auto-renew-toggle .toggle-label { font-size: 13px; color: var(--text-secondary); }

.nat-port-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.nat-port-section .section-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.nat-port-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 20px;
}

.nat-port-table th,
.nat-port-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.nat-port-table th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #161616;
}

.nat-port-table tr:hover td { background: var(--bg-card-hover); }

.nat-port-table .btn-delete-port {
    color: var(--accent-red);
    font-size: 13px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nat-port-table .btn-delete-port:hover { background: rgba(239, 68, 68, 0.1); }

.nat-port-form {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.nat-port-form h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.nat-port-form .form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.nat-port-form .form-row .form-group { flex: 1; min-width: 100px; margin-bottom: 0; }
.nat-port-form .form-row .form-group.small { flex: 0 0 120px; }
.nat-port-form .form-row .btn-primary { flex-shrink: 0; height: 40px; }

.password-field { display: inline-flex; align-items: center; gap: 8px; }

.password-field .password-text {
    font-family: monospace;
    font-size: 14px;
    letter-spacing: 1px;
}

.password-field .btn-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition);
}

.password-field .btn-icon:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.action-buttons-group {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.action-buttons-group .card-title { margin-bottom: 16px; }
.action-buttons-row { display: flex; gap: 10px; flex-wrap: wrap; }

.renew-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.renew-option {
    padding: 12px;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.renew-option:hover { border-color: #555; background: var(--bg-card-hover); }
.renew-option.selected { border-color: var(--text-primary); background: var(--bg-card-hover); }

.renew-option-months { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.renew-option-price { font-size: 12px; color: var(--text-muted); }
.renew-option-discount { font-size: 11px; color: var(--accent-green); margin-top: 2px; }

.renew-summary {
    padding: 12px 16px;
    background: var(--bg-page);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.renew-summary .amount { font-size: 20px; font-weight: 700; }

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.copy-btn:hover { border-color: #555; color: var(--text-primary); }
.copy-btn.copied { border-color: var(--accent-green); color: var(--accent-green); }

.status-running { color: var(--accent-green); }
.status-stopped { color: var(--accent-red); }
.status-pending { color: var(--accent-yellow); }
.status-cancelled { color: var(--text-muted); }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state h4 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-yellow { color: var(--accent-yellow); }
.text-blue { color: var(--accent-blue); }
.text-gray { color: var(--text-muted); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--accent-green); }
.text-danger { color: var(--accent-red); }
.text-warning { color: var(--accent-yellow); }
.text-center { text-align: center; }
.bg-dark { background: var(--bg-page); }
.rounded { border-radius: var(--radius-md); }
.border { border: 1px solid var(--border-color); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.w-full { width: 100%; }
.hidden { display: none; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fade-in { animation: fadeIn 0.3s ease; }
.slide-in { animation: slideIn 0.3s ease; }
.pulse { animation: pulse 2s ease-in-out infinite; }

.page-title-area { margin-bottom: 24px; }
.page-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title-left { display: flex; align-items: center; gap: 12px; }
.page-title-left svg { flex-shrink: 0; color: var(--text-muted); }
.page-title-left h2 { font-size: 28px; font-weight: 700; }
.page-title-desc { font-size: 14px; color: var(--text-secondary); margin-top: 6px; }

.dashboard-welcome { margin-bottom: 24px; }
.dashboard-welcome h2 { font-size: 28px; font-weight: 700; }
.dashboard-welcome .username { font-weight: 700; }
.dashboard-welcome p { color: var(--text-secondary); margin-top: 4px; }
.dashboard-resource-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.dashboard-resource-card .flex { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.dashboard-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.dashboard-metric { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; }
.dashboard-metric-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.dashboard-metric-value { font-size: 28px; font-weight: 700; }
.dashboard-metric-value .currency { font-size: 14px; color: var(--text-muted); font-weight: 400; margin-left: 4px; }
.dashboard-announcements { margin-top: 24px; }
.dashboard-announcements h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; padding-left: 12px; border-left: 3px solid var(--text-primary); }
.announcement-item { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 12px; }
.announcement-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.announcement-tag { padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.announcement-tag.live { background: var(--accent-red); color: #fff; }
.announcement-tag.network { background: #333; color: #fff; }

.topup-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; }
.topup-amount-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 30px; }
.topup-amount-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.topup-amount-input { width: 100%; padding: 16px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 18px; color: var(--text-primary); outline: none; text-align: center; }
.topup-fee-table { width: 100%; margin-top: 20px; font-size: 14px; }
.topup-fee-table td { padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.topup-fee-table td:last-child { text-align: right; font-weight: 600; }
.topup-fee-table .total td { font-size: 18px; font-weight: 700; border-bottom: none; }
.topup-submit-btn { width: 100%; padding: 14px; background: #ccc; color: #000; border: none; border-radius: var(--radius-md); font-size: 15px; font-weight: 600; margin-top: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.topup-submit-btn:hover { background: #fff; }
.payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.payment-item { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition); position: relative; }
.payment-item:hover { border-color: #555; }
.payment-item.selected { border-color: var(--text-primary); background: rgba(255,255,255,0.04); }
.payment-item.selected::after { content: '\2713'; position: absolute; top: 8px; right: 10px; color: var(--accent-green); font-weight: 700; }
.manual-payment-toggle { margin-top: 16px; font-size: 14px; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; gap: 6px; }

.billing-layout { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 24px; }
.billing-filters { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.billing-summary-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 30px; display: flex; flex-direction: column; }
.billing-balance { font-size: 32px; font-weight: 700; margin: 8px 0 20px; }
.billing-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: auto; }
.billing-stat-label { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.billing-stat-value { font-size: 18px; font-weight: 700; margin-top: 4px; }
.billing-recharge-btn { width: 100%; padding: 14px; background: #ccc; color: #000; border: none; border-radius: var(--radius-md); font-size: 15px; font-weight: 600; margin-top: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.billing-recharge-btn:hover { background: #fff; }
.transaction-item { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border-color); }
.transaction-item:last-child { border-bottom: none; }
.transaction-name { font-size: 14px; font-weight: 500; }
.transaction-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.transaction-amount { font-size: 15px; font-weight: 600; }
.transaction-amount.negative { color: var(--text-primary); }
.transaction-amount.positive { color: var(--accent-green); }

.monitor-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; position: relative; overflow: hidden; }
.monitor-card-header { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.monitor-card-value { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.monitor-card-bar { margin-bottom: 8px; }
.monitor-card-bar-bg { height: 4px; background: var(--border-color); border-radius: 2px; }
.monitor-card-bar-fill { height: 4px; border-radius: 2px; transition: width 0.5s ease; }
.monitor-card-percentage { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.monitor-card-detail { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.monitor-card-icon { position: absolute; right: 16px; bottom: 16px; opacity: 0.05; }
.monitor-card-icon svg { width: 80px; height: 80px; }
.monitor-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }

.manage-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.manage-toolbar .search-box { flex: 1; min-width: 200px; max-width: 400px; }
.view-toggle { display: flex; align-items: center; gap: 2px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 2px; }
.view-toggle button { padding: 6px 10px; border-radius: var(--radius-sm); transition: all var(--transition); color: var(--text-muted); }
.view-toggle button.active { background: var(--bg-card-hover); color: var(--text-primary); }
.group-filter { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 9999px; border: 1px solid var(--border-color); font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.instance-checkbox { width: 16px; height: 16px; accent-color: var(--accent-green); cursor: pointer; flex-shrink: 0; }
.instance-flag { font-size: 20px; flex-shrink: 0; }
.copy-btn { background: none; border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 4px 6px; cursor: pointer; color: var(--text-muted); transition: all var(--transition); display: inline-flex; align-items: center; }
.copy-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
.billing-filters select { padding: 6px 12px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); color: var(--text-primary); font-size: 13px; cursor: pointer; }

.profile-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.profile-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 30px; }
.profile-user-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.profile-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-card-alt); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.profile-user-name { font-size: 18px; font-weight: 600; }
.profile-user-email { font-size: 13px; color: var(--text-muted); }
.profile-info-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--border-color); }
.profile-info-label { font-size: 14px; color: var(--text-secondary); }
.profile-info-value { font-size: 14px; font-weight: 500; }
.profile-save-btn { width: 100%; padding: 12px; background: #333; color: #fff; border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; margin-top: 20px; cursor: pointer; }
.profile-save-btn:hover { background: #444; }
.profile-section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin-bottom: 20px; }
.profile-section-title svg { color: var(--text-muted); }

.preferences-layout { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 24px; }
.pref-summary-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; }
.pref-summary-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.pref-summary-icon { width: 40px; height: 40px; border-radius: 50%; background: #1a1a1a; display: flex; align-items: center; justify-content: center; }
.pref-summary-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.pref-summary-item:last-child { border-bottom: none; }
.pref-on-tag { background: var(--accent-green); color: #000; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.pref-count { font-size: 13px; color: var(--text-muted); margin-top: 12px; }
.pref-detail-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; }
.pref-detail-item { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; border-bottom: 1px solid var(--border-color); }
.pref-detail-item:last-child { border-bottom: none; }
.pref-detail-left { display: flex; align-items: center; gap: 14px; }
.pref-detail-icon { width: 40px; height: 40px; border-radius: 50%; background: #1a1a1a; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pref-detail-text h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.pref-detail-text p { font-size: 12px; color: var(--text-muted); }
.toggle-switch { position: relative; width: 44px; height: 24px; cursor: pointer; flex-shrink: 0; }
.toggle-switch input { display: none; }
.toggle-switch .slider { position: absolute; inset: 0; background: #333; border-radius: 12px; transition: 0.2s; }
.toggle-switch .slider::before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: 0.2s; }
.toggle-switch input:checked + .slider { background: var(--accent-green); }
.toggle-switch input:checked + .slider::before { transform: translateX(20px); }

.ticket-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ticket-search { flex: 0 1 400px; }
.ticket-status-filters { display: flex; gap: 8px; margin-left: auto; }
.ticket-status-btn { padding: 6px 16px; border-radius: 9999px; font-size: 13px; border: 1px solid var(--border-color); background: transparent; color: var(--text-muted); cursor: pointer; transition: all var(--transition); }
.ticket-status-btn:hover { border-color: #555; color: var(--text-primary); }
.ticket-status-btn.active { border-color: var(--text-primary); color: var(--text-primary); background: rgba(255,255,255,0.06); }
.ticket-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); text-align: center; }
.ticket-empty svg { margin-bottom: 16px; opacity: 0.3; }
.ticket-empty h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.ticket-empty p { font-size: 14px; color: var(--text-muted); }

@media (max-width: 1024px) {
    .detail-info-grid { grid-template-columns: repeat(2, 1fr); }
    .metrics-grid { grid-template-columns: 1fr; }
    .monitor-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }

    #sidebar.open { transform: translateX(0); }

    #main { margin-left: 0; }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
        display: none;
    }

    .sidebar-overlay.active { display: block; }

    .servers-grid { grid-template-columns: 1fr; }
    .instances-grid { grid-template-columns: 1fr; }
    .detail-info-grid { grid-template-columns: 1fr; }
    .detail-actions { justify-content: center; }
    .pill-group { flex-direction: column; }
    #pageContent { padding: 16px; }

    .home-hero h2 { font-size: 24px; }
    .home-hero p { font-size: 14px; }

    .login-page { flex-direction: column; }
    .login-left { display: none; }
    .login-right { flex: 1; width: 100%; }
    .topup-layout { grid-template-columns: 1fr; }
    .billing-layout { grid-template-columns: 1fr; }
    .profile-layout { grid-template-columns: 1fr; }
    .preferences-layout { grid-template-columns: 1fr; }
    .monitor-grid { grid-template-columns: repeat(2, 1fr); }
    .manage-toolbar { flex-direction: column; align-items: stretch; }
    .ticket-toolbar { flex-direction: column; }
    .ticket-status-filters { margin-left: 0; }

    .chat-bubble { max-width: 85%; }

    .payment-methods { grid-template-columns: 1fr; }

    .metric-card-value { font-size: 1.5rem; }

    .tag-btn-grid { gap: 6px; }
    .tag-btn { padding: 6px 12px; font-size: 12px; }

    .modal { max-width: 100%; margin: 10px; }

    .topbar-left { gap: 8px; }
    #pageTitle { font-size: 14px; }
}

/* ========================================
   服务器选择网格和按钮
   ======================================== */
.server-select-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.server-select-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    white-space: nowrap;
}

.server-select-btn:hover {
    border-color: #555;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.server-select-btn.active {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

/* ========================================
   区域/国家标题样式（带底部装饰线）
   ======================================== */
.section-title-decorated {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 12px;
    border-bottom: 3px solid var(--text-primary);
    display: inline-block;
    margin-bottom: 20px;
}

.section-title-decorated .flag-icon {
    margin-right: 6px;
}

/* ========================================
   国家选中标题行（国旗+国家名+搜索框）
   ======================================== */
.region-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.region-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.region-header-title .flag-emoji {
    font-size: 20px;
}

.region-search-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    color: var(--text-primary);
    font-size: 13px;
    width: 180px;
    outline: none;
    transition: border-color var(--transition);
}

.region-search-input:focus {
    border-color: #555;
}

.region-search-input::placeholder {
    color: var(--text-secondary);
}

/* ========================================
   服务器详情面板样式
   ======================================== */
.server-detail-panel {
    padding: 24px;
}

.server-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.server-detail-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.server-detail-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 4px;
    color: #22c55e;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
    vertical-align: middle;
}

.server-detail-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.server-detail-desc .flag-prefix {
    margin-right: 4px;
}

.server-detail-specs {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.server-detail-specs .spec-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    margin-bottom: 12px;
}

.server-detail-specs .spec-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 16px;
}

.server-detail-specs .spec-price .currency {
    font-size: 14px;
    color: var(--text-secondary);
}

.server-detail-specs .spec-price .amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.server-detail-specs .spec-price .period {
    font-size: 14px;
    color: var(--text-secondary);
}

.server-detail-specs .spec-info {
    color: var(--text-secondary);
    font-size: 13px;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
}

.server-detail-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 13px;
}

.server-detail-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.server-detail-status .status-dot.online {
    background: #22c55e;
}

.server-detail-status .status-dot.offline {
    background: #ef4444;
}

.server-detail-status .status-dot.full {
    background: #f59e0b;
}

.server-detail-status .status-text {
    color: var(--text-secondary);
}

/* 节点资源选项折叠区 */
.server-resources-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    user-select: none;
    transition: color var(--transition);
}

.server-resources-toggle:hover {
    color: var(--text-primary);
}

.server-resources-toggle .toggle-arrow {
    transition: transform 0.2s ease;
    font-size: 12px;
}

.server-resources-toggle .toggle-arrow.expanded {
    transform: rotate(90deg);
}

/* 网络测速按钮 */
.speed-test-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
}

.speed-test-btn:hover {
    border-color: #555;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* ========================================
   确认按钮区域样式（购买按钮区）
   ======================================== */
.instance-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.instance-actions .coupon-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.instance-actions .coupon-input {
    flex: 1;
    max-width: 220px;
}
