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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f6fa;
    color: #333;
    line-height: 1.6;
}

a {
    color: #409eff;
    text-decoration: none;
}

a:hover {
    color: #66b1ff;
}

/* Setup Page */
.setup-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #e8f4f8 0%, #f5f6fa 100%);
}

.setup-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 720px;
    padding: 40px;
}

.setup-header {
    text-align: center;
    margin-bottom: 32px;
}

.setup-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1d2129;
    margin-bottom: 8px;
}

.setup-header p {
    color: #86909c;
    font-size: 14px;
}

.setup-form .form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f5;
}

.setup-form .form-section:last-of-type {
    border-bottom: none;
}

.setup-form .form-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1d2129;
    margin-bottom: 4px;
}

.setup-form .form-help {
    font-size: 12px;
    color: #86909c;
    line-height: 36px;
    display: inline-block;
}

.setup-form .empty-label {
    display: block;
    height: 1px;
}

.form-desc {
    font-size: 13px;
    color: #86909c;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    flex: 1;
    min-width: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #4e5969;
    margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64,158,255,0.15);
}

.form-actions {
    text-align: center;
    margin-top: 24px;
}

.btn {
    display: inline-block;
    padding: 9px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.5;
}

.btn-primary {
    background: #409eff;
    border-color: #409eff;
    color: #fff;
}

.btn-primary:hover {
    background: #66b1ff;
    border-color: #66b1ff;
}

.btn-secondary {
    background: #fff;
    border-color: #d9d9d9;
    color: #4e5969;
}

.btn-secondary:hover {
    border-color: #409eff;
    color: #409eff;
}

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

.btn-danger {
    background: #f56c6c;
    border-color: #f56c6c;
    color: #fff;
}

.btn-danger:hover {
    background: #f78989;
    border-color: #f78989;
}

.btn-success {
    background: #67c23a;
    border-color: #67c23a;
    color: #fff;
}

.btn-success:hover {
    background: #85ce61;
    border-color: #85ce61;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #fef0f0;
    color: #f56c6c;
    border: 1px solid #fde2e2;
}

.alert-success {
    background: #f0f9eb;
    color: #67c23a;
    border: 1px solid #e1f3d8;
}

.alert-warning {
    background: #fdf6ec;
    color: #e6a23c;
    border: 1px solid #faecd8;
}

.alert-info {
    background: #f0f9ff;
    color: #409eff;
    border: 1px solid #d9ecff;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f4f8 0%, #f5f6fa 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: #1d2129;
    margin-bottom: 8px;
}

.login-header p {
    color: #86909c;
    font-size: 14px;
}

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

.login-form .form-actions {
    margin-top: 24px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #86909c;
}

/* Header / Navigation */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e8e8ed;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.topbar .logo {
    font-size: 18px;
    font-weight: 600;
    color: #1d2129;
}

.topbar .logo span {
    color: #409eff;
}

.topbar .nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar .nav-links a {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    color: #4e5969;
    transition: all 0.2s;
}

.topbar .nav-links a:hover, .topbar .nav-links a.active {
    background: #f0f9ff;
    color: #409eff;
}

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

.topbar .user-info .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #409eff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

.topbar .user-info .username {
    font-size: 14px;
    color: #1d2129;
    font-weight: 500;
}

/* Main Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1d2129;
}

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

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f5;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #1d2129;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #86909c;
    margin-top: 4px;
}

.stat-card.blue .stat-value { color: #409eff; }
.stat-card.green .stat-value { color: #67c23a; }
.stat-card.orange .stat-value { color: #e6a23c; }
.stat-card.purple .stat-value { color: #722ed1; }

/* Server Cards Grid */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.server-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #f0f0f5;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.server-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.server-card .card-body {
    padding: 20px;
}

.server-card .card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2129;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.server-card .card-title .badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.badge.badge-active {
    background: #f0f9eb;
    color: #67c23a;
}

.badge.badge-sold {
    background: #fef0f0;
    color: #f56c6c;
}

.server-card .specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin-bottom: 16px;
}

.server-card .spec-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4e5969;
}

.server-card .spec-item .spec-label {
    color: #86909c;
    min-width: 32px;
}

