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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #0f1117;
    color: #e4e4e7;
    min-height: 100vh;
}

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 12px;
    padding: 40px;
    width: 400px;
}

.login-box h1 { font-size: 24px; margin-bottom: 4px; }
.subtitle { color: #71717a; margin-bottom: 24px; }

/* Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: #1a1d27;
    border-right: 1px solid #2a2d3a;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 24px 20px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #2a2d3a;
}

.sidebar-nav { flex: 1; padding: 16px 12px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #a1a1aa;
    text-decoration: none;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.nav-item:hover { background: #252836; color: #e4e4e7; }
.nav-item.active { background: #22c55e20; color: #22c55e; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #2a2d3a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info span { display: block; font-size: 14px; }
.user-info small { color: #71717a; font-size: 12px; }

.main-content { flex: 1; padding: 32px; overflow-y: auto; }

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

.page-header h2 { font-size: 22px; }

.card {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.card h3 { margin-bottom: 12px; font-size: 16px; }
.card p { color: #a1a1aa; line-height: 1.6; margin-bottom: 8px; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #a1a1aa; }
.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    background: #0f1117;
    border: 1px solid #2a2d3a;
    border-radius: 8px;
    color: #e4e4e7;
    font-size: 14px;
    outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: #22c55e; }

.btn {
    padding: 8px 16px;
    border: 1px solid #2a2d3a;
    border-radius: 8px;
    background: #252836;
    color: #e4e4e7;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.btn:hover { background: #2a2d3a; }
.btn-primary { background: #22c55e; border-color: #22c55e; color: #fff; }
.btn-primary:hover { background: #16a34a; }
.btn-danger { background: #ef444420; border-color: #ef4444; color: #ef4444; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; padding: 12px; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #252836;
}
.badge.admin { background: #22c55e20; color: #22c55e; }

.hint { color: #71717a; font-size: 12px; margin-top: 12px; }
code { background: #252836; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: #ef444420; color: #ef4444; border: 1px solid #ef444440; }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #2a2d3a;
    font-size: 14px;
}
.table th { color: #71717a; font-weight: 500; }

.status-badge {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
}
.status-badge.online { background: #22c55e20; color: #22c55e; }
.status-badge.offline { background: #ef444420; color: #ef4444; }

.remote-layout { display: flex; flex-direction: column; gap: 16px; }
.remote-info p { color: #a1a1aa; line-height: 1.6; margin-bottom: 8px; }
.remote-meta { font-size: 14px; }
.remote-viewport {
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0b0f;
    padding: 24px;
}
.remote-placeholder { text-align: center; color: #71717a; }
.remote-placeholder .placeholder-icon { font-size: 56px; margin-bottom: 12px; opacity: 0.4; }
.remote-placeholder p { color: #a1a1aa; margin-bottom: 6px; }
#phoneFrame {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal.show { display: flex; }
.modal-content {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 12px;
    padding: 28px;
    width: 420px;
}
.modal-content h3 { margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