.server-card .card-footer {
    padding: 12px 20px;
    background: #fafafa;
    border-top: 1px solid #f0f0f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.server-card .card-footer .price {
    font-size: 20px;
    font-weight: 600;
    color: #f56c6c;
}

.server-card .card-footer .price small {
    font-size: 12px;
    font-weight: 400;
    color: #86909c;
}

/* Filter / Search Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-bar .search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.filter-bar .search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.filter-bar .search-box input:focus {
    border-color: #409eff;
}

.filter-bar select {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    color: #4e5969;
    outline: none;
    background: #fff;
}

/* Profile Page */
.profile-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.profile-sidebar {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #f0f0f5;
    padding: 24px;
}

.profile-avatar {
    text-align: center;
    margin-bottom: 20px;
}

.profile-avatar .avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #409eff;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
}

.profile-avatar .profile-name {
    font-size: 16px;
    font-weight: 600;
    color: #1d2129;
    margin-top: 12px;
}

.profile-avatar .profile-email {
    font-size: 13px;
    color: #86909c;
}

.profile-nav {
    list-style: none;
}

.profile-nav li {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #4e5969;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.profile-nav li:hover, .profile-nav li.active {
    background: #f0f9ff;
    color: #409eff;
}

.profile-content {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #f0f0f5;
    padding: 24px;
}

.profile-content h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1d2129;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f5;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #4e5969;
    border-bottom: 2px solid #f0f0f5;
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f5;
    color: #333;
}

.table tr:hover td {
    background: #fafafa;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #f0f0f5;
    margin-bottom: 24px;
}

.tab-item {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #86909c;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-item:hover {
    color: #409eff;
}

.tab-item.active {
    color: #409eff;
    border-bottom-color: #409eff;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal-header {
    padding: 20px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1d2129;
}

.modal-header .close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: #86909c;
    border-radius: 4px;
}

.modal-header .close-btn:hover {
    background: #f0f0f5;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 12px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #86909c;
}

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

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    color: #4e5969;
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: #409eff;
    color: #409eff;
}

.pagination .current {
    background: #409eff;
    border-color: #409eff;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
    }
    .server-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        flex-direction: column;
        gap: 12px;
    }
    .topbar {
        padding: 0 12px;
    }
    .container {
        padding: 12px;
    }
}

/* Transfer Section */
.transfer-section {
    margin-top: 20px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #f0f0f5;
}

.transfer-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1d2129;
    margin-bottom: 16px;
}

.text-muted {
    color: #86909c;
    font-size: 13px;
}

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

/* Card Actions */
.card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Buy Summary */
.buy-summary {
    background: #fafafa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.buy-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #4e5969;
    border-bottom: 1px solid #f0f0f5;
}

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

.buy-total {
    border-top: 2px solid #e8e8ed;
    margin-top: 4px;
    padding-top: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1d2129;
}

/* Terms Checkbox */
.terms-checkbox {
    background: #f0f9ff;
    border: 1px solid #d9ecff;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
}

.terms-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #4e5969;
}

.terms-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #409eff;
}

.terms-checkbox a {
    color: #409eff;
    text-decoration: underline;
}

.terms-checkbox a:hover {
    color: #66b1ff;
}

/* Badge for balance display */
.badge.balance {
    background: #f0f9eb;
    color: #67c23a;
    font-weight: 500;
}

/* Trade Options */
.trade-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.trade-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.trade-option:hover {
    border-color: #409eff;
    background: #f0f9ff;
}

.trade-option.selected {
    border-color: #409eff;
    background: #ecf5ff;
    box-shadow: 0 0 0 2px rgba(64,158,255,0.15);
}

.trade-option-icon {
    font-size: 20px;
    line-height: 1.2;
    color: #409eff;
    flex-shrink: 0;
}

.trade-option-content {
    flex: 1;
}

.trade-option-title {
    font-size: 15px;
    font-weight: 600;
    color: #1d2129;
    margin-bottom: 2px;
}

.trade-option-desc {
    font-size: 13px;
    color: #86909c;
}

.trade-option-price {
    font-size: 14px;
    font-weight: 600;
    color: #f5222d;
    margin-top: 4px;
}